Hi,
We would like to migrate to a microcontroller without memory (LPC540xx) for one of our products.
Therefore I have to write a new bootloader which jumps to the main program which is located in the external flash (SPIFI). I have to run the main program as a Plain Load Image, because the flash is too slow. However, jumping to the main program does not work for me as soon as I set the main program as a Plain Load Image.
I have written a short test program that only blinks an LED three times and then jumps back to the beginning of the test program.
If I run the test program as XIP, the LED blinks endlessly.
As a Plain Load Image, the LED only flashes three times because the jump does not work.
Do I have to set the jump address differently for a Plain Load Image?
I set the start address for the stack pointers with the following define:
#define APPL_ADDRESS ((uint32_t)0x10000000) /* Application start address */
In the .map file, my XIP program says:
0x0000000010000000 _image_start = LOADADDR (.text)
0x0000000010000e38 _image_end = (LOADADDR (.data) + SIZEOF (.data))
0x0000000000000e38 _image_size = (_image_end - _image_start)
0x0000000010000000 __imghdr_loadaddress = LOADADDR (.text)
0x0000000000000003 __imghdr_imagetype = 0x3
And as Plain Load Image:
0x0000000010000000 _image_start = LOADADDR (.text)
0x0000000010000e38 _image_end = (LOADADDR (.data) + SIZEOF (.data))
0x0000000000000e38 _image_size = (_image_end - _image_start)
0x0000000000000000 __imghdr_loadaddress = ADDR (.text)
0x0000000000000001 __imghdr_imagetype = 0x1
I also looked at the program flashloader from NXP, because this can jump to a program in flash which is a Plain Load Image. But I can't figure out what I'm doing differently.
I am grateful for any hint!
Regards Mareike