how to prevent the Lwip stack from shutting down after few transmissions in STM32?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-06 11:57 PM
I am currently writing a code to send joystick data from a PC to an STM32 Nucleo board. I use pygame to read joystick values and use the socket library of python to send data to MCU via a router. Both MCU and PC is connected to the router. On the MCU side, I use a modified example code of LWIP given in STM32 Cube pkg. The MCU also runs a FreeRTOS scheduler on which LWIP is running. I was able to get it run flawlessly in a 2 threaded FreeRTOS code. However, when I shift the code to a 16 threaded code[main project], LWIP stops working after a few exchanges. In a sense, I don't receive any ping after 4-5 exchanges.
Some things that were experimented with to resolve the issue
- reduced the publishing frequency from the PC side to 20hz. This increases the exchange duration but fails after few minutes.
- Tried reducing the ConfigMaxPriority parameter of FreeRTOS config from 56(cube ide default) to 16.[Operating time increased]
- tried changing FreeRTOS main heap memory and LWIP thread stack memory [no difference]
I think, its a memory issue. But not sure how to resolve. can anyone advice me on this ?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-20 10:12 PM
I was able to resolve this by downgrading to CMSIS v1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-07 4:37 AM
Update 1: I tried to find out heap utilisation with xPortGetFreeHeapSize() . When the ping stops , it still shows 35kb of unused memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-07 6:11 AM
Update 2 : The code is stuck at a free RTOS assert function
configassert( pxqueue- uxitemsize == 0 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-08 6:22 AM
Hello @SSRIN.1​ ,
You could perform a stack analysis or activate stack overflow detection in your RTOS in order to rule out a stack issue.
Please refer to this reference which may help you.
BeST Regards,
Walid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-20 10:12 PM
I was able to resolve this by downgrading to CMSIS v1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-21 1:45 AM
Hello @SSRIN.1​ ,
Good news! Thanks for sharing this.
Can you tell us which version of CMSIS is causing the problem?
BeST Regards,
Walid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-21 3:17 AM
CMSIS V2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-21 3:29 AM
Sorry, I didn't explain my question well.
Could you provide the Device Version Number given in the following file: (path: Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f4xx.h)
Example :
/**
* @brief CMSIS Device version number V4.3.3
*/
Thanks in advance.
BeST Regards,
Walid
