cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB15 SWD interface disable

JGuir.1
Associate II

Hi,

On a custom board I can no longer reprogram the MCU (STM32WB15) via the SWD link.

The last program flashed on the card works perfectly but I can no longer establish the SWD link with CubeIde via the ST-LINK probe.

Message "target not found".

I guess the SWD link was disabled by accident.

I tried to change the voltage on the PH3-BOOT0 pin from GND (0V) to Vdd (3V), but the MCU still boots only to the user flash.

How to erase the last program and restore the initial (factory) configuration of the MCU.

Thanks.

8 REPLIES 8
RomainR.
ST Employee

Hello JGuir.1 (Community Member)

You have probably disabled the JTAG/SWD pins.

Try to connect using the "Connect Under Reset" mode with the STM32CubeProgrammer.

See 2.1.4 Target configuration panel:

st.com/resource/en/user_manual/dm00403500-stm32cubeprogrammer-software-description-stmicroelectronics.pdf

Best regards,

Romain,

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.

JGuir.1
Associate II

Hello Romain,

I tried but without success.

I tried also with the "power down" mode.

I tried with the boot 0 pin connected to GND then to VDD.

The the problem remains the same. The MCU is reset and boot directely to the user flash. The program in flash is executed correctly...

Best regards,

Joël,

RomainR.
ST Employee

Hello JGuir.1 (Community Member)

Do you use the last version of STM32CubeProgrammer 2.11.0 ?

Can you try to etablish STM32CubeProgrammer SWD connection with another similar board ?

Check all VDDA/VDD and SMPS (if used) voltage measurement ?

Check if NRST(PB11) pin is not always to GND ?

Can you share the schematic of your pcb (including MCU with NRST and SWD connection) ?

Best regards,

Romain,

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.

AScha.3
Chief III

maybe you set flash protection to level 2 , then cpu working normal, but never access debug again....

If you feel a post has answered your question, please click "Accept as Solution".
JGuir.1
Associate II

Hello Romain,

I use the last version of CubeProgrammer.

I have 3 same boards and I don't have this problem on the 2 others but I didn't flash the same program. I flashed many times the board until the last time the SW link was lost.

I checked the power supply and reset pin are the same on the 3 boards.

I did not want to protect the flah memory or disable the SW link.

I put the MCU in shutdown mode and wake up by the RTC. It worked several times until the last modification of the program

Best regards,

Joël

RomainR.
ST Employee

In shutdown mode MCU is not clocked,

Can you try with STM32_Programmer_CLI to etablish a connection (command below):

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe --connect port=SWD mode=UR reset=hwRst

And a Flash erase

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe --connect port=SWD mode=UR reset=hwRst --erase all

You must modify your firmware to avoid this by using an external wakeup pin.

And concerning the other device check if User option bytes are correctly configured in order tu use external BOOT0 pin features.

Good luck !

Best regards,

Romain,

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.

JGuir.1
Associate II

Hello Romain,

I tried the two commands but without success.

I know that in shutdown mode the clocks are stopped exept the LSE.

Actually the MCU is wake-up by the RTC every 30 seconds and it works correctly, exept that the WD link even when the the MCU is awake. I didnt modify the option bytes (reset state).

Is there an other solution to erase the chip or should I remove and change it ?

I hope that the same problem doen't occur again...

Best regards,

Joël

RomainR.
ST Employee

Hello JGuir.1 (Community Member)

Even if the MCU is in Shutdown mode, you should be able to connect with the STM32CubeProgrammer with the two methods I have indicated above.

Ideally, you could share your .hex code so that I can try it and reproduce and confirm your problem on my hardware.

Let me know ?

BR

Romain,

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.