cancel
Showing results for 
Search instead for 
Did you mean: 

Working TrueSTUDIO FreeRTOS project crashes while starting the scheduler in STM32CubeIDE.

Benny1
Associate II

I switched from Atollic TrueSTUDIO to STM32CubeIDE on a trial basis to see how the program feels. We were able to import our project without any problems. Some settings had to be made, but then we were able to compile the project successfully. It is noticeable that with two identical projects (and in my opinion the same project settings) two .elf files of different sizes are created by TrueSTUDIO and STM32CubeIDE.

Nevertheless we could flash the code and start the program. I reached the breakpoint in the main() as well. So far, everything seems fine. Unfortunately the program crashes when the scheduler is started after the whole hardware initialization.

We are using FreeRTOS. The same program ran in TrueSTUDIO without any problems.

For test purpose I tried to replace the .elf file of STM32CubeIDE with the one from TrueSTUDIO already and flash it as well. This leads to the same crash.

What is the problem? Where can I look up? I guess it is a problem with settings. But I can't figure out which one causes the problem, because everything in TrueSTUDIO and STM32CubeIDE looks the same to me in the first step.

We use a STM32F767NI (CubeIDE shows now STM32F767NIHx - whatever the Hx means) with Segger J-Link as debugger and STM32CubeIDE 1.1.0.

Project settings I changed (were not imported correctly from TrueSTUDIO):

  • Builder type: Internal builder
  • Build settings: Enable parallel build
  • Floating-point unit: FPv5-D16
  • Floating-point ABI: Hardware implementation
  • MCU GCC Linker General: Add symbol cross referance table to map file

All other project settings get imported correctly.

For debugger settings:

  • I needed to create a new configuration
  • create STM32 Cortex-M C/C++ Application
  • changed debug probe to Segger J-Link
  • choose Interface SWD
  • SWV enabled and set core clock settings
2 REPLIES 2
Markus GIRDLAND
ST Employee

Are you 100% certain that it's the TrueSTUDIO .elf file that you're flashing to the target? Or does CubeIDE build again and then overwrite it?

Also, could you send me the .cproject files for both projects? That might give us a clue as to what the situation is.

Benny1
Associate II

I'm 100% certain.

I did the complete procedure again and this time I explicitly made sure that the .elf file is not overwritten. The result is the same as described.

The program gets stuck when starting the scheduler and ends up in a HardFault. I sent you the files. I'm looking forward to your reply.

edit:

Something curious: When I transfer the generated .elf by STM32CubeIDE and look at the code with the debugger, the program crashes.

If I just let the code run without debug-mode, it runs without problems.