Hello @Martin KJELDSEN @All ALL ,
Facing issue in up-gradation of new firmware in following scenarios.
- I am using "STM32F412CGU6" microcontroller with MPU protection.
- My application stores the new firmware in an external SPI flash. Firmware data received using wirelessly.
- Firmware Integrity has been check successfully after receiving firmware wirelessly.
- Firmware activation command has sent to the device.
- The device is reboot using "HAL_NVIC_SystemReset".
- The device entered into Bootloader and where the bootloader verifies the valid flag and valid size of new firmware.
- If the bootloader satisfied the valid flag and firmware size it will read the new firmware data from the external flash and write it into internal flash.
- Once, internal flash is written successfully, Bootloader again verifies the Firmware Integrity using CRC check validation.
- Once CRC verification has done successfully, the Device jumps to the application location.
- The device starts running from its application location and fails during malloc operation. when it fails during malloc my application explicitly reboots the device.
The device works properly in the up-gradation of new firmware in the following scenarios.
- I am using "STM32F412CGU6" microcontroller with MPU protection.
- My application stores the new firmware in an external SPI flash. Firmware data received using wirelessly.
- Firmware Integrity has been check successfully after receiving firmware wirelessly.
- BEFORE SENDING FIRMWARE ACTIVATION COMMAND, PERFORMED HARD REBOOT MANUALLY.
- Firmware activation command has sent to the device.
- The device is reboot using "HAL_NVIC_SystemReset".
- The device entered into Bootloader and where the bootloader verifies the valid flag and valid size of new firmware.
- If the bootloader satisfied the valid flag and firmware size it will read the new firmware data from the external flash and write it into internal flash.
- Once, internal flash is written successfully, Bootloader again verifies the Firmware Integrity using CRC check validation.
- Once CRC verification has done successfully, the Device jumps to the application location.
- The device starts running from its application location without any issue.
In working cases, we performed only HARD REBOOT and the device works as per expectation.
Can you please suggest the solution if any?
Regards,
Nikunj Patel