cancel
Showing results for 
Search instead for 
Did you mean: 

Can't flash, debug or even erase STM32

JonasHSLU
Associate II

Hi,

I made some custom PCB's with a STM32L476RG. Here are some of the features:
-USB-C connector (CC channel configured as device) with DM/DP routed to PA11/PA12.
-Step down converter 5V (VBUS USB) to 3.3V (VCC for most components)
-Tactile switches for BOOT and RESET
-10 Pin SWD Debug header: SWDIO/SWDCLK -> PA13/PA14. SWO not routed.
-no external crystals
I soldered one PCB up and checked the connections under the microscope and with some resistance measuring. So that should be fine.

Now to my problem: I cannot flash or debug it. What I tried so far.
-Using the bootloader via USB doesnt work. The MuP doesn't even show up in the device manager.
Using an ST-Link from a Nucleo-L476RG board:
-Run / Debug with CubeIDE gives error: "Could not read registers; remote failure reply 'E31'". When trying different debug settings and pressing RESET and/or BOOT while trying to debug sometimes gives different errors.
-Trying to flash with CubeProgrammer gives warning "Warning: The core is locked up" and some errors (mainly "failed to erase memory")
-Erase chip with ST-Link Utility doesn't work aswell.

I was quite in a hurry when leaving work, so I don't have all the exact error messages. I could provide them tomorrow if necessary.

I could also provide my schematics and software but only to ST employees as it is somewhat confidential.

If you have any suggestions to what the problem might be or if you need additional information let me know.

Best regards,
Jonas

 

 

2 REPLIES 2
Andrew Neil
Super User

@JonasHSLU wrote:

I made some custom PCB's with a STM32L476RG. Here are some of the features:


Schematics would be more useful than a list of features

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Well with no crystals the boot loader isn't going to support USB DFU operation

https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf#page=369

Wouldn't expect ST-Link Utilities to support L4+, but might

So probably an issue with power or orientation.

Check voltage presented on NRST pin.

Check all supply pins, analogue and digital.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..