Sunday, February 25th 2018, 10:42am UTC+1

You are not logged in.

  • Login
  • Register

garrulous

Beginner

Date of registration: Feb 3rd 2018

Posts: 7

1

Thursday, February 8th 2018, 12:55am

[SOLVED] Ozone: v2.56 regression with Nordic SoftDevice (S140, nRF52840)

Using Ozone with a Nordic Semi nRF52840-PDK development board, after updating Ozone from v2.54.2 to v2.56 I am no longer able to debug any Bluetooth examples (S140 SoftDevice).

An unexpected "CPU halt" occurs during the call to sd_softdevice_enable(), in the "ble_app_blinky" example supplied as part of SDK 14.2.0:
* on either Windows or Linux (Lubuntu)
* with either the J-Link built into on the nRF5284-PDK board, or when using a J-Link Plus as an external debugger.

The debugging session proceeds normally when using Ozone v2.54.2, or when using SEGGER Embedded Studio for ARM v3.34. I can single-step or run through the function call without issue.

The problem persists even if I manually update the J-Link DLL used by Ozone (to v6.30.2).

Ozone has been great! I hope this issue is an easy fix.
garrulous has attached the following image:
  • ozone_screenshot.png

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

2

Thursday, February 8th 2018, 10:36am

Hello,

Thank you for your inquiry.
Such an issue is not known to us, but if it is a bug we will of course fix it.
For easier reproduction could you provide the elf file of your project so we can test it in house with your compiler output?

Best regards,
Nino

garrulous

Beginner

Date of registration: Feb 3rd 2018

Posts: 7

3

Thursday, February 8th 2018, 8:31pm

Hi Nino,

Thanks for your reply. Have attached .elf file ("ble_app_blinky" example, Nordic SDK 14.2.0), compiled with SES for ARM v3.34 on Windows.
garrulous has attached the following file:

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

4

Friday, February 9th 2018, 1:41pm

Hello,

Thank you for providing a reproduction scenario.
The issue was reproducible and could be fixed. A fixed release version is expected to be available later today.

Best regards,
Nino

garrulous

Beginner

Date of registration: Feb 3rd 2018

Posts: 7

5

Monday, February 12th 2018, 1:23am

Thank you -- would the fixed Ozone version be v2.56b ?

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

6

Tuesday, February 13th 2018, 9:41am

Hello,

Sorry for the delay, we had to run some additional tests. The result is that this was intended design change. So for special cases like yours with a softdevice running you need to set the PC and SP manually in the .jdebug file.
To do this first close Ozone, then open the .jdebug file for editing in a text editor.
Find the function AfterTargetDownload() and uncomment it.
Fill it with:

C/C++ Source code

1
2
3
4
5
6
7
8
unsigned int SP;                                                    
unsigned int PC; 

SP = 0x00000000;
PC = 0x00000004;

Target.SetReg("SP", SP);
Target.SetReg("PC", PC);


This is assuming your softdevice loads to address 0x0. Otherwise adjust it accordingly.

Does that solve the issue?

Best regards,
Nino

garrulous

Beginner

Date of registration: Feb 3rd 2018

Posts: 7

7

Wednesday, February 14th 2018, 12:54am

Hi Nino,

Thanks again; unfortunately I am still having trouble with v2.56b.

As I understand it, the Nordic SoftDevice is loaded below the application (link ).

If I modify the .jdebug file as described (with SP=0x00000000 and PC=0x00000004), either the CPU halts immediately after "download & reset" at PC=0x000008C8 (no matching source), or if I "reset and run to symbol" and step from beginning of main(), the CPU halts as before at sd_softdevice_enable().

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
void AfterTargetDownload (void) {
	unsigned int SP;
	unsigned int PC;
	
	SP = 0x00000000;
	PC = 0x00000004;
	
	Target.SetReg("SP", SP);
	Target.SetReg("PC", PC);
}

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

8

Wednesday, February 14th 2018, 9:08am

Hi,

Sorry my code snipped was incorrect. We need the value from 0 and 4 not the address itself.

Correct would be:

C/C++ Source code

1
2
3
4
5
6
7
8
unsigned int SP;                            
unsigned int PC;                            
                                            
SP = Target.ReadU32(0);     
Target.SetReg("SP", SP);                
                                            
PC = Target.ReadU32(4);
Target.SetReg("PC", PC);   


Does it work that way?

Best regards,
Nino

garrulous

Beginner

Date of registration: Feb 3rd 2018

Posts: 7

9

Wednesday, February 14th 2018, 10:14pm

Hi Nino,

Solved! -- thanks again for your help.

Please note the problem seemed to recur after target reset, so I have copied the same code into AfterTargetReset(); can now reset target and run again successfully through the call to sd_softdevice_enable(). Bluetooth (i.e. SoftDevice) works normally.

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

10

Thursday, February 15th 2018, 8:58am

Hi,

Great to hear that you are up and running again.
Correct AfterTargetDownload and AfterTargetReset need to be edited this way.
Sorry I thought I wrote that earlier but seems like I missed that.

We will consider this case as closed now.

Best regards,
Nino