PlatformIO + Ebyte E80 test kit + ST-Link from Nucleo F411RE

Hi,

I’m trying to upload my program to Ebyte E80 test kit (which contains STM32F103C8T6, attached the schematics) using ST-Link on board Nucleo-F411RE.

Ebyte E80 test kit schematics:

On ST NUCLEO board, I removed jumpers from CN2 and connected CN4 pins to J1 from the E80 test kit in the following way:

Pin 1 from ST NUCLEO (VDD_TARGET) to pin 4 in E80 (J1)
Pin 2 from ST NUCLEO (SWCLK) to pin 1 in E80 (J1)
Pin 3 from ST NUCLEO (GND) to pin 3 in E80 (J1)
Pin 4 from ST NUCLEO (SWDIO) to pin 2 in E80 (J1)

I powered up both boards (using USB-C in the E80 test kit and USB in ST NUCLEO) and tried uploading the program, but OpenOCD command failed to connect the target (the probe itself was detected successfully). Here are logs:

My platformio.ini:

[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = stm32cube

monitor_speed = 115200

Output from openocd:

AVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink
CURRENT: upload_protocol = stlink
openocd -d2 -s /home/developer/.platformio/packages/tool-openocd/openocd/scripts -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32f1x.cfg -c "program {.pio/build/genericSTM32F103C8/firmware.elf}  verify reset; shutdown;"
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:03)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J30M19 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.263559
Error: init mode failed (unable to connect to the target)
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1

I was wondering if that might be due to reset, so I tried pushing and holding Reset (U5) button before uploading the program, but it also failed. I even tried connecting NRST (pin 5) from CN4 in Nucleo board to “STM32_NRST” pin in the E80 test board, but it failed as well.

I tried programming STM32F411 in the Nucleo board itself (with CN2 jumpers on) and it worked fine.

Do you have any suggestions how to upload the program to the E80 board?

BR,
Adrian

Can you connect that pin again and try to use the https://www.st.com/en/development-tools/stm32cubeprog.html software to connect to the chip? Try all available reset methods (software, hardware, under reset, ..).

1 Like

I’ve checked all combinations of (mode, reset mode):

Mode:

  • Normal
  • Hot plug
  • Under reset
  • Power down (not supported)
  • hwRstPulse

Reset mode:

  • Software reset
  • Hardware reset
  • Core reset

And for all cases the error is “Unable to get core ID, No STM32 target found!”.

I suppose it’s possible that the MCU is not genuine STM32F103. Based on the schematics, do you think that I correctly connected ST-Link on Nucleo board to the E80 board? Do you think that NRST is needed?

The connections seem fine in regards to what the Nucleo 64 manual say.

  1. Can you measure continuity between SWCLK of the programmer and the SWCLK pin of the microcontroller on the target board? Same for SWDIO.
  2. Can you supply power to the target board indepdently of the Nucleo? VDD_Target seems to be only for measuring the target voltage, but not supplying it (with a lot of current).
1 Like

Indeed, it appeared the wire used for SWCLK was broken and now everything works as intended (RESET pin was not needed).

Thank you very much for you help @maxgerhardt !