Hi Mark,
Please can you give me some pointers building SerialLoader for FRDM-KL26Z board? The code builds and downloads to the board, and I see the uTasker Serial Loader V1.5 interface on a the Segger VCOM port. Start address is 0x00008080 and bc/dc/ld are working. Strictly, the loading hangs when I try to load uTaskerV1.4.8_BM_FRDM-KL26Z_8080.srec (I converted uTaskerV1.4.8_BM_FRDM-KL26Z_8080.bin to srec using tool srec_cat BM_FRDM-KL26Z_8080.bin -binary -offset 0x8080 -o test.srec) but when I get the MSD working I'll try with the binary file.
But I see a "Device not recognized" from Windows 10 when I attach to USB port on my PC. The board heartbeat LED (green) flashes during the enumeration, and then sticks on or off. Normally this is a clocking issue, but if I run the code in debugger, the code is in irq_default(), caused by __aeabi_uidivmod() called from fnUSB_handle_frame().
#if defined USB_DEVICE_SUPPORT // {29}
if ((tx_queue->usCompleteMessage % tx_queue->usMax_frame_length) == 0) { // if the transmitted data length was divisible by the frame length
if ((tx_queue->usLimitLength != tx_queue->usCompleteMessage) || (fnControlEndpoint(iEndpoint, iChannel, (USB_ENDPOINT_TERMINATES)) != 0)) { // {26}
FNSEND_ZERO_DATA(ptrUSB_HW, iEndpoint); // send a zero frame to terminate status stage
}
So I don't think this is a clocking issue. Same behaviour with 2nd Windows 10 machine, same behaviour with W7 and same behaviour with Mac OX 12.4 Monterey.
The 'background'.
The code is compiled in MCUXpresso v11.5.1. Source provenance is from git repo uTaskerV1.4. Since I am using MCUX, I've coped the 'template' project files .project and .cproject into the top directory.
I'm using a 'stock' FRDM-KL26Z (but with Segger JLink installed on the CMSIS-DAP debugger). The board is working OK with *.bin files downloaded from https://www.utasker.com/kinetis/FRDM-KL26Z.html
Inside the project, I've set the architecture to Cortex M0+, updated the linker file to KL_128_16.ld and selected FRDM_KL26Z in the config.h file. This all appears to be configured OK - clock settings match the board for example - and there is no SD card on this board (so #define SDCARD_SUPPORT is not defined, etc). Searching the project for FRDM_KL26Z doesn't return many locations, and I've checked them all. I wasn't sure about USB_CLOCK_GENERATED_INTERNALLY in app_hw_kinetis.h but I've tried it commented and not commented, without success.
One common problem building bootloaders is they get too big and overflow the space reserved for them. This build has BM load address starting at 0x00008080 and the image size for the bootloader is less than this. Last line address in uTaskerSerialLoader.srec in \Applications\uTaskerSerialboot\MCUX\uTaskerSerialLoader_FLASH\uTaskerSerialLoader.srec is 0x5094 so I don't believe that the bootloader is corrupted. But your image from the above URL is 0x401a / 16410 bytes. I don't know why mine is bigger (I'm using -Os).
I'm going to test an earlier version of MCUXpresso IDE later today and will report back with progress.