Hi Mark,
I have been testing the uTasker bootloader in USB-MSD mode following some of your tutorials. I am using an MK22FN1M0AVMC12 in a custom board that has followed the design from the kit TWR-K21F120MA.
By changing my Led pin and configuring the bootloader to this TWR board, and configuring it to disable the watchdog and do not force the bootloader mode (as below)
#define WATCHDOG_DISABLE() (1)
#define FORCE_BOOT() (0)
I was able to load my application as well, when changing the starting address of the application from:
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
to:
m_interrupts (RX) : ORIGIN = 0x00008080, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00008480, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00008490, LENGTH = 0x000FFBF0-0x8080
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
I have also tested a similar modification but starting at 0x8200, and changing the line below
From #define ROOT_FILE_ENTRIES 4
To #define ROOT_FILE_ENTRIES 16
This, following the indication of one of your posts that for all interrupts to work correctly, vector table must be 512 byte. This results in the memory map indicated below:
m_interrupts (RX) : ORIGIN = 0x00008200, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00008600, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00008610, LENGTH = 0x000FFBF0-0x8200
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
Now, in both cases I see my application starts as I activate a Led in certain pattern, but if I place the lines of this same Led activation further in my code, it seems these lines are never reached and the program stops. Device is not resetting since watchdog is inactive, and is not going to bootloader mode since this is also forced to be disabled.
On every reset I see the initial part of my program runs (by activating a buzzer), but the rest of my program does not continue until the end, and my Led blinking routine seems not to be reached.
Do you have any suggestions on what may be happening that prevents the complete application to run? Is there a restriction on where the interrupt vectors should start? I saw there is an option to move these to RAM, but I would prefer to keep them in FLASH; should a different address be used for this purpose (or an additional modification in my application code that I am missing?)
In addition, if I will be using interrupts of different kinds (GPIOs, timers), will these interrupts work as normal just by changing the start of the interrupt vector, or should additional modifications be done to guarantee the interrupt functionality?
Thank you in advance!
Best Regards,
Ivan