Question
Suspected error in STM32F334X8_FLASH.ld in STM32CubeF3 1.3
Posted on September 26, 2015 at 08:02
Hi,
After struggling trying to make a Nucleo-F334R8 working with the latest HAL, I reached to the conclusion that the linker script shipped with the HAL is wrong. The memory sections are defined as follow:/* Highest address of the user mode stack */
_estack = 0x20003FFF; /* end of RAM */ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0x200; /* required amount of heap */ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 4K } But this script lead to a BusFault error, as STM32F334R8 has 12KB SRAM + 4KB CCM. So, changing the linker script in the following way solves the problem:/* Entry Point */
ENTRY(Reset_Handler) /* Highest address of the user mode stack */ _estack = 0x20003000; /* end of RAM */ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0x200; /* required amount of heap */ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 12K CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 4K } If I'm wrong, please explain me why the second link script works :) #stm32f334-nucleo-bus-fault