2025-03-12 1:10 AM - last edited on 2025-03-12 6:08 AM by Andrew Neil
I'm currently experimenting with an XM125 radar board . As seen on page 15 of the module's datasheet, this board essentially contains an STM32L4 MCU with the necessary external components and the radar sensor. All pins of the MCU are exposed through the board. So, essentially, I'm connecting directly to the STM32L4.
I'm struggling with flashing something to the controller. I know this has been asked (and solved) a thousand times, but I simply cannot find the problem here.
When attempting to flash a default project by the manufacturer using an ST-Link V2 (genuine, not clone), I get the following output in STM32CubeIDE 1.17.0:
STMicroelectronics ST-LINK GDB server. Version 7.9.0
Copyright (c) 2024, 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
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
STM32CubeProgrammer (2.19.0) gives a very similar output:
12:52:16:265 : UR connection mode is defined with the HWrst reset mode
12:52:16:390 : ST-LINK SN : 37FF6F063143433923131843
12:52:16:391 : ST-LINK FW : V2J45S7
12:52:16:391 : Board : --
12:52:16:391 : Voltage : 3,23V
12:52:16:392 : Error: Unable to get core ID
12:52:16:392 : Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication
12:52:16:404 : Disconnected
I've also tried pulling BOOT high during startup and changing the reset modes between Software, Hardware and Core, but the result was the same.
I'm using a serial-to-usb interface stick to generate the source voltage of 3.3V. I'm additionally using a voltage divider to get the 3.3V down to 1.8V, since this voltage is required by the radar sensor. The following schematic outlines my setup:
In the attachments, you find an image of my setup, and my test project.
Solved! Go to Solution.
2025-03-12 9:02 AM
@blank_supportgis wrote:The wiring is as shown in my schematic.
The problem mentioned earlier was with mis-interpreting the numbering of the ST-Link - so a correct schematic didn't help that.
A good, clear photo of your setup could help.
Stolen from @Jesus Perez here: https://community.st.com/t5/stm32-mcus-products/stm32f070-wont-connect-to-st-link/td-p/357857
Here's one I prepared earlier:
2025-03-12 10:31 AM
If RDP2 is set, chip won't be accessible.
Are you sure you can upload firmware like this? Is this procedure (flashing over SWD using STM32CubeProgrammer) supported by documentation of the product?
2025-03-12 10:55 AM - edited 2025-03-12 10:57 AM
@TDK wrote:If RDP2 is set, chip won't be accessible.
Also if they do any reconfiguring of the SWD pins; eg, for low power (although connecting under HW reset should get around that)
@blank_supportgis - the point being that there is a number of things that a 3rd-party can do to hinder SWD access - so it is more that just an STM32 question.
2025-03-13 1:19 AM - edited 2025-03-13 1:23 AM
The company (Acconeer) actually ships a blank module and wants you to flash the firmware you need yourself (there are different ones for distance measurement, people detection, etc...). I would be genuinely surprised if they practised security by obscurity.
Anyway, I filed a ticket with their ticket system now, so we'll find out if that's the case.
2025-03-13 1:44 AM
I agree, pin 1 can be a little tricky to locate on the ST-Link. Anyway, my connections are definitely according to your pictures, except that I power my board from an external source and therefore don't use the yellow VDD line.
I tried to capture my setup in a picture, which is quite difficult when using jumper wires, but I think, every connection should be traceable (see attachments). The blue PCB is the radar module with pin 1 being located in the lower right corner (red wire).
2025-03-13 2:48 AM
Indeed, the connections do look correct (assuming the radar board is correctly oriented) - but very messy!
Lots of scope for unreliable connections with those multiple jumpers, and the breadboard.
I would certainly suggest that you tidy-up and shorten the wiring
Solder wires onto a header to connect direct to the ST-Link; eg,
Get rid of the breadboard - use soldered connections.
Are you sure that the USB-to-UART unit supplies adequate power? Have you tried with a proper power supply.
Having different wire colours for different signals helps.
2025-03-13 4:14 AM
I tried powering it with a bench power supply, but the result was the same.
2025-03-13 4:20 AM - edited 2025-03-13 4:37 AM
Still worth tidying - and shortening - all the connections, though.
@TDK's question about the current draw from 1V8 remains.
Have you looked at the supply pins with an oscilloscope to check there's no brownouts?
PS:
Your two black ground wires are not connected to anything:
You have no ground connection to the radar board!
2025-03-13 5:12 AM
Yes, shortening the wires worked. I'm gonna be honest, I was reluctant to clean up, because I didn't think it would help, but it did.
I've connected all dupont headers I soldered to the XM125 module directly to the ST-Link now, except for the power, which still comes from the breadboard (I need to get my 1.8V from somewhere). So, apparently, the problem was with the SWDIO and SWDCLK connections.
Anyway, thanks a lot to everybody for their help and patience!
2025-03-13 5:20 AM
Did you fix the lack of ground connection while you were about it?
(see PS to previous post)