cancel
Showing results for 
Search instead for 
Did you mean: 

1_Image_BFU Project run exception when SFU_DEBUG_MODE is enabled

ethan2
Associate II

Here is my development environment:

Software: STM32Cube_FW_WL_V1.3.0

Hardware: NUCLEO-WL55JC1

When I run 1_Image_BFU based on the original project, it works fine and can be upgraded in different versions. But when I ported my own project to use, the upgrade was abnormal and didn't start. So I want to enable SFU_DEBUG_MODE to see what exception is happening in 1_Image_BFU. So, I enabled SFU_DEBUG_MODE in app_sfu.h Then I compiled the project there is a reminder of memory overflow.

企业微信截图_17328845532624.png

then i add SBSFU Code region and other regions in mapping_sbsfu.h,like this:

企业微信截图_17328847379138.png

and mapping_fwimg.h 

企业微信截图_17328848567191.png

 Then recompiled 1_Image_SECoreBin, 1_Image_BFU, and 1_Image_UserApp, it  was successful without any errors.

  I use tool to 'full chip erase' and programming BFU_UserApp.bin at 0x08000000.Then connect to the UART tool to view logs.

企业微信截图_17328858125062.png

 when i load the UserApp.sfb file and update it.

企业微信截图_17328858461311.png

The fw seems invalid.

I use tools to read memory: The location of the application slot appears to have been erased

企业微信截图_17328869989813.png

 Take a look at the memory of BFU_UserApp.bin , it doesn't seem to be at this address but at 0x00010000

企业微信截图_17328873192736.png

 Anyway, I suspect the generated bin file address anomaly caused this.Maybe something else was missing,Is there a professional who can take a look at it, thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ethan2
Associate II

After a lot of trouble I finally solved it.The cause of the problem is the irregular syntax, which does not use parentheses to cause address exceptions.

before:

企业微信截图_17332761142815.png

企业微信截图_17332761782815.png

 When parentheses are not used, the slot address in the generated Bin is abnormal.Therefore, when downloading to DK, invalid data is detected and erased

 

企业微信截图_17332763337715.png

 It works fine when parentheses are added.

企业微信截图_1733278182666.png

企业微信截图_17332764358404.png

企业微信截图_1733276496756.png

  Serve as a warning to all !

 

 

View solution in original post

2 REPLIES 2
ethan2
Associate II

I've been referring to some posts like:

https://community.st.com/t5/stm32-mcus-security/sbsfu-bl-is-not-transferring-controller-to-userapp/m-p/93813

  • I have shifted Application address (+ 0x1000) to accommodate increase in SBU size .
  • About SBU alignment requirement,STM32WL55XX is 2k aligned.
ethan2
Associate II

After a lot of trouble I finally solved it.The cause of the problem is the irregular syntax, which does not use parentheses to cause address exceptions.

before:

企业微信截图_17332761142815.png

企业微信截图_17332761782815.png

 When parentheses are not used, the slot address in the generated Bin is abnormal.Therefore, when downloading to DK, invalid data is detected and erased

 

企业微信截图_17332763337715.png

 It works fine when parentheses are added.

企业微信截图_1733278182666.png

企业微信截图_17332764358404.png

企业微信截图_1733276496756.png

  Serve as a warning to all !