Skip to main content
RHaag.1
Associate II
February 10, 2021
Solved

SWD connection no longer working

  • February 10, 2021
  • 13 replies
  • 2946 views

Hello,

On a STM32L4 design, we no longer have an SWD connection to the processor: using STM32CubeProgrammer reports

ST-LINK SN : 39FF6A064243383912381057

ST-LINK FW : V2J36S7

Voltage : 3.26V

SWD freq : 4000 KHz

Connect mode: Normal

Reset mode : Software reset

Device ID : 0x461

UPLOADING OPTION BYTES DATA ...

Bank : 0x00

Address : 0x40022020

Size : 20 Bytes

Bank : 0x01

Address : 0x40022044

Size : 16 Bytes

UPLOADING ...

Size : 1024 Bytes

Address : 0x8000000

Read progress:

Error: Data read failed

SWD works fine in the design in general, also also ran on this particular device. An idea what is missing?

Or to put it the other way round: what do we need for a running SWD? Supply, connection to the SWD pins of course, but what further? IMHO we don't need running CPU core or clocking on it for example....

Thank you

Ralph

This topic has been closed for replies.
Best answer by Houda GHABRI

Hi @RHaag.1​ ,

Writing OB needs a specific procedure describes in MCU reference manual : "FLASH option bytes" section.

It is different from writing to flash.

The two OB BFB2 and RDP are configured in the same register , may be your are modifying the RDP when BFB2 is modified by your application.

0693W000007Z6ZPQA0.pngHope this helps you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Houda

13 replies

RHaag.1
RHaag.1Author
Associate II
February 24, 2021

Hi Houda,

hm, is there an error in the ref manual with level 0 / 1 here?

Anyhow, I know programming any value other than 0xAA and 0xCC will lead to level 1, but I'm sure ST knows what value I should read back in assumed case with mismatch in comparison of stored option byte! Is it 0xFF or not?

Regards

Ralph

Houda GHABRI
ST Employee
February 28, 2021

Hi @RHaag.1​ ,

You can refer to table 14 in RM0351 3.5 Flash memory protection :

0693W000007Zhn9QAC.pngHouda

RHaag.1
RHaag.1Author
Associate II
March 2, 2021

Hi Houda,

it's a valuable discussion, but I still don't know the RDP value when the comparission doesn't match. I know it can be "my" 0xFF, but I'm quite sure ST implemented a certain value in this case not a "could be anything except..." :)

Regards

Ralph