Monday, October 23rd 2017, 8:56pm 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.

wincon

Beginner

Date of registration: Mar 1st 2016

Posts: 12

1

Tuesday, January 3rd 2017, 7:09am

Ozone multi-step multiple elf load

Hi - just getting started using Ozone.

We're targeting an LPC4350. It has external SDRAM attached that needs to be configured prior to using it (i.e. downloading elf code to it). We've been doing this in other debuggers (JtagJet/Chameleon; JLink/GNUARMEclipse) by a two-step process that can be configured in the Chameleon and GNUARMEclipse setup: downloading the SDRAMSetup.elf, which the debugger does the reset, download (to internal ram), then run until main which configures the SDRAM; then download the App.elf (which downloads to internal ram, overwriting SDRAMSetup, and SDRAM), and no reset but start from the initial vector location and break at main.

I've been trying to do this with a custom TargetReset() in the .jdebug but not getting it to work. Could you provide a .jdebug example, or similar, how to go about doing something like this?

Thanks.
-Kevin


Target: LPC4350
OSX 10.11.6
Ozone 2.22j
JLink Ultra+

wincon

Beginner

Date of registration: Mar 1st 2016

Posts: 12

2

Thursday, January 5th 2017, 12:43am

Ping. Would like to figure out how to get Ozone working with this. I'm using Eclipse (GNU ARM Eclipse) but there are some Eclipse and gdb bugs that are making it a challenge (e.g. single stepping on either core will cause the debugger/gdb to lose communication and display "Ignoring packet error, continuing..." after a few steps).

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 362

3

Thursday, January 5th 2017, 1:09pm

Hi,

in general the easiest way to load and run multiple application files is to use the OnProjectLoad to load the first application file and then use the AfterTargetHalt function to load the second application when a certain point, i.e. end of initialisation is reached.
We might add more complex examples to the user manual in the future.

Best regards
Johannes

wincon

Beginner

Date of registration: Mar 1st 2016

Posts: 12

4

Wednesday, July 12th 2017, 7:35am

I'm back to trying to get this to work but still not able to.

What I'm trying to do:
-Reset, download, and execute "configure external sdram" elf.
-Download and execute/debug "main app" elf.

The "configure external sdram" elf lives entirely within internal sram. The "main app" elf spans internal sram and external sdram. Hence why the "configure external sdram" needs to be downloaded and executed first, then "main app", without reset in between.

I've been trying to get this working a few different ways, but am stuck. Many paths seem to lead to recursion calls, or other dead ends, including your suggestion (i.e. AfterTargetHalt() correctly gets called when when "configure external sdram" halts execution, but then when FileOpen("main app") and Debug.Download() are executed in AfterTargetHalt(), "main app" downloads and starts execution, then AfterTargetHalt() gets called again and ...).

Any further hints or help is appreciated. Thanks!
-Kevin

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 362

5

Wednesday, July 12th 2017, 2:16pm

Hi,

To just load the second file without reset, you can use File.Load() instead of File.Open() and Debug.Download().

Best regards
Johannes

wincon

Beginner

Date of registration: Mar 1st 2016

Posts: 12

6

Thursday, July 13th 2017, 12:16am

Thanks for the File.Load() suggestion, it helps lead to a sort-of solution, but still some issues.

Here's how I've gotten it to sort-of work:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
void DebugStart (void) {
  Exec.Connect();
  Exec.Reset();
  File.Open ("SdramConfig.elf");

  /* Wait for it to hit main() */
  Util.Sleep(1000);

  /* Continue executing main() and wait to hit asm bkpt */
  Debug.Continue();
  Util.Sleep(1000);
  File.Load ("MainApp.elf", "");

  /* Seems to be necessary in order to read either GetBaseAddr() or SP & PC correctly */
  Util.Sleep(1000);

  /* Initialize SP */
  unsigned int adr;
  unsigned int val;
  adr = Elf.GetBaseAddr();
  val = Target.ReadU32(adr);
  Target.SetReg("SP", val);

  /* Initialize PC */
  val = Target.ReadU32(adr + 4);
  Target.SetReg("PC", val);
}


I can get it to work on the first "download and reset program" but if I "stop debug session" and "download and reset program" again, I get a failed to read target status message. I have to cycle everything: target, jlink, and the app in order to get everything working again.

Is this the right way to download the elf apps? Any suggestions for better ways of downloading and dealing with the "failed to read target status"?