Thanks Mark.
Im not sure yet to understand some details.
You say the address to jump to user application is defined in UTASKER_APP_START, I see this define is in Loader.h, and when I choose Teensy 3.6 or FRDM-K66F, this is:
#define UTASKER_APP_START (32 * 1024) // application starts at this address
so this is 32768, 0x8000 in hex. But this is calculated automatically or I may/must configure it ?.
With current source code I understand I must configure the Linker Script for my applications to start in address 0x8000, so different to address 0x8080 that put in forum for Teensy. Thats right ??
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K
to
FLASH (rx) : ORIGIN = 0x00008080, LENGTH = 256K
I do not understand what is exactly the utility of RETAIN_LOADER_MODE. You say if it's TRUE, will force to keep in boot mode instead of to jump to user application, after the SD card has been searched for a file to load or after failure to detect the SD card after a short time. In the example you have put, seem this is configure to enter in boot mode if push and hold a switch in board, so I understand that with that example boot mode only will run if push that switch or if no user application present, and if user application present and do not push the switch, always will jump to user application.
How I must config the #define RETAIN_LOADER_MODE ? if I want that bootloader always check, when start, that SD card is present and with file to update firmware ?. I do not want enter in boot mode with a switch, I want that bootloader, when start, always check SD card and new firmware to update it, if present in SD card.
I think you replied me already about this question, but Im not sure if I have understand it correctly. With #define FORCE_BOOT() 1 and #define RETAIN_LOADER_MODE() 0, the bootloader, when start, always will check my SD card (without push any switch) and if SD card present and with a software.bin file, will update user application and will jump to it ?
2. To always start the loader just set
#define FORCE_BOOT() 1
Set also
#define RETAIN_LOADER_MODE() 0
so that it jumps to the application after checking the card.
Three more questions please:
1.- uTaskerConvert may work with HEX input file ??, this is the format of compiled program by Arduino with Teensy 3.6, a .HEX file instead of a .BIN.
So may I use for example uTaskerConvert program.hex output.bin -0x1234 –a748b6531124
2.- When I configure Project Properties > C/C++ General > Indexer, Enable project specific settings, Use active build configuration, Apply, OK, like see in your video, when I Exit from KDS and start again do not keep this configuration, I must configure again each time I run KDS. What is the problem ?
3.- The Bootloader binary, that I compile from KDS, is protected to avoid read and extract from microcontroller ?, I do not have yet experience with Kinetis and do not know yet how I must write a binary to microcontroller to avoid that somebody may read and extract binary. I work with Segger Jlink programmer to write binary to MK66, do not know if read protection must configure in Jlink software (J-Flash) or I must configure it in KDS or in your library source code.
Kind Regards