Hello,
I'm having an issue while trying to use the NXP MCU Boot with a MK66FX1.
I used the MK66FN2 SDK to build the bootloader (from what I understood, it should be fully compatible as memory regions are detected automatically by the bootloader).
I can use the bootloader to flash the application using both blhost and KinetisFlashTool.
I can flash the application image as many times as I want, provided that the application never actually boots. After the application boots and then going back to booloader, I get the following on blhost when trying to update the application:
Inject command 'flash-image'
Successful generic response to command 'flash-erase-region'
Wrote 51536 bytes to address 0xa000
Successful generic response to command 'write-memory'
(1/1) 1%GetOverlappedResult failed with error 31: A device attached to the system is not functioning.
Data phase write aborted by status 0x1 Failure.
Response status = 10004 (0x2714) No response packet from target device.
I also tried without the erase command, and the new firmware gets uploaded but not written to flash, but only if I never do an erase. After any erase I can't upload anything, getting the error above.
I checked the hex file for the application and all the necessary reserved addresses are correctly (as far as I could tell) created, mainly the BCA, which is all 0xFF. The Flash Configuration parameters are set to 0xFE FF.
My application is running in HSRUN and the bootloader is running in RUN mode.
I imagine that something on the application is changing some configuration and blocking the bootloader from writing to flash, although it can erase the flash.
After the application blocked the access, I downloaded the bootloader portion of memory from the chip with a segger debugger, erased the chip and then reflashed the downloaded memory portion and the bootloader returned to working conditions. So the application is not corrupting the bootloader.
Is there any place where I can look to find the issue?
Any help would be appreciated.
Thank you.
Solved! Go to Solution.
Dont understand it fully, but disabling BL_FEATURE_ENABLE_FLASH_PROGRAM_SECTION on the bootloader fixed the issue.
If anyone has any insights as to why this needs to be off, I would like also to know.
Thank you.
Dont understand it fully, but disabling BL_FEATURE_ENABLE_FLASH_PROGRAM_SECTION on the bootloader fixed the issue.
If anyone has any insights as to why this needs to be off, I would like also to know.
Thank you.