cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to detect the chip after programming

vbk22398
Senior

Screenshot 2025-01-19 170709.png

 I am programming my STM32F423RHT6. But due to some reason, suddenly I am unable to code the MCU. The connection is getting lost for some reason. I don't know what is the reason for this behavior.  I am attaching my code along with this message. The debugger which I use is an external debugger of stm32. I tried changing TCXO, tried changing the same CHIP. Voltage levels are as per the data sheet. For the 1st few times of programming, am able to flash the code. But after couple of times, facing this issue. 

Note:
I kept programming for peripheral by peripheral and this issue happened suddenly all at once. After finalizing the product and manufacturing parts and soldering, I am facing this issue. Kindly help me out.

Is my chip being dead after few instances of programming?

16 REPLIES 16
AScha.3
Chief III

Set CubeProgrammer to mode: normal and reset: software or hardware (try both).

Then show, what it tells.

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

@AScha.3 It is giving ST-LINK Error. (DEV_TARGET_CMD_ERROR)

So no connection to st-link at all ?

Try other usb and other usb-cable...

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

The code you flashed onto the board migth have serious issues. The board seems bricked, in other words.
A core lockup (e.g. from a fault caused in a fault handler) could do that.

I would try to boot into ISP mode (ROM bootloader), and do a mass erase.
I suppose the Cube Programmer supports that.

And if that does the trick, I would review the last source code changes.

Imen.D
ST Employee

Hello @vbk22398 

Is the ST-LINK here fake/clone? or maybe the chip you're trying to connect it?

Please refer to this article to check if you are using a genuine ST-LINK/V2 or a cloned one: How to recognize a genuine ST-LINK/V2 versus a cloned one.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
vbk22398
Senior

@Imen.D It is an original ST-LINK. It is working fine before and after many instances of programming. I don't know if this issue will occur because of the code or not. Kindly check my code further and let me know.

@Ozone @AScha.3 I feel the issue is in the code only. Kindly let me know what I have wronged in my code!

First you would need to de-brick your board. I suppose you know how that works, ST has some application notes regarding the ROM bootloader, required applications, and supported interfaces per device.

I cannot provide extensive code reviews for free, but tell you how I would proceed.

I suppose it is not the initial version flashed onto the board, and earlier iterations didn't cause this problem.
In this case, carefully review all changes you made. If necessary, singe-step through the code, starting from the reset vector, not main().
Re-check with the datasheet that you did not reuse the JTAG/SWD interface pins of the MCU. Symptoms would look exactly like that.
Other often-occuring problems are in the startup code, both with memory (RAM) initialisation, external parallel bus interfaces (ext. RAM or Flash), and the clock setup. In combination with faulty/non-existing fault handlers, those can brick the board.

As a side note - from the parts of the schematics provided, it seems to be a custom board, and I can't make out a quartz or another external clock generator for the MCU. If that is true, check your startup code that it does not try to switch to a nonexisting external clock source.

vbk22398
Senior

@Ozone Thank you for your time and Reply. I will try the same and get back to you.


@vbk22398 wrote:

I kept programming for peripheral by peripheral and this issue happened suddenly all at once. 


So what did you add/change between it last working, and it "suddenly" not working?

eg, did you disable the any/all of the SWD pins ?