printf not working when relocating stack to CCMRAM
I have a simple printf program which uses the RDImon specs and implements the fputc function.
printf and calls to a puts function result in a hardfault when the MSP is initialised to the CCMRAM. Code works fine when estack points to the main RAM location. For some reason there is an attempt in _puts_r to write to an invalid memory address of: 0x10010001 which results in the hard fault.
CCMRAM on the STM32F429 is enabled by default, and const strings are located in the rodata section in the flash.
printf( "Hello World!\n" );
/* Highest address of the user mode stack, choose either main RAM or CCM RAM */
_estack = 0x20030000; /* end of 192K RAM (using main RAM) */
//_estack = 0x10010000; /* use CCM RAM (64K) */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
BKPSRAM (rw) : ORIGIN = 0x40024000, LENGTH = 4K
}
Any ideas appreciated.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Adrian Gin
- Solved:
- Last query:
- Last reply: