Hello;
I'm tying to setup my program to run with the µTasker Bootloader from @mjbcswitzerland using Linker Scripts from MCUXpresso.
(https://www.utasker.com/docs/iMX/MCUXpresso.pdf - Section 5)
Using an SDK-Example (such as evkmimxrt1060_iled_blinky) and editing the Flash_Start address to be 0x60020400, E_ENTRY(resetISR) is 0x6002071D after compiling.
I don't know why, as the Linkerscript defines resetISR to be at the start:
INCLUDE "MIMXRT1062xxxxA_memory.ld"
ENTRY(ResetISR)
SECTIONS
{
/* Image Vector Table and Boot Data for booting from external flash */
.boot_hdr : ALIGN(4)
{
FILL(0xff)
__boot_hdr_start__ = ABSOLUTE(.) ;
KEEP(*(.boot_hdr.conf))
. = 0x1000 ;
KEEP(*(.boot_hdr.ivt))
. = 0x1020 ;
KEEP(*(.boot_hdr.boot_data))
. = 0x1030 ;
KEEP(*(.boot_hdr.dcd_data))
__boot_hdr_end__ = ABSOLUTE(.) ;
. = 0x2000 ;
} >BOARD_FLASH
/* MAIN TEXT SECTION */
.text : ALIGN(4)
{
FILL(0xff)
__vectors_start__ = ABSOLUTE(.) ;
KEEP(*(.isr_vector))
My startup from the SDK is:
What changes need to be made to ensure resetISR / E_Entry is at the start of flash?
Attached my linker scripts
Hi
When working with a boot loader the boot_hdr section is redundant and can be removed.
As long as isr_vector is located at the correct address the value of resetISR is irrelevant as its location is read from the reset vector and used as a jump address - it is probable already as it should be.
Also follow this video which shows how to take an SDK project and build it to operate with the loader: https://www.youtube.com/watch?v=5iT7KP691ls
It is showing how to do it with on-the-fly decryption but that is a detail as it is the same for unencrypted XiP if the encoding part is left out.
This other video adds details about how to adjust the SDK project to run in ITC (with optional encryption that has zero performance overhead) that can increase the project operation speed by up to 10x in comparison to XiP (zero wait state at up to 1.2G instructions per second on the i.MX RT106x) https://www.youtube.com/watch?v=fnfLQ-nbscI
Regards
Mark
Hello @mjbcswitzerland
Thanks for the info with resetISR and isr_vector, I was on the wrong track.
Watching the video the instructions appear to pretty much be the same as in your pdf apart from the flash start address, 0x60020400 --> 0x60080200.
(Interestingly enough, when I build my program with flash start at 0x60080200 it doesn't run, but 0x60020400 runs as expected.)
When reviewing my .map isr_vector is where expected:
text 0x60020400 0x5e600
FILL mask 0xff
0x60020400 __vectors_start__ = ABSOLUTE (.)
*(SORT_BY_ALIGNMENT(.isr_vector))
.isr_vector 0x60020400 0x2b8 startup_mimxrt1062.o
0x60020400 g_pfnVectors
0x60020400 __Vectors
0x600206b8 . = ALIGN (0x4)
0x600206b8 __section_table_start = .
0x600206b8 __data_section_table = .
I'm compiling my code in Embedded Coder with MCUXpresso GCC rather then in MCUXpresso, therefore I updated the generate.bat (see attached) and am initially running through cmd, rather then as a post build script.
Are the requirements for uTaskerConvert.exe documented anywhere? Is the issue in generate.bat / uTaskerConvert / boot_header
Attached my work files for reference.
Regards,
Sam