2020-01-21 06:33 AM
Hello,
we switched from a STM32F7 to a STM32H7, porting the program to it.
I disabled D Cache, because it wouldnt work together with the ethernet. Now we got another Problem:
-Some Funtions of the STL are working, others are not. For example mmcpy or memset is fine, TIME, localtime or Strtok is not or only partly working.
Anyone experienced this?
edit: using gcc and cubeide
2020-01-21 07:12 AM
IDEs use to have architecture-specific versions of each library. Perhaps alignment or stack size issues ?
To be honest, I haven't worked with a H7 yet. And neither with CubeIDE.
2020-01-21 07:52 AM
Both MCUs have the same CPU core, and strtok() has no system specific code. If it has stopped working, then something is corrupting memory.
2020-01-21 07:56 AM
Okay i got the problem. but no solution its a freertos thing.
This functions only fail, when called out of a task, in initialization they work fine.
2020-01-21 08:01 AM
Could even reproduce it in a new empty CubeMx created project
2020-01-21 09:32 AM
Specify "fail".
JW
2020-01-21 09:38 AM
for example malloc wont provide memory, so the pointer gets set to NULL, strtok only provides the first tokenized stringt. Calling localtime(&time) will simply produce a hardfault.
2020-01-21 09:48 AM
Are we sure strtok() is even thread safe?
2020-01-21 09:53 AM
its not, like malloc and free, but in the "real" application they are guarded. The problem occurs even with a single task running at highest priority and not getting preempted
2020-01-21 10:23 AM
@BengofEtech - Please see my web page below explaining your problem and how to fix it:
http://www.nadler.com/embedded/newlibAndFreeRTOS.html
Best Regards, Dave
@Markus GIRDLAND , @Camilo LEMOS:
This is approximately the 25th thread from an ST customer impacted by this problem.
I provided ST with the solution last July...