cancel
Showing results for 
Search instead for 
Did you mean: 

Why AC6 System Workbench inserts wrong startup file when creating a new project?

Posted on March 08, 2017 at 11:04

Hi, I'm a newbie in the STM32 world. I have a lot of experience with Atmel ATmega and Xmega, and now I'm starting to learn ARM programming  using a nucleo-F446RE board and AC6 system workbench. 

I have a problem using standard interrupts. Exceptions work fine, but standard interrupts hangs once I activate any of them in the corresponding NVIC_ISERx bit. After struggling with the problem I have found that System Workbench uses a standard Cortex M assembly file (startup_stm32.s) that only defines vectors for common exceptions, all the peripheral IRQ vectors all filled with '0' with no names, so when an standard peripheral  interrupt triggers, the MCU jumps to no_one_knows....

I have replaced startup_stm32.s in startup directory with startup_stm32f466.s and now all IRQ's I have tested work OK.

I start all my projects from scratch using STM32 AC6 toolchain (File->New C project->Empty project using AC6 STM32 MCU GCC toolchain->NucleoF466RE board). So my question is why AC6 is using a useless startup file instead of using the one for the board I have choosen? 

Thanks,

 Jose Luis

#system-workbench-wrong-startup-file-and-irq-vectors
2 REPLIES 2
Jaroslav Malec
Associate
Posted on August 04, 2017 at 17:19

I also encountered this problem.

It behaves exactly how you described:

- IDE inserts a generic startup file instead of one for the corresponding device

- Zeros are where interrupt handlers should be

When the interrupt fires, the code path goes all over the place and havoc happens. Specifically, I think it goes through the Reset Handler and restarts code execution all over, albeit from the ISR context.

Subsequently HardFaults occur in totally irrelevant places.

I'll see if I can notify the IDE authors.

EDIT:

Actually, AC6 seem to know about the issue, as this issue had already been discussed on their forums in 2015:

http://www.openstm32.org/forumthread394

Yes, when you create a custom board, we use a generic interrupt vector table so, for now, you have to create it, either manually or by looking in a similar evaluation board and copying the startup.s file.

Their argumentation seems incorrect to me, since the startup files are independent from the board in question. They only relate to the MCU.

This is a serious flaw in my opinion.

alex.shirley
Associate II

You'd think that would be easy to script with CubeMX - and that this question isn't higher in google results.