2021-02-23 10:01 AM
Hello everyone,
I want to get 4Diac Forte, which will be added as a static library, working on my Nucleo F767Zi.
I need FreeRTOS with LwIP, so I created a base Project in CubeIDE with FreeRTOS+LwIP which was running fine.
Since the library I want to add is written in C++ I only got it to work after converting my Project to C++ in CubeIDE. Now I can add the library without any errors, however I noticed that after a couple seconds up to a few minutes, ethernet communication stopped working on my Board.
After some fruitless debugging I decided to retrace my steps and start with a fresh project to see at which point the error occurs.
Long story short, after trying a clean Project with FreeRTOS + LwIP both as C aswell as C++ Project, after max. 5 minutes the Ethernet connection crashes, but only in the C++ Project.
My C Project was running fine for 30+ minutes, after I converted it to C++ it stopped working aswell.
It is stuck in ethernetif_input(), specifically at LOCK_TCPIP_CORE(), which is a macro for sys_mutex_lock(&lock_tcpip_core).
#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core)
sys_mutex_lock is stuck in osMutexAcquire in cmsis_os2.c at:
if (xSemaphoreTake (hMutex, timeout) != pdPASS) {
My steps to get to this point where:
Am I missing something to get FreeRTOS + LwIP to work in a C++ Project?
Or, alternatively, is there a way to add a C++ library to a C Project? I only know that I can add a C library to a C++ project but not sure how that would work the other way around.
Any help is greatly appreciated
2021-02-24 12:08 AM
If I switch to CMSIS V1 it works fine (running for 10+ min now).
So I guess the bug has to be in the CMSIS V2 layer
2021-02-24 02:39 AM
There is no "some bug". It's all a broken bloatware. You cannot make it working with clicking CubeMX.
2021-02-24 04:07 AM
Yes I would prefer to do it myself but I dont want to spend days getting a basic Project running just to test some library for a prototype.
Abstraction layers aren't necessarily bad
2021-02-27 11:05 AM
Abstraction layers are not bad, but STM32 HAL/CubeMX implementation is terrible.
2023-06-22 04:38 AM
Ok, yep. Same here!