2024-09-29 01:16 PM
Hi, we are trying to flash with keil mdk bin file and failing when validating user firmware. Below is the output from Tera Term.
= [SBOOT] System Security Check successfully passed. Starting...
======================================================================
= (C) COPYRIGHT 2017 STMicroelectronics =
= =
= Secure Boot and Secure Firmware Update =
======================================================================
= [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL
= [SBOOT] STATE: CHECK STATUS ON RESET
INFO: A Reboot has been triggered by a Hardware reset!
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: CHECK KMS BLOB TO INSTALL
= [SBOOT] STATE: CHECK USER FW STATUS
A FW is detected in the slot SLOT_ACTIVE_1
= [SBOOT] STATE: VERIFY USER FW SIGNATURE
= [SBOOT] STATE: HANDLE CRITICAL FAILURE
= [SBOOT] STATE: REBOOT STATE MACHINE
========= End of Execution ==========
= [SBOOT] System Security Check successfully passed. Starting...
======================================================================
= (C) COPYRIGHT 2017 STMicroelectronics =
= =
= Secure Boot and Secure Firmware Update =
======================================================================
= [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL
= [SBOOT] STATE: CHECK STATUS ON RESET
INFO: A Reboot has been triggered by a Software reset!
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: CHECK KMS BLOB TO INSTALL
= [SBOOT] STATE: CHECK USER FW STATUS
No valid FW found in the active slots nor new FW to be installed
Waiting for the local download to start...
= [SBOOT] STATE: DOWNLOAD NEW USER FIRMWARE
File> Transfer> YMODEM> Send ...........................................
It is waiting forever to download new user firmware, didn't have any issues until application firmware modified and being new to keil mdk, not able to figure out why application code changes disrupting memory mapping.
Below is the SCT file
#! armclang --target=arm-arm-none-eabi -mcpu=cortex-m0plus -E -xc
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
#include "..\..\Linker_Common\MDK-ARM\mapping_sbsfu.h"
#include "..\..\Linker_Common\MDK-ARM\mapping_fwimg.h"
LR_IROM1 (SLOT_ACTIVE_1_START + 0x200) { ; load region size_region
; FLASH
vector_start (SLOT_ACTIVE_1_START + 0x200) FIXED VECTOR_SIZE {
*.o (RESET, +First)
}
ROM_region +0 {
*(InRoot$$Sections)
.ANY (+RO)
}
; NVM FLASH Data
; WARNING: Symbols not used. The NVMS address is defined in lora_app.c
; RW_LW_NVM_ROM 0x0803F000 0x00001000
; Non-backup SRAM1
RW_IRAM1 SB_REGION_RAM_START SB_RAM_REGION_SIZE { ; RW data
.ANY (+RW +ZI)
}
; NVM RAM Data
RW_LW_NVM_RAM LW_NVM_RAM_START UNINIT LW_NVM_RAM_REGION_SIZE { ; RW data
*(.bss.LW_NVM_RAM)
*(.bss.LW_NVM_BACKUP_RAM)
}
}
; extra ROM region to make sure the binary size is a multiple of the AES block size (16 bytes) and WL flash writing unit (8 bytes)
LR_ROM1(+0) ALIGN(16) {
ForAlignment +0 {
startup_stm32wl55xx_cm4.o (ALIGNTOAESBLOCK,+Last)
}
}
Any help or pointing in the right direction greatly appreciated.
Thanks
2024-09-29 01:18 PM
BTW, this is on STM32WL55JCI7U board.
2024-09-29 08:00 PM
Adding more details as we are troubleshooting this issue for quite sometime....
If user FW size is less than 80KB, uploading via Y modem working fine, at least tested successfully with 72KB file, but .sfb file of size 82KB failing. It appears to be not even transferring to the device, failing right away after attempting to transfer first chunk of 1024 bytes.
2024-09-30 11:30 AM
We are able to flash the .bin file fine, but problem seems to be with .sct file and hanging at "EXECUTE USER FIRMWARE", something wrong with our .sct file and not able to figure out. Any help would be greatly appreciated.
Below is the .sct file and execution address starting at SLOT_ACTIVE_1_START + 0x200
--------------------
#! armclang --target=arm-arm-none-eabi -mcpu=cortex-m0plus -E -xc
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
#include "..\..\Linker_Common\MDK-ARM\mapping_sbsfu.h"
#include "..\..\Linker_Common\MDK-ARM\mapping_fwimg.h"
LR_IROM1 (SLOT_ACTIVE_1_START + 0x200) { ; load region size_region
; FLASH
vector_start (SLOT_ACTIVE_1_START + 0x200) FIXED VECTOR_SIZE {
*.o (RESET, +First)
}
ROM_region +0 {
*(InRoot$$Sections)
.ANY (+RO)
}
; NVM FLASH Data
; WARNING: Symbols not used. The NVMS address is defined in lora_app.c
; RW_LW_NVM_ROM 0x0803F000 0x00001000
; Non-backup SRAM1
RW_IRAM1 SB_REGION_RAM_START SB_RAM_REGION_SIZE { ; RW data
.ANY (+RW +ZI)
}
; NVM RAM Data
RW_LW_NVM_RAM LW_NVM_RAM_START UNINIT LW_NVM_RAM_REGION_SIZE { ; RW data
*(.bss.LW_NVM_RAM)
*(.bss.LW_NVM_BACKUP_RAM)
}
}
; extra ROM region to make sure the binary size is a multiple of the AES block size (16 bytes) and WL flash writing unit (8 bytes)
LR_ROM1(+0) ALIGN(16) {
ForAlignment +0 {
startup_stm32wl55xx_cm4.o (ALIGNTOAESBLOCK,+Last)
}
}
-------------------
= [SBOOT] System Security Check successfully passed. Starting...======================================================================
= (C) COPYRIGHT 2017 STMicroelectronics =
= =
= Secure Boot and Secure Firmware Update =
======================================================================
= [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL
= [SBOOT] STATE: CHECK STATUS ON RESET
INFO: A Reboot has been triggered by a Software reset!
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: CHECK KMS BLOB TO INSTALL
= [SBOOT] STATE: CHECK USER FW STATUS
A FW is detected in the slot SLOT_ACTIVE_1
= [SBOOT] STATE: VERIFY USER FW SIGNATURE
= [SBOOT] STATE: EXECUTE USER FIRMWARE