Hi,
Still not work, event by following what's inside AN12384. But I can give you more information about my tests. I reduce all to juste relevant part to have a minimal example of what's not working.
I've got 2 simple programs.
* TestBoot (MCU settings: PROGRAM_FLASH 0x10000000, SIZE 0x60000)
- Plain Load Image SRAMX
- Global Data Placement SRAM_0_1_2_3
* TestFirmware (MCU settings: PROGRAM_FLASH 0x10060000, SIZE 0x60000)
- Plain Load Image SRAMX
- Global Data Placement SRAM_0_1_2_3
Both are very simple:
* TestBoot configure some gpio and blink led.
* Then jump to TestFirmware (0x10060000)
* TestFirmware configure some gpio and blink led (other color)
I program both in my external flash with jflash (with data and merge data):
* TestBoot at 0x10000000
* TestFirmware at 0x10060000
I reset the device:
* I see expected led from TestBoot blink
* When the jump occurs, there's a reset on the device, and I fall back to the TestBoot blink
* And so on
I never saw the led from TestFirmware.
I try different code in firmware (with or without GPIO configuration), but I do think that the problem is the jump code that cannot reach my TestFirmware application.
Here's the jump function:
static void boot_tofwimage(unsigned addr) // depuis l'AN12384
{
void (*firmwareFunc)(void);
uint32_t fwStack = *((uint32_t*) (addr));
uint32_t fwEntry = *((uint32_t*) (addr + 4U));
firmwareFunc = (void (*)(void)) fwEntry;
SCB->VTOR = addr;
__set_MSP(fwStack);
__set_PSP(fwStack);
firmwareFunc();// let's go
}
What's seems weird to me: If I run my TestBoot app step by step, and the firmwareFunc() jumps to ResetISR() that restart the TestBoot !
The main difference between the LPC54s18 and the one in AN (LPC5460) is the fact that there's no flash inside.
So, do you have an AN that I can read for a device like the LPC54s18.
Do I have to ensure special features when I compile my firmware ? Options, relocation ?
Do I have to transfer something in RAM ? ...
My project is completely stuck without a valid bootloader, so any advice will be welcome.
I can perform some tests if needed.
Regards