Tuesday, May 22nd 2018, 11:46pm UTC+2

You are not logged in.

  • Login
  • Register

maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 30

1

Thursday, May 17th 2018, 11:57am

BlueNRG2: Mass erase triggered without asking first

Hi Segger,

I have a situation where the BlueNRG2 goes to sleep.
JLinkExe then tries to connect to this board, but only succeeds half-ways.

It then reports that no flash memory words could be read, and so it decides to mass-erase my device.
This is scary. I have not asked to erase my device, just to connect to it.

Command used:
JLinkExe -device BLUENRG2 -if swd -speed 1000 -AutoConnect 1


See the log:


SEGGER J-Link Commander V6.32b (Compiled May 8 2018 18:28:28)
DLL version V6.32b, compiled May 8 2018 18:28:22

Connecting to J-Link via USB...O.K.
Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware version: V10.10
S/N: 50104725
License(s): GDB
VTref=1.909V
Device "BLUENRG2" selected.


Connecting to target via SWD
Found SW-DP with ID 0x0BB11477
Found SW-DP with ID 0x0BB11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770021)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xF0000000
CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
Found Cortex-M0 r0p0, Little endian.
FPUnit: 4 code (BP) slots and 0 literal slots

CoreSight components:
ROMTbl[0] @ F0000000
ROMTbl[0][0]: D00FF000, CID: 00000000, PID: 00000000 ???
The first word in flash memory could not be read. This indicates that the device is secured.
For accessing memory the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash.
Device will be unsecured now.

Executing ResetTarget()

****** Error: DAP error while reading DP-Ctrl-Stat register.

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Thursday, May 17th 2018, 2:56pm

Hello,

Thank you for your inquiry.
The target voltage is suspiciously low. Make sure that at that voltage the debug interface and other debug related modules are active.
For all devices that J-Link detects as locked the user will get a prompt informing the user which needs to be confirmed first before a mass erase is triggered.
However the user can click the message away permanently. How to recover it is described here: https://wiki.segger.com/Secured_ST_device_detected

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 30

3

Thursday, May 17th 2018, 4:15pm

Hi Nino,

The target voltage is just fine. We are working @ 1v9. The MCU is spec'ed 1.7 - 3.6V.
Also, no popups were to be seen, ever. I am using JLinkExe on Linux, and it has never given me a popup. (Probably no GUI support, since I also get no device selection GUI)
So I suppose this means JLink just proceeds to mass erase the device without asking, because there is no GUI? Maybe a command-line YES/NO can be a good alternative?
Certainly mass-erasing without asking is not a good solution.

Also, there is no "registry" on Linux, so no way to reset "DontShowAgainUnlockSTM".

Thanks,
Maxime

This post has been edited 1 times, last edit by "maximevince" (May 17th 2018, 4:17pm)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

4

Friday, May 18th 2018, 1:56pm

Hello Maxime,

On Linux and Mac there are no GUI popups so default behaviour is that a unlock will get triggered if a locked/secured device is detected.
This behaviour is expected by over 99% of our customers as they would like to connect to the chip which is not possible when it is in locked state...
Otherwise every debug session with a locked device under Linux and Mac would fail.
We will put the request to make this optional on our wish list for future internal discussions.

Quoted

The target voltage is just fine. We are working @ 1v9. The MCU is spec'ed 1.7 - 3.6V.

Only because the MCU is specified that it will work with a certain voltage range does not mean that debugging is possible in all power states.
We tried to reproduce the issue with an eval board but everything was working as expected.
Can you reproduce the behaviour on an eval board?
If so how did you proceed and what eval board did you use for your setup?
At the moment we have to assume that this issue is solely related to your custom board and not J-Link.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/