cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 ST-Link Utility crashes if CCM code segment used

craigs
Associate
Posted on February 13, 2013 at 01:28

I'm adding a code segment to my gcc linker script to allow the placement of objects in the Close Coupled Memory (CCM) memory block.

The additions to the linker script are as follows:

MEMORY

{

boot_flash : org = 0x08000000, len = 1024k

flash : org = 0x08000000, len = 256k // restrict to 256k

ram : org = 0x20000000, len = 112k

ethram : org = 0x2001C000, len = 16k

ccm : org = 0x10000000, len = 64k

}

...deleted

.ccm :

{

PROVIDE(_ccm_start = .);

. = ALIGN(4);

*(.ccm)

. = ALIGN(4);

*(.ccm.*)

. = ALIGN(4);

_ccmend = .;

} > ccm

This compiles fine, and the .map file shows that any objects

with the following attribute are located correctly.

__attribute__ ((section (''.ccm'')))

However, the resultant .bin file cannot be loaded onto the board using the Windows STM32 ST-Link Utility because the load operation does finish. The load progress bar never shifts from zero, and if I leave the program running for several hours, it will consume more and more memory until the system locks up.

I can program and run the .bin file using my own in-application-programmer, so I know the file is OK. Removing the new CCM code segment allows the STM32 ST-Link to load the file OK.

I'm using the latest version of the ST-Link utility on Windows 7. The version information is reported at:

STM32 DT-Link Utility.exe v2.3.0

STLinkUSBDriver.dll v4.2.3.0

ST-LINK_CLI.exe v1.3.0

I'm using the CodeSourcery toolkit:

arm-none-eabi-gcc (Sourcery CodeBench Lite 203-56) 4.6.3

Has anyone else been able to make this work?

Craig

#stm32-stm32f4-ccm-linker-section

1 REPLY 1
Posted on February 13, 2013 at 01:52

Has anyone else been able to make this work?

Yeah, I used NOLOAD, that way the C runtime initializes it (like all RAM) and the debugger isn't physically loading anything there. Pretty sure if you try to run code in CCM it faults the F4's processor, on the F3 it's attached to the IBUS so would work for code. The context is not exactly like your's, but might help.

/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Make%20use%20of%20the%2064k%20CCM&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=776

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..