cancel
Showing results for 
Search instead for 
Did you mean: 

Programming the STM32WB with Openocd

mrchips
Associate II

Hi,

I need to program an STM32WB from a Raspberry Pi from the command line, preferably Python. I have got it up and running with my STM32FG0 but having no luck with the WB. From my understanding I need to:

  1. Program BLE Stack using FUS (Not sure how to do this using OpenOCD)
  2. Erase Application Coprocessor (Are there any specific flash banks or addresses I need to be aware of?)
  3. Program Bootloader (Should be simple)
  4. Program Application (Ideally I can do this Over The Air using the RPi's BLE but will settle for using OpenOCD if that isn't possible)

I have tried using the STM32CubeProgrammer but that doesn't run on the Raspberry Pi.

 

Any help or advice on the above would really help!

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,
please see few slides with installation guidance. Please note I was testing with RPI zero 2W, for other models setting of Box64 may differ(as described on Box64 github page). 

Best regards,
Lubos

View solution in original post

4 REPLIES 4
Lubos KOUDELKA
ST Employee

Hi,
I can suggest you two alternatives:
1) Stay with OpenOCD, FUS/stack programming solve in the same way how it's done in STM32CubeProgrammer - load FUS operator binary as CPU1 code, then load new CPU2 binary and somehow (button, writing RAM variable) activate FUS using FUS operator in CPU1
2) Using box64 install STM32CubeProgrammer and use STM32CubeProgrammer API. From my perspective more universal approach, but as STM32CubeProgrammer is emulated (and I used Raspberry Pi zero 2W during my test), execution is bit slower.

I'm able to share with you more guidance for both options.

Best regards,
Lubos

Hi Lubos,

 

Thank you for your reply. I think Box64 sounds like a better alternative as it gives me more freedom to use the CubeProgrammerCLI as intended, rather than using OpenOCD which doesn't seem the most reliable from some of my other work with STM32's. I can accept a slightly slower execution if it gives me a more reliable solution.

 

Please could you share a bit more on how you got this approach to work? I am unfamiliar with box64 and emulation in general on the Pi.

 

Thanks,

Hi,
please see few slides with installation guidance. Please note I was testing with RPI zero 2W, for other models setting of Box64 may differ(as described on Box64 github page). 

Best regards,
Lubos

Hi Lubos,

 

I hadn't thought to install it on another Linux machine and then copy the install file across. That has worked perfectly on my RPi4 and I can program the WB from a Python script on the Pi.

 

Thank you so much for the help.