cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeiDE + RTOS float problem

stm32f4
Associate II

Hi all.

i have problem using float and double in mytest application.

I hjave an aplication generated using stm32cubeide Version: 1.0.2

Build: 3566_20190716-0927 (UTC), CUBEMX ver 4.21.0.

Application use FreeRTOS Kernel V10.0.1 and task.

in a task i read temperature valu from a sensor and try to set the value in a variable.

Variable contain garbage but with debug i can see rigth value returned from sensor.

i cannot get hint from google search.

Someone ha the same problem? may you suggest same?

Regards,

Carmelo GAllucci

13 REPLIES 13

@Dave Nadler​ 

After following your instructions, I got rid of HardFault when using float over FreeRTOS, but ran into the other issue. I recorded all I did in the PDF report inside the zip. Simply speaking, HardFault disappeared, but the behavior of tasks were different: Task01 only ran once which was supposed to run every 100ms. I also put my code into the zip for your reference.

Hope to get your opinion on this. Thank you very much.

@CC Huang​ Follow-up: CC's remaining issue was fixed by increasing task stack sizes; CC's project works fine with my heap_useNewlib and replacement sbrk.

@Markus GIRDLAND​ This is ANOTHER customer who's project crashed because of STM's improper newlib integration (wrong sbrk, incorrect FreeRTOS flags).

This is averaging about one customer per week; STM really needs to fix this.

Again, this is discussed here:

https://community.st.com/s/question/0D50X0000BB1eL7SQJ/bug-cubemx-freertos-projects-corrupt-memory?t=1567779959768

http://www.nadler.com/embedded/newlibAndFreeRTOS.html

Hello Dave,

I can definitely see that many people are having problems with this. I raised this issue and created a ticket when you made your first forum post about this. The issue has received high priority and its current status is that it will be discussed by our architecture committee since this issue extends beyond only the IDE team.

I've provided an updated version of the web page and code here:

http://www.nadler.com/embedded/newlibAndFreeRTOS.html

@Markus GIRDLAND​ - Any status update?

Please let your architecture group know they're free to contact me for any clarifications or suggestions,

Thanks,

Best Regards, Dave