Friday, May 25th 2018, 5:06am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 31

1

Thursday, August 17th 2017, 12:40pm

[ABANDONED] JLinkGDBServer cannot reset and halt the CPU, while Ozone can

When using the JLinkGDBSever on a bluenrg1 device, i cannot reset and halt the device. I can still break, but it's in the middle of my application.
This does not always happen, but often enough to make this a major issue.

I tried all possible reset strategies, from GDB, e.g.:
> mon reset
> mon reset 1
> mon reset 2
...

Most of them reset the device, but they don't halt the CPU.

The weird thing is, Ozone seems to be able to recover from this situation (at least in many more cases).
Also, is support for BlueNRG2 coming?

Cheers!

v01d1

Beginner

Date of registration: May 29th 2017

Posts: 27

2

Thursday, August 17th 2017, 2:43pm

may be "monitor halt" ?

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

3

Friday, August 18th 2017, 5:59pm

Hi,


we are currently not aware of any issues regarding J-Link + BlueNRG1.
Would it be possible for you to provide us with a reproducer?


Quoted

The weird thing is, Ozone seems to be able to recover from this situation (at least in many more cases).

What do you mean by "recover"?
When using only Ozone, does it work without issues? (There is a reset & halt option in Ozone).

Quoted

Also, is support for BlueNRG2 coming?

Well, lets wait until the evaluation board is available before I ask engineering about that :)

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 31

4

Monday, August 21st 2017, 10:30am

Hi Niklas,

Thanks for the answer.
1. What do you mean by a reproducer? An elf file that causes this kind of issue? It seems to be very irregular, and (it seems) usually happens when using some of the low power modes of the device (sleep/standby).
2. By "recover" i mean, ability to halt, step, flash, ... the target. Any useful debugging steps :)
3. I know it's a bit early, but BlueNRG-2 eval board should be available from ST: http://www.st.com/content/st_com/en/prod…l-idb008v1.html
Also, thanks a lot for always being *very* up to date with the latest MCU's. It's one of the many reasons I really like the J-Link products!

BR,
Maxime

This post has been edited 1 times, last edit by "maximevince" (Aug 21st 2017, 10:34am)


SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

5

Monday, August 21st 2017, 11:27am

Hi Maxime,

Quoted

What do you mean by a reproducer? An elf file that causes this kind of issue?


Yes, this is what I meant.

Quoted

It seems to be very irregular, and (it seems) usually happens when using some of the low power modes of the device (sleep/standby).

This could be expected behavior. It depends on the device and low power mode used, but it is possible that the debug connection is lost when the device enters low-power mode, and the debugger can not do much about it.

You can make the J-Link software more relaxed about temporarily connection losses by executing the following J-Link command string:
LowPowerHandlingMode = 1

Quoted

I know it's a bit early, but BlueNRG-2 eval board should be available from ST

On the bottom of the site, you can see the the board currently can neither be ordered from ST nor from a distributor.


Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 31

6

Monday, August 21st 2017, 2:54pm

I understand that I cannot debug when the device is sleeping in standby/sleep mode.
However, it should be possible to correctly reset and halt the device, which should allow me to re-flash the device, or step from main() again, ...
Or is this a wrong assumption? This works with all other Cortex-M devices I work on...

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

7

Tuesday, August 22nd 2017, 6:40pm

Hi,

Quoted

However, it should be possible to correctly reset and halt the device, which should allow me to re-flash the device, or step from main() again, ...
Or is this a wrong assumption? This works with all other Cortex-M devices I work on...

This depends on the target device
-> Reset & halt via SFR access might be not available when target device is in low power mode
-> Reset & halt via Reset pin + SFR can work but only if the application does not enter a low power mode before the halt request via SFR is issued

You can make the 2nd option work reliable by adding a delay at the start of the target application.

Does connect / reset work in commander if you are holding the reset button?

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 31

8

Thursday, August 24th 2017, 9:28am

Hi,

Thanks for the explanation.
It works in JLinkExe (e.g. for flashing a new image) when holding the reset button, indeed.

So, I should make sure my application does not go to sleep too soon, such that I can halt and debug in time, after resetting or powering on the device?

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

9

Thursday, August 24th 2017, 10:03am

Hi,

Quoted

It works in JLinkExe (e.g. for flashing a new image) when holding the reset button, indeed.

This means it should be possible for us the implement a connect under reset for BlueNRG1. I will bring this up for discussion at the next team meeting.


Quoted

So, I should make sure my application does not go to sleep too soon, such that I can halt and debug in time, after resetting or powering on the device?

Yes, this
a)
is a good ("best") practice in general, since it makes sure you have time to connect to the device during development of the application. Therefore, you can always be sure that a simple mistake or typ0 in the pin configuration does not brick you hardware permanently.
b)
should work automatically with J-Link. Since Reset & Halt via SFR access does not work, J-Link will reset via reset pin as a fall back and then issue a Halt request as soon as it can connect to the device.
A delay before the start of the target application will make sure J-Link can connect & halt before the device enters a low-power mode.

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

maximevince

Beginner

Date of registration: Mar 20th 2017

Posts: 31

10

Thursday, August 24th 2017, 6:35pm

Thanks for the clarification!
I am looking forward to possible future improvements on the reset behavior for BlueNRG1/2!

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

11

Tuesday, October 17th 2017, 4:20pm

Hi,


does it work for you when using the most recent J-Link version?


Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link