Skip to main content
Associate II
August 8, 2025
Question

It is not possible to change the state to "Closed" when USB is connected (STM32H562)

  • August 8, 2025
  • 3 replies
  • 1038 views

Hi.

During production, we use USB to test the board. Finally, the MCU is supposed to be password-protected against flash reads. Unfortunately, it turns out that as long as the USB cable is connected, it's impossible to program the OBK. Segger Device Provisioner returns an "Error writing OBK". Using STLink and CubeProgrammer also doesn't work. After disconnecting the USB, changing the state to Closed works. BOOT0 is connected to ground. Is there a solution?

Artur

3 replies

Jocelyn RICARD
ST Employee
August 14, 2025

Hello @Artur5 ,

Not sure what can prevent from provisioning OBK.

Are you first switching to PROVISIONING state ?

Could you share a STM32CubeProgrammer CLI sequence you are using  ?

Best regards

Jocelyn

 

Artur5Author
Associate II
August 15, 2025

Hi.

Yes, I'm switching the MCU to PROVISIONING state. And everything works fine as long as the USB cable is disconnected. It seems like the bootloader is blocking access to the OBK memory in some way (?) We're using the SEGGER interface and their "Device Provisioner" tool, but it seems the same applies to STMCubeProgrammer, but I'll check again and let you know.

BR

Artur

Technical Moderator
August 15, 2025

Hi @Artur5  @Jocelyn RICARD 

If production test firmware enables USB, you need to consider adding a command or mechanism to disable USB peripheral before OBK programming. Since it might access to flash while programming OBKs.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.Best regards,FBL
Artur5Author
Associate II
August 15, 2025

Hi.

This also does not work after completely erasing the MCU memory.

BR

Artur

Jocelyn RICARD
ST Employee
November 10, 2025

Hello @Artur5 ,

I got internal information that issue was fixed on Segger side.

Do you confirm this?

Thank you

Best regards

Jocelyn