2020-05-11 11:26 AM
I'm trying port the SBSFU example STM32L476 board to our MCU which is STM32L475. Fortunately they are very similar. I'm going through the code and it makes sense but I could not find a single reference about porting it. ST has documents that explain what is going on but not how to port it. Which files should I be modified? I am going over all the source codes (.c, .h). Not sure what parts of the linker file (or any other files I'm not aware of) should be modified. A practical guide would have been useful.
A little rant: I wish this feature was implemented in the CubeMX, that would have made life a lot easier for people who don't have a long background in fw development.
2020-05-11 11:46 AM
Are you talking about https://www.st.com/en/embedded-software/x-cube-sbsfu.html or something else?
Have you gotten it working on any reference platform (Nucleo, Disco, Eval) that material is mentioning? (I'm not not using it and not going to investigate it)
Is there any material difference between the 'L475 and 'L476 at all, as far as bootloading is concerned? Review any possible differences in the memories and any related peripheral, and proceed according to those differences. I don't think you'll find many.
JW
2020-05-11 11:52 AM
Yes, I mean the expansion package.
I'm still trying to get it to work (don't have an eval, so should make the example work on my own device which is not disco or eval).
You probably pointed to my main problem here, the datasheets for them are not a few pages, so comparing them doesn't seem like a logical task. I didn't find any tool or reference that points to their differences. If I can figure that out then it's just digging into the datasheet and fixing differences.
2020-05-18 06:05 AM
Hello,
the SBSFU package contains an example for the L475 already.
What you need to adapt to your board is located in Target directory.
The integration of SSBSFU to CubeMX is under study but it a huge work for quite little added value.
The User application can be developed with CubeMX. You just need to adapt the mapping to fit to SBSFU.
Best regards
Jocelyn
2020-05-19 11:04 AM
Yes, I saw that but all the examples are for evaluation boards and BSP should be taken out. For example I wanted to test the SBSFU with debugger to make sure it goes to the state machine properly, but TRACE is using UART. I went through the code to make sure everything related to COM and BSP are removed.
Thanks for the guide, I found my way through the SECore and SBSFU, now working on the UserApp.
I understand with all the options and possibilities that SBSFU has it can be very hard to implement it into CubeMX but here are some points:
2020-05-20 01:56 PM
Well, I don't really catch what is the issue with tracing with UART. Why do you need to remove it ?
Anyway, you should be able to achieve this just removing the SFU_DEBUG_MODE flag in app_sfu.h.
Or is this a matter of removing BSP dependency ?
About point 1, you can remove loader from SBSFU using flag
#[define SECBOOT_LOADER SECBOOT_USE_NO_LOADER]
But here again I don't catch the problem you have with that.
About adding your own application instead of the demo application, this can be done by replacing the demo application.
This brings the constraint of having the application at same location to be able to use the scripts.
Having application in another directory requires adapting the directories in the postbuild script. I agree this require some work and could be improved
About point 2, I agree SBSFU contains too much hardcoded paths. Now this is usually one time modification to adapt to your project.
About point 3, this is a good idea. I will suggest this to development team. All your points are valid !
Best regards
Jocelyn
2020-05-21 08:57 AM
The MCU I'm using is in a designed board, so all the BSP dependencies should be removed and the UART is connected to a sensor. I went through the code and made it barebone. I agree that this is a one time thing.
The flags are very helpful, I used them.
My biggest trouble with replacing the UserApp is that I use CubeMX for my code which has a different directory structure than the sample code. So have to adapt it. It is feasible, my complain is that it is just time consuming. Maybe if only the UserApp was like a CubeMX build, other parts could be adapted once and the User App could be replaced easily. We use the same micro for different projects so I have different UserApp which can use the same SBSFU. Maybe this is a more of a rant as a novice user.