Hello,
Below are my bootloader and application code sequences.
Bootloader steps:
- Initialize the BSP, Clock and required peripherals.
- Stay in bootloader for BLE connection.
- After connection successful, start receiving application binary.
- Check CRC if CRC correct then, Erase all sectors for application, write received application binary using SPI driver in to 16Mb ext. flash in to dedicated memory area. (Please see the Bootloader and Application memory address details below.)
- After successful written, read back from ext. flash and confirm the CRC.
- If CRC matches -> Disable IRQ, Disable peripherals, Initialize SP and PC to application and Jump to Application vector address.
So I have assigned 1 Mb of memory of ext. flash for bootloader i.e. 0x60000000 size 0x100000
And prepare the application binary using keil IDE with 3 Mb space allocated i.e. 0x60100000 Size 0x300000
So I'm initializing the SP, PC and suggesting bootloader to jump on below address of application Vectors
__Vectors 0x60102000 Number 1024 startup_mimxrt1062.o(.isr_vector)
When I'm flashing my bootloader and application with JTAG ULINKPRO debugger both are working fine.
When I'm trying to update firmware using BLE(By following above Bootloader steps) it's not jumping to application and stuck in BL itself.
I have toggled 2 different LED's i.e.
LED1 Blinks - When I'm in bootloader.
LED2 Blinks - When I'm in application.