Skip to main content
ChrisLB
Associate II
October 21, 2020
Solved

Production programming of STM32WB, including FUS and CoPro

  • October 21, 2020
  • 22 replies
  • 6146 views

Trying to figure out the best way of programming CPUs for production.

With other projects, we would normally get the microcontroller programmed before the PCB SMT stage. This service doesnt appear to be available for STM32WB (too new?), so the intention is to use 4x ST-LINK devices in parallel to program 4 boards at a time on the assembly line.

Whilst I'm fairly clear on how to achieve this using the command line tools, I would like to check this is the only / best way of doing it. The time it takes to upgrade FUS (twice? still not clear if that's required as per release notes 0.5.3 -> 1.0.2 -> 1.1.0), then flash the copro with BLE_stack_full.bin, then flash the main image is longer than we would like.

Can we combine any of the steps? Is it possible to generate an elf file that has "everything" in?

Does ST provide programming services? or chips that are already preprogrammed with the ble stack, ready for our application code?

Thanks

This topic has been closed for replies.
Best answer by Remi QUINTIN

Regarding the 2 steps for the FUS update, it all depends on what version of FUS is already installed on the microcontroller.

You should get confirmed from ST the exact FUS version on the microcontrollers you will buy.

The current trend is to move step by step most of our lines to the most recent FUS version. So this is one possible way to reduce the programming time there, cancelling one or even 2 steps if FUS version v1.1.0 is already installed at manufactory stage.

Then it is hard to reduce the process as the RF stack and the application code have to be programmed on the chip.

Doing it in 2 commands or only one (this is possible) will not gain you much time.

22 replies

Remi QUINTIN
ST Technical Moderator
October 26, 2020

​The READ FUS STATE boxes remain empty as this information is not accessible using the SWD port for now.

Now could you send a picture of the option bytes, especially the security ones.

I want to check is the ESE bit is set.

How old is the board?

RPowe.9.306
Associate III
October 26, 2020

Hi Remi,

The board is 2 or 3 years old, I got it a 1-day workshop in Bristol when the WB55 was pretty new. See attached, the ESE bit is cleared

Remi QUINTIN
ST Technical Moderator
October 26, 2020

The READ FUS STATE boxes remain empty as this information is not accessible using the SWD port.

Now could you send a picture of the option bytes, especially the security ones.

I want to check is the ESE bit is set.

How old is the board?

RPowe.9.306
Associate III
October 26, 2020

Hi Remi,

The custom board was made this year so I assume the chips are very recent. See attached for option bytes. The ESE is set on this chip. If I try to clear it, I get the message "Warning: Option Byte: ESE, does not exist" - very odd

Remi QUINTIN
ST Technical Moderator
October 26, 2020

​ESE = 0 means this board is not a secure one. So Firmware Upgrade Service (FUS) is not available to upload new FUS or new encrypted RF stack.

So hard to commit on any predictable result. No FUS => No info on the FUS => No way to download anything in a secure way.

You can use this board to run your own SW (application + own RF stack) but no way to protect it and this configuration will never be used for production.

RPowe.9.306
Associate III
October 27, 2020

Hi Remi,

This is just a Nucleo so it's not for ever going to be for production. I have another Nucleo with an old stack and an old p2p server app. I was just hoping to load this Nucleo with the latest stack (stm32wb5x_BLE_Stack_full_fw.bin) and a new version of the p2p server. Are you saying that is not possible?

Remi QUINTIN
ST Technical Moderator
October 26, 2020

When ESE = 1, it is not possible to modify the value. The error message sounds a bit weird but in the end no way to roll this chip back to an non-secure configuration.​

Remi QUINTIN
ST Technical Moderator
October 26, 2020

SFSA = F4 => The FUS is at least v1.0.2. May even be v1.1.0. For sure no RF stack is intalled on this device.​

RPowe.9.306
Associate III
October 27, 2020

Hi Remi, Can I just clarify a few points please.

  1. 'Old' STM32WB55 didn't have FUS and the BLE stack needed to be programmed using the bootloader?
  2. New STM32WB55 have a FUS which allows the STM Cube Programmer to program the Bluetooth Stack using the ST-Link connection?
  3. There is no way to program an 'old' BLE stack (FEB 2019) into a chip with FUS because it fails authentication?

Thanks, Rich

Remi QUINTIN
ST Technical Moderator
October 27, 2020

stm32wb5x_BLE_Stack_full_fw.bin is an encrypted stack and only a FUS has the correct key to ensure a proper decryption and installation.

When a chip is not secure (ESE = 0) , there is usually no primary FUS loaded on it.

Remi QUINTIN
ST Technical Moderator
October 27, 2020

1) Whatever the programing port use to install an encrypted FW, a FUS is required. Programing commands are sent to the FUS either via the bootloader when the UAS/UART port is used or via the FUS operator when the SWD port is used. The FUS operator is a small piece of code loaded at the start of the Flash memory that transmits the commands to the FUS.

2)Yes! The FUS is used to install a new FUS version (older than the current one) or a new RF stack.

3) Not exactly. It all depends on the FUS version and the RF stack version. It is always recommended to install the RF stack of a CubeWB SW package with the FUS available in that package. But you can install a RF stack v1.7 with a FUS v1.1. for example. I don’t think it would work with a RF stack v1.3 or 1.5.

The description of all the FUS version is available in the table 1 of the application note AN5185.