2021-04-07 02:56 AM
I'm sure I'm missing out something obvious as I'm fairly green with limited programming experience, but I could not port the STM32F413 project to run on my own STM32F417 board. I've scoured this topic and followed Security Part6 - STM32 security ecosystem - 04 Experience SBSFU benefits - YouTube, but I'm stuck at basically level 0, where I can't even get the SBSFU to run - There is nothing on the terminal. It is very likely some changes that I am missing out. Can someone who has managed to port to this device point me in the right direction?
2021-04-07 09:42 AM
Hello Michael,
The 2 chips have different clocking capabilites and also difference flash size.
So, first thing you need to do is to change the clocking of the SBSFU, so that it can run properly.
You can reuse the clocking you use for your application for instance.
Then, deactivate all the protections in app_sfu.h so that you can debug
You will probably need to change the uart and associated pins to get the trace.
Same for LED and push button.
Also, change the slot mapping in linker file so that it fits in you flash memory mapping
This should allow you to have a first start
Best regards
Jocelyn
2021-04-14 06:29 PM
Hi Jocelyn,
Thanks for the reply. I was sure I did everything correctly but after your reply I deleted everything, unzipped the package again and carefully went through the process again. And it worked (mostly).
For those having the same issue - there are a number of places where it is possible to trip up if you are using your own hardware.
1) I needed to Adjust the HSE_VALUE in stm32f4xx_hal_conf.h to match my crystal - the uart was running at 3x speed as my crystal was 25MHz
2) in the linker file for SBSFU, the value for the top of the stack is hardcoded - needs to be edited to suit your device. I think this is why my project couldn't run. When I changed it, it worked.
/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of SB RAM1 */ <- Had to edit this value
Hope this is correct and will help others. If incorrect, please feel free to comment and correct me so that others can be helped as well, as this it the whole point of a community forum.
Thanks!