for the past couple of months I have been developing software for a custom build board. Due to a non disclosure agreement i am not allowed to share the schematics , PCB layout or software of the board.

What i am allowed to share is that the board uses a Murata cmwx1zzabz module as proccesor and for lora communication. The proccesor in this module is a Stm32l0 which i was able to program for the past couple of months.

As i had a problem with the stability of the program (chrashed randomly after sometimes running perfectly for a couple of hours) i decided to let 3 of my 5 prototype boards run a program in a mode that uses one paticular sensor which seemed to cause problems. As a refference i picked another prototype board and let it run the same software version as the other three prototypes but in a different mode.

The idea was to let the code run on the four prototypes and let it run the whole weekend as a stability check. The last prototype board i wanted to use for an energy consumption test. I loaded the same software as the other boards onto the board and did some measurements.

It was a terrible idea to let all of my prototypes run the same software because keil uvision 5 cant program any of the boards anymore. I get this error:

enter image description here

enter image description here

What i have tried to solve the problem is:

  • use a different ST-link
  • use different cables
  • pulled the boot0 pin to '1' and tried to program it (normally pulled down)
  • tried to load the program onto a Discovery board (It seems to work but i did stop the programming halfway through the procces because i am afraid to brick the disco board too)
  • Created a "fresh" CubeMX project and tried to load the program on to the prototypes without succes

Does anyone know a way to do a factory reset or has a sollution for this problem? My internship is almost finished and i dont really have the time to wait +- 4 weeks to wait on new prototypes.

On the plus side the boards are still running but have some inconsistent readings. The only change i made to this version of the software and an older variant was to change return uwTick; to return HW_RTC_GetTimerValue(); in the HAL_gettick() function.

some additional info of when i connect the stlink in my PC with the prototye connected. enter image description here

  • \$\begingroup\$ Download to flash sounds like a mighty fine option to have. Are you running programs in RAM or something? \$\endgroup\$ – Lundin May 8 '19 at 12:38
  • \$\begingroup\$ Without further details of your circuit you won't be able to receive help here in actually making it work again. The answer your received with generic information about what should be possible is about all the help you can get when you can't share any of what would be needed to debug your specific situation - flaky connection of the SWD (including reset) or its reference ground would be an obvious suspect. \$\endgroup\$ – Chris Stratton May 8 '19 at 13:19
  • \$\begingroup\$ Does you code disable SWD/JTAG? Or sets some "code readout protection" equivalent? Have you tried booting into serial bootloader, and erasing from there? \$\endgroup\$ – domen May 9 '19 at 8:26

It was a terrible idea to let all of my prototypes run the same software because keil uvision 5 cant program any of the boards anymore.

It wasn't, you've found a problem. A test where nothing fails is a poor test.

Try the ST Link Utility, and verify if the RESET pin is actually connected to the programmer.
Right now it says "No Target Connected", meaning the debug core inside the ARM Cortex M0 is not reachable.
Either because the lock bits of the manufacturer are set, or pin function was changed by your code.
Did you use the GPIO port configuration lock register?

There is no such thing as a factory reset if you cannot get into the chip.
If mass flash erase is not available over SWD/JTAG. Then maybe over a bootloader (uart/usb).
Otherwise you have to replace the chip since you might have accidentally activated read out protection level 2. (RDP level 2, see reference manual)

Also sometimes a lower clock on the SW interface can help if you have a poor board design.

| improve this answer | |
  • \$\begingroup\$ "connect under reset" is already selected in Keil's settings \$\endgroup\$ – Jan Dorniak May 8 '19 at 17:39
  • \$\begingroup\$ The mass flash erase wasnt possible but i will try it whit the "hold the reset button" trick. \$\endgroup\$ – Twan Vogelzang May 9 '19 at 15:29
  • \$\begingroup\$ I didnt lock registers for as far as i know (i havent develloped the code from the ground up so i may have miss something ) \$\endgroup\$ – Twan Vogelzang May 9 '19 at 15:31

Thanks everybody for the help.

Somehow holding the reset button and releasing it just before loading new code onto the board worked and i can program it again (Not like i used to but it works). I havent figured out how this is possible but if i do i will share it here.

| improve this answer | |
  • 1
    \$\begingroup\$ That's what "connect under reset" does. Are you using a fake ST-Link? The convenient little dongle-shaped ones typically can't actually drive the reset as their PCB and firmware do not fully match. However, changing the boot mode and resetting/repowering in the alternate mode would have also had the effect of disabling the flash contents too, so perhaps that needed to be done more carefully. \$\endgroup\$ – Chris Stratton May 9 '19 at 15:29
  • \$\begingroup\$ Please come back and accept this answer to wrap things up nice and neat. You asked the question and found the answer - go ahead and accept it. You may have to wait until tomorrow as there's a forced waiting period for new users. \$\endgroup\$ – JRE May 9 '19 at 16:26
  • \$\begingroup\$ @ChrisStratton I am using a fake one so that may have been the problem \$\endgroup\$ – Twan Vogelzang May 10 '19 at 18:15
  • 1
    \$\begingroup\$ I don't know how you figured this out, but thank you. I thought I bricked my device when my JLink couldn't connect anymore. \$\endgroup\$ – anthony Sep 22 '19 at 23:54

What is the VDD on those MCUs? I've run into this exact message if ST-Link did not get correct voltage on the TVCC pin.

| improve this answer | |
  • \$\begingroup\$ The board is powered with a 3v6 battery as power supply \$\endgroup\$ – Twan Vogelzang May 9 '19 at 15:32
  • \$\begingroup\$ And what is the actual voltage on VDD right now? \$\endgroup\$ – Jan Dorniak May 9 '19 at 15:32
  • \$\begingroup\$ I am sorry, I should have said that the actual VDD also is 3v6 \$\endgroup\$ – Twan Vogelzang May 10 '19 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.