Question
Unable to get STM32F103ZE chip working
Posted on May 12, 2015 at 18:53
Problems getting new STM32 target running
I've developed a project on an STM32F103RB, and am now trying to move it to a F103ZE chip. However I cannot get my code to run.I have changed the linker file to accound for the change in RAM and flash size. I have changed the includes and makefile to point at the stm3210e_eval code instead of stm3210b_eval. In startup_stm32f10x_hd.s the BootRAM is set to 0xF1E0F85F.I have tried copying linker files generated in stm32cube to no avail. When I run more than a simple while(1) loop it seems to fall off the stack. I have been unable to initialise even the systick clock.In the linker script I have seen a couple of variations, with _estack set to either 0x2000FFFF or 0x20010000.It seems like maybe the heap and stack aren't being configured, I have the following in my .ld file:ENTRY(Reset_Handler)
_estack = 0x2000FFFF; /* end of RAM */_Min_Heap_Size = 0; /* required amount of heap */_Min_Stack_Size = 0x400; /* required amount of stack */MEMORY{FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512KRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K}SECTIONS{ .isr_vector : { . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } >FLASH .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ *(.text*) /* .text* sections (code) */ *(.glue_7) /* glue arm to thumb code */ *(.glue_7t) /* glue thumb to arm code */ *(.eh_frame) KEEP (*(.init)) KEEP (*(.fini)) . = ALIGN(4); _etext = .; /* define a global symbols at end of code */ } >FLASH /* Constant data goes into FLASH */ .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ . = ALIGN(4); } >FLASH .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH .ARM : { __exidx_start = .; *(.ARM.exidx*) __exidx_end = .; } >FLASH .preinit_array : { PROVIDE_HIDDEN (__preinit_array_start = .); KEEP (*(.preinit_array*)) PROVIDE_HIDDEN (__preinit_array_end = .); } >FLASH .init_array : { PROVIDE_HIDDEN (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array*)) PROVIDE_HIDDEN (__init_array_end = .); } >FLASH .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); KEEP (*(SORT(.fini_array.*))) KEEP (*(.fini_array*)) PROVIDE_HIDDEN (__fini_array_end = .); } >FLASH _sidata = LOADADDR(.data); .data : { . = ALIGN(4); _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ . = ALIGN(4); } >RAM AT> FLASH . = ALIGN(4); .bss : { _sbss = .; __bss_start__ = _sbss; *(.bss) *(.bss*) *(COMMON) . = ALIGN(4); _ebss = .; __bss_end__ = _ebss; } >RAM ._user_heap_stack : { . = ALIGN(4); PROVIDE ( end = . ); PROVIDE ( _end = . ); . = . + _Min_Heap_Size; . = . + _Min_Stack_Size; . = ALIGN(4); } >RAM /DISCARD/ : { libc.a ( * ) libm.a ( * ) libgcc.a ( * ) } .ARM.attributes 0 : { *(.ARM.attributes) }}Any help is very much appreciated, as I don't wish to start tearing my hair out just yet. #stm32-stm32f103-stm32f103ze