AnsweredAssumed Answered

KL16 reset problem after in application programming

Question asked by Ivan Santanna on Oct 25, 2018
Latest reply on Oct 29, 2018 by Mark Butcher

Hello all,

I'm using a KL16 64Kb Flash MCU and I intend to have a Firmware Upgrade application on it.
So, I'm using the C90TFS lib to erase and program the internal MCU flash. I'm receiving the new FW from a external modem and saving it on a external serial flash. After complete the FW download and check the FW integrity, the code is jumping to a protected memory section at the end of flash memory and execute all the Flash drivers from C90TFS. Exporting the internal MCU flash memory to a file, I can check that the image recorded at internal flash after my application is iqual to the flash image before erase function (the flash image is the same recording by my routine and by JTAG device).

After procedure completed, I execute a NVIC_SystemReset(); to reset the MCU.
Everytime that I record the same firmware version that was recorded by JTAG device, I can see by debuger that the internal flash is erased and re-recorded with the same image and than the MCU resets and runs...
However, when I update the FW (put a new version using the FOTA routine) the MCU doens´t reset... I can see the firmware at the internal flash, but I think that the reset vector has been lost...
I'm erasing all the internal flash memory (from 0x0000 to 0xEFFF) including Interrupt Vector, Flash Config, and Text segments. My Fota segment starts on 0xF000 (size 0x1000).
If I'm replacing all the interrupt vector, why the MCU doesn't reboot?


Following is my memory structure:

MEMORY {
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000200
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_interrupts_ram (RW) : ORIGIN = 0x1FFFF800, LENGTH = 0x00000200
m_fota (RX) : ORIGIN = 0x0000F000, LENGTH = 0x00001000
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0000EBF0
m_data (RW) : ORIGIN = 0x1FFFFA00, LENGTH = 0x00001E00
}

 

I'm looking forward your feedback,

 

Best regards,

 

Ivan

Outcomes