cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX / Eclipse project - boot from flash

Francesco Agosti
Associate II
Posted on December 16, 2016 at 17:37

Hello, I have a generic stm32f103C8T6 board and I am having troubles booting projects I create with STM32CubeMX from the internal flash.

I create an empty ARM STM32F103 project in Eclipse, generate code in Cube and then use a python script to copy code into my eclipse project.

I can build and flash the elf / hex using my J-Link and I can debug the uploaded software, no problem there, works like a charm (led blinks, USART sends data...).

However, if I try to boot my device, it will 'freeze'.

I thought it was an issue with the BOOT0 / BOOT1 configuration, but now I know it is not the case.

In fact other projects I create in Eclipse and for which I do not import Cube code, work via debugger or booting from flash indifferently.

So I guess this is due to the system\src\cmsis\startup_stm32f103xb.S file that replaces the standard system\src\cmsis\vectors_stm32f10x.c file... but I don't seem to find anything wrong with it (I am a noob tho...)

Any suggestions?

Thanks!

In attach the startup file generated by STM32CubeMX

2 REPLIES 2
Sergio Fabbrini
Associate II
Posted on March 20, 2017 at 13:51

I'm having the same problem with my custom board based on STM32F101 chip. Eclipse (System Workbench for STM32) created projects work, but CubeMX imported doesn't.

Agosti.Francesco

‌ do you solve your problem?

Thanks.

Sergio Fabbrini
Associate II
Posted on March 21, 2017 at 09:19

Some debugging lead me to the answer:

I'm using a delay function that use DWT, but a too simple initialization of it generate the problem during normal execution (I didn't investigate on the difference from debug to regular execution).

So, at least for me, the problem is not on importing the project from CubeMX, but on the code added to the project after the import.

Bye.