2020-10-28 02:46 AM
Hey there,
i recently designed a PCB with a litte STM32 Procect.
Now i cant programm my MCU by SWD.
MCU : STM32L432KC
ST-Link : ST-Link v2.1 broken off a nucleo64 (according to UM1724)
ive got wires to pin 23 (SWDIO), pin 24 (SWCLK), pin 4 (NRST),GND and VCC of the MCU of my PCB.
i connected theese to CN4 of my ST-Link according to table 5 in UM1724.
i removed the 2 Jumpers on CN2 according to Table 4.
i connected VCC, GND (stlink+ my pcb) to external 3.3V from my power supply.
Then i created a new cubeIDE project and added an uint8_t wich increments every second. I selected Debug Serial Wire in SYS in the .ioc and tried to upload the code and got the following error:
STMicroelectronics ST-LINK GDB server. Version 5.5.0
Copyright (c) 2019, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 066BFF575051717867092622
ST-LINK FW : V2J36M26
Voltage : 5.95V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x435
Device name : STM32L43xxx/STM32L44xxx
Flash size : 256 KBytes
Device type : MCU
Device CPU : Cortex-M4
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a01232.srec
File : ST-LINK_GDB_server_a01232.srec
Size : 11468 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 5]
Download in Progress:
Error: failed to download Segment[0]
Error: failed to download the File
Encountered Error when opening F:\Programme\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.3.0.202002181050\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer
Debugger connection lost.
Shutting down...
Error in final launch sequence:
Failed to execute MI command:
load F:\\Programmieren\\STM32\\L432_SWDTest\\Debug\\L432_SWDTest.elf
Error message from debugger back end:
Error finishing flash operation
Failed to execute MI command:
load F:\\Programmieren\\STM32\\L432_SWDTest\\Debug\\L432_SWDTest.elf
Error message from debugger back end:
Error finishing flash operation
Failed to execute MI command:
load F:\\Programmieren\\STM32\\L432_SWDTest\\Debug\\L432_SWDTest.elf
Error message from debugger back end:
Error finishing flash operation
Error finishing flash operation
any suggestions ?
do i have to change someting in the clock config in the .ioc? ive connected a 32khz XTAL between pin 2 and 3 of the L432. (this one : https://www.mouser.de/ProductDetail/NDK/NX3215SA-32768K-STD-MUA-8?qs=55YtniHzbhBdnrw6egvs7Q==)
2020-10-29 11:47 AM
All connections are fine, as you already get the correct Device ID of 0x435, the issue seems to have some other reason.
BTW: the two jumpers at CN2 cut the SWD connection to the target when the ST-LINK/V2-1 is still part of the NUCLEO. Their presence doesn't matter if you cut the ST-LINK to use it externally.
Do you use any low power mode of the L432 while trying to get connection?
But before we get into the details please update the tools as you are still using CubeIDE 1.3.0.
When your question is answered, please close this topic by choosing Select as Best.
Regards
/Peter
2020-10-29 12:21 PM
That's NOT good.
Connect the GND in common, no need to connect the VDD, the NUCLEO doesn't have buffers.
Try using the STM32 Cube Programmer
Make sure you don't have secondary devices/logic driving the NRST pin