2018-03-21 06:31 AM
Hi,
I'm unable to run NUCLEO STM32F303 board with Atollic (Embedded C Program).
The processor is the STM32F303K8, the program is the template proposed by Atollic.
It's all Ok whith mbed Compiler.
The same program run correctly with NUCLEO STM32L013 and Atollic compiler.
The problem is that the main() function is never reached.
A Hard Fault during the startup phase (file startup_stm32f303x8.s) stops the program.
More in detail, when the instruction 'push {r7} ' is executed (after calling SystemInit), a hard fault is generated.
The same don't happens using STM32L013 or STM32F722 MCUs (same program, same compiler).
Can you help me ?
Thnks
Giampaolo
#hard-fault #stm32f3Solved! Go to Solution.
2018-03-23 06:25 AM
Hallo,
I just solved the problem.
The cause was the wrong linker file.
In the file generated by TrueSTUDIO for STM32F303K8, the stack was allocated to a reserved memory area (0x20004000).
With the stack correctly located at 0x20003000 (as from the data sheet of the MCU), everything works correctly.
I reported the problem in the forum discussion titled 'Stack lenght wrong in Atollic linker file'.Here you can find both the files: the wrong and the right.
Thanks for your interest.
Best Regards,
Giampaolo
2018-03-23 04:30 AM
Hello
pantaleoni.gp
,Can you please precise which CubeF3 firmware package are you using ?
Best Regards,
Imen
2018-03-23 06:25 AM
Hallo,
I just solved the problem.
The cause was the wrong linker file.
In the file generated by TrueSTUDIO for STM32F303K8, the stack was allocated to a reserved memory area (0x20004000).
With the stack correctly located at 0x20003000 (as from the data sheet of the MCU), everything works correctly.
I reported the problem in the forum discussion titled 'Stack lenght wrong in Atollic linker file'.Here you can find both the files: the wrong and the right.
Thanks for your interest.
Best Regards,
Giampaolo
2018-03-26 07:26 AM
Hallo Imen,
I've just used Atollic C-project wizard.
A piece of the file (produced by the tool) follows.
Thanks again.
Best Regards.
Giampaolo Pantaleoni
/*
******************************************************************************
File: stm32f30_flash.ldInfo: Generated by Atollic TrueSTUDIO(R) 9.0.0 2018-03-26Abstract: Linker script for STM32F303K8 device
Set heap size, stack size, stack location, memory areas and
sections according to application requirements.The MIT License (MIT)
Copyright (c) 2018 STMicroelectronics...
...
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20004000; /* end of 16K RAM *//* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0; /* required amount of heap */_Min_Stack_Size = 0x80; /* required amount of stack */2018-03-26 08:45 AM
Hello
pantaleoni.gp
,After check my project withSTM32Cube_FW_F3_V1.9.0 and TrueSTUDIO
V 9.0.0, I have in the linker file the End of RAM at
0x20003000.
Please check if you
are using an old version of Cube package that need update.
Best Regards,
Imen