SiliconLabs / wiseconnect

Next-generation Silicon Labs Wi-Fi API for SiWx91x chipset family.
Other
14 stars 9 forks source link

sl_si91x_host_allocate_buffer calls malloc directly #4

Open schoeler opened 1 year ago

schoeler commented 1 year ago

Hi, I noticed the version of sl_si91x_host_allocate_buffer() in malloc_buffers.c calls malloc directly, won't this cause issues with FreeRTOS's pvPortMalloc?

Also, the version of sl_si91x_host_allocate_buffer() in static_buffer.c seems to have dependencies on lwip pbuf, and doesn't seem to check the length or increment the buffer offset to allow for multiple callers? I see this function can be called by multiple callers. it also probably needs a critical section between tasks.

Thanks

Silabs-Tarun commented 1 year ago

Hello Ben

Thanks for pointing this out.. We will analyze and get back when this can be fixed.

rozalin-ubihere commented 4 months ago

Hi, I noticed the version of sl_si91x_host_allocate_buffer() in malloc_buffers.c calls malloc directly, won't this cause issues with FreeRTOS's pvPortMalloc?

Also, the version of sl_si91x_host_allocate_buffer() in static_buffer.c seems to have dependencies on lwip pbuf, and doesn't seem to check the length or increment the buffer offset to allow for multiple callers? I see this function can be called by multiple callers. it also probably needs a critical section between tasks.

Thanks

Hey -

I also had this issue, though there's a relatively simple workaround (at least for IAR EWARM). Under the linker tab, add the following command line option. This should redirect any/all instances of 'malloc' within your code to 'pvPortMalloc', and ditto for 'free'.

image