It didn't work with this setting. Anyway, I was using the MCUXpresso Managed Linker Scripts in MCUXpresso Style where I can select the stack location from a drop down list.
But, what I didn't thought about, was that my application uses the AN10866 secondary USB Bootloader. In this application, not a LPC1769 is configured, but a compatible, though less memory, LPC1764. If I change the setting in the bootloader project (or create a new project) and update the bootloader, the stack pointer actually moves to the desired location.
But why do I have to change this setting in the bootloader? Doesn't the linker script from my second location apply? Do I explicitly have to state in the bootloader code that my application should load the stackpointer etc. from the application code?
The bootloader starts the application with this:
#define USER_START_SECTOR 4
#define MAX_USER_SECTOR 17
...
#define USER_FLASH_START (sector_start_map[USER_START_SECTOR])
#define USER_FLASH_END (sector_end_map[MAX_USER_SECTOR])
...
void execute_user_code(void)
{
void (*user_code_entry)(void);
unsigned *p;
SCB->VTOR = (USER_FLASH_START & 0x1FFFFF80);
p = (unsigned *)(USER_FLASH_START +4);
user_code_entry = (void *) *p;
DEBUG_OUT("Running user app from flash.\n");
user_code_entry();
}
So the vector table is updated. Shoudn't update this the Stack Pointer as well? My application is, of course, configured to start at 0x4000.
Thanks!
Jan