EmbeddedRelated.com
Forums

Debugging program from internal flash

Started by hal_franco_avisado June 27, 2007
Hi! I'm having trouble loading and running my program from internal
flash. I'm using an LPC2888 on the Nohau LPC2800 dev board. My
compiler/assembler/linker/debugger is IAR Embedded workbench for ARM.
Here's what I've done so far:

1) In the Project options Debugger section Download tab, I
checked "Use flash loaders";

2) In the setup tab of the same section, I put
"$TOOLKIT_DIR$\config\flashloader\NXP\FlashNXPLPC2888.mac"; as the
macro file.

3) In the Linker section, I ticked "Allow C-Spy specific extra
output file"; and in the Extra Output tab, I ticked "Generate extra
output file."; I used the variant "simple-code."; This will generate the
.sim file needed by the debugger.

4) In the config tab in the linker section, I used the Linker
command file "$PROJ_DIR$\config\LPC2888_iFlash.xcl.";

I tried putting the range 0x10410000 to 0x104fffff in the flash loader
config but it still won't work. I get the error "Data outside flash"
when I use "$PROJ_DIR$\config\LPC2888_iFlash.xcl" as the linker
command file. When I use "$PROJ_DIR$\config\LPC2888_iRAM.xcl," It
seems to load but I get the warning "The CSPY option 'run to main' is
enabled but due to the lack of breakpoints this will require
single-stepping, which may take a long time. Do you want to execute
anyway or stop at the first instruction? "

Thu Jun 28 10:36:36 2007: Flash download warning: 30306 out of 30306
bytes from data record CODE:[0x00000000,0x00007661] will not be flashed
Thu Jun 28 10:36:40 2007: Loaded macro file:
$PROJ_DIR$\trunk\config\FlashNXPLPC2888.mac
Thu Jun 28 10:36:40 2007: Executing execUserPreload
Thu Jun 28 10:36:40 2007: Executing setup
Thu Jun 28 10:36:41 2007: 30254 bytes downloaded into FLASH and
verified (1.90 Kbytes/sec)
Thu Jun 28 10:36:41 2007: Loaded debugee:
$PROJ_DIR$\trunk\Debug\Exe\DSEMB01.d79
Thu Jun 28 10:36:42 2007: Target reset
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)

An Engineer's Guide to the LPC2100 Series

Hi,

I am using the LPC2368, LPC2378 and the LPC2468. For me flash download
worked only if I did not specify a macro file. It is automatically
executed so you don't need to set it manually. (Check the debug log. You
should see the tool is executing the .mac file.) I have the feeling if I
set it manually, then it was executed twice, and this mixed up the
download. Try to remove the manual setting.

If you disable the plug ins then the hardware breakpoints will be freed
up and you will not get the "run to main" warning. (Most ARM devices can
only set 2 breakpoints in FLASH. If you use both when starting
debugging, then you get this warning.)

Foltos

hal_franco_avisado wrote:
> Hi! I'm having trouble loading and running my program from internal
> flash. I'm using an LPC2888 on the Nohau LPC2800 dev board. My
> compiler/assembler/linker/debugger is IAR Embedded workbench for ARM.
> Here's what I've done so far:
>
> 1) In the Project options Debugger section Download tab, I
> checked "Use flash loaders";
>
> 2) In the setup tab of the same section, I put
> "$TOOLKIT_DIR$\config\flashloader\NXP\FlashNXPLPC2888.mac"; as the
> macro file.
>
> 3) In the Linker section, I ticked "Allow C-Spy specific extra
> output file"; and in the Extra Output tab, I ticked "Generate extra
> output file."; I used the variant "simple-code."; This will generate the
> .sim file needed by the debugger.
>
> 4) In the config tab in the linker section, I used the Linker
> command file "$PROJ_DIR$\config\LPC2888_iFlash.xcl.";
>
> I tried putting the range 0x10410000 to 0x104fffff in the flash loader
> config but it still won't work. I get the error "Data outside flash"
> when I use "$PROJ_DIR$\config\LPC2888_iFlash.xcl" as the linker
> command file. When I use "$PROJ_DIR$\config\LPC2888_iRAM.xcl," It
> seems to load but I get the warning "The CSPY option 'run to main' is
> enabled but due to the lack of breakpoints this will require
> single-stepping, which may take a long time. Do you want to execute
> anyway or stop at the first instruction? "
>
> Thu Jun 28 10:36:36 2007: Flash download warning: 30306 out of 30306
> bytes from data record CODE:[0x00000000,0x00007661] will not be flashed
> Thu Jun 28 10:36:40 2007: Loaded macro file:
> $PROJ_DIR$\trunk\config\FlashNXPLPC2888.mac
> Thu Jun 28 10:36:40 2007: Executing execUserPreload
> Thu Jun 28 10:36:40 2007: Executing setup
> Thu Jun 28 10:36:41 2007: 30254 bytes downloaded into FLASH and
> verified (1.90 Kbytes/sec)
> Thu Jun 28 10:36:41 2007: Loaded debugee:
> $PROJ_DIR$\trunk\Debug\Exe\DSEMB01.d79
> Thu Jun 28 10:36:42 2007: Target reset
> Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
> of hardware breakpoints)
> Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
> of hardware breakpoints)
>
> Yahoo! Groups Links
>
Hi,
I had the same problem.. there was a simple address error in the flash loader supplied by IAR. There is source for this program supplied with the workbench so I could correct it. Ive included the new source and objects. This cured my problem so hopefully will work with you too

hal_franco_avisado wrote:
Hi! I'm having trouble loading and running my program from internal
flash. I'm using an LPC2888 on the Nohau LPC2800 dev board. My
compiler/assembler/linker/debugger is IAR Embedded workbench for ARM.
Here's what I've done so far:

1) In the Project options Debugger section Download tab, I
checked "Use flash loaders";

2) In the setup tab of the same section, I put
"$TOOLKIT_DIR$\config\flashloader\NXP\FlashNXPLPC2888.mac"; as the
macro file.

3) In the Linker section, I ticked "Allow C-Spy specific extra
output file"; and in the Extra Output tab, I ticked "Generate extra
output file."; I used the variant "simple-code."; This will generate the
.sim file needed by the debugger.

4) In the config tab in the linker section, I used the Linker
command file "$PROJ_DIR$\config\LPC2888_iFlash.xcl.";

I tried putting the range 0x10410000 to 0x104fffff in the flash loader
config but it still won't work. I get the error "Data outside flash"
when I use "$PROJ_DIR$\config\LPC2888_iFlash.xcl" as the linker
command file. When I use "$PROJ_DIR$\config\LPC2888_iRAM.xcl," It
seems to load but I get the warning "The CSPY option 'run to main' is
enabled but due to the lack of breakpoints this will require
single-stepping, which may take a long time. Do you want to execute
anyway or stop at the first instruction? "

Thu Jun 28 10:36:36 2007: Flash download warning: 30306 out of 30306
bytes from data record CODE:[0x00000000,0x00007661] will not be flashed
Thu Jun 28 10:36:40 2007: Loaded macro file:
$PROJ_DIR$\trunk\config\FlashNXPLPC2888.mac
Thu Jun 28 10:36:40 2007: Executing execUserPreload
Thu Jun 28 10:36:40 2007: Executing setup
Thu Jun 28 10:36:41 2007: 30254 bytes downloaded into FLASH and
verified (1.90 Kbytes/sec)
Thu Jun 28 10:36:41 2007: Loaded debugee:
$PROJ_DIR$\trunk\Debug\Exe\DSEMB01.d79
Thu Jun 28 10:36:42 2007: Target reset
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)

---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today.
oops.. forgot I couldn't include files.. find the flashloader source program FlashNXPLPC2888.c and change the constant structure below and re-compile.

const FlashDev_t LPC2888_Device[] {
0x0102100A, // Dev ID (LPC2880 or LPC2888)
23, // number of sectors
LPC2888_FlashLayout, // Sectors layout
0x10400000, // MEMO: 1/5/07 changed was 0x00000000 */
// base address of the internal flash
512, // page size
0x104ff800, // MEMO: 1/5/07 was 0x000FF800,
// flash programme valid adders
{ // flash programme valid data mark
0xAA55AA55,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF
}
};

dave simpson wrote:
Hi,
I had the same problem.. there was a simple address error in the flash loader supplied by IAR. There is source for this program supplied with the workbench so I could correct it. Ive included the new source and objects. This cured my problem so hopefully will work with you too

hal_franco_avisado wrote:
Hi! I'm having trouble loading and running my program from internal
flash. I'm using an LPC2888 on the Nohau LPC2800 dev board. My
compiler/assembler/linker/debugger is IAR Embedded workbench for ARM.
Here's what I've done so far:

1) In the Project options Debugger section Download tab, I
checked "Use flash loaders";

2) In the setup tab of the same section, I put
"$TOOLKIT_DIR$\config\flashloader\NXP\FlashNXPLPC2888.mac"; as the
macro file.

3) In the Linker section, I ticked "Allow C-Spy specific extra
output file"; and in the Extra Output tab, I ticked "Generate extra
output file."; I used the variant "simple-code."; This will generate the
.sim file needed by the debugger.

4) In the config tab in the linker section, I used the Linker
command file "$PROJ_DIR$\config\LPC2888_iFlash.xcl.";

I tried putting the range 0x10410000 to 0x104fffff in the flash loader
config but it still won't work. I get the error "Data outside flash"
when I use "$PROJ_DIR$\config\LPC2888_iFlash.xcl" as the linker
command file. When I use "$PROJ_DIR$\config\LPC2888_iRAM.xcl," It
seems to load but I get the warning "The CSPY option 'run to main' is
enabled but due to the lack of breakpoints this will require
single-stepping, which may take a long time. Do you want to execute
anyway or stop at the first instruction? "

Thu Jun 28 10:36:36 2007: Flash download warning: 30306 out of 30306
bytes from data record CODE:[0x00000000,0x00007661] will not be flashed
Thu Jun 28 10:36:40 2007: Loaded macro file:
$PROJ_DIR$\trunk\config\FlashNXPLPC2888.mac
Thu Jun 28 10:36:40 2007: Executing execUserPreload
Thu Jun 28 10:36:40 2007: Executing setup
Thu Jun 28 10:36:41 2007: 30254 bytes downloaded into FLASH and
verified (1.90 Kbytes/sec)
Thu Jun 28 10:36:41 2007: Loaded debugee:
$PROJ_DIR$\trunk\Debug\Exe\DSEMB01.d79
Thu Jun 28 10:36:42 2007: Target reset
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)

---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today.



---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today.
If you happen to be using the IAR Jlink which is made by Segger then you can download updated JLINK drivers that will allow more than 2 breakpoints when running from flash. It is a free download on segger website and may be on the IAR website ??

dave simpson wrote:
oops.. forgot I couldn't include files.. find the flashloader source program FlashNXPLPC2888.c and change the constant structure below and re-compile.

const FlashDev_t LPC2888_Device[] {
0x0102100A, // Dev ID (LPC2880 or LPC2888)
23, // number of sectors
LPC2888_FlashLayout, // Sectors layout
0x10400000, // MEMO: 1/5/07 changed was 0x00000000 */
// base address of the internal flash
512, // page size
0x104ff800, // MEMO: 1/5/07 was 0x000FF800,
// flash programme valid adders
{ // flash programme valid data mark
0xAA55AA55,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF
}
};

dave simpson wrote:
Hi,
I had the same problem.. there was a simple address error in the flash loader supplied by IAR. There is source for this program supplied with the workbench so I could correct it. Ive included the new source and objects. This cured my problem so hopefully will work with you too

hal_franco_avisado wrote:
Hi! I'm having trouble loading and running my program from internal
flash. I'm using an LPC2888 on the Nohau LPC2800 dev board. My
compiler/assembler/linker/debugger is IAR Embedded workbench for ARM.
Here's what I've done so far:

1) In the Project options Debugger section Download tab, I
checked "Use flash loaders";

2) In the setup tab of the same section, I put
"$TOOLKIT_DIR$\config\flashloader\NXP\FlashNXPLPC2888.mac"; as the
macro file.

3) In the Linker section, I ticked "Allow C-Spy specific extra
output file"; and in the Extra Output tab, I ticked "Generate extra
output file."; I used the variant "simple-code."; This will generate the
.sim file needed by the debugger.

4) In the config tab in the linker section, I used the Linker
command file "$PROJ_DIR$\config\LPC2888_iFlash.xcl.";

I tried putting the range 0x10410000 to 0x104fffff in the flash loader
config but it still won't work. I get the error "Data outside flash"
when I use "$PROJ_DIR$\config\LPC2888_iFlash.xcl" as the linker
command file. When I use "$PROJ_DIR$\config\LPC2888_iRAM.xcl," It
seems to load but I get the warning "The CSPY option 'run to main' is
enabled but due to the lack of breakpoints this will require
single-stepping, which may take a long time. Do you want to execute
anyway or stop at the first instruction? "

Thu Jun 28 10:36:36 2007: Flash download warning: 30306 out of 30306
bytes from data record CODE:[0x00000000,0x00007661] will not be flashed
Thu Jun 28 10:36:40 2007: Loaded macro file:
$PROJ_DIR$\trunk\config\FlashNXPLPC2888.mac
Thu Jun 28 10:36:40 2007: Executing execUserPreload
Thu Jun 28 10:36:40 2007: Executing setup
Thu Jun 28 10:36:41 2007: 30254 bytes downloaded into FLASH and
verified (1.90 Kbytes/sec)
Thu Jun 28 10:36:41 2007: Loaded debugee:
$PROJ_DIR$\trunk\Debug\Exe\DSEMB01.d79
Thu Jun 28 10:36:42 2007: Target reset
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)
Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
of hardware breakpoints)

---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today.



---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today.



---------------------------------
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider.
Thanks guys! I've been able to load to and debug from flash by putting
the iFlash.xcl in the linker configuration,
"$PROJ_DIR$\config\FlashNXPLPC2888.mac" as the macro file and by
setting "Relocate" in the flash loader config to 0. However, debugging
is inconsistent and often gets stuck in a memcpy() routine in the
disassembler. Resetting the program (software reset, not debugger
reset) usually makes the system work again. Why is this so?

Thanks again :D

--- In l..., dave simpson wrote:
>
> If you happen to be using the IAR Jlink which is made by Segger then
you can download updated JLINK drivers that will allow more than 2
breakpoints when running from flash. It is a free download on segger
website and may be on the IAR website ??
>
>
>
>
> dave simpson wrote:
> oops.. forgot I couldn't include files.. find the
flashloader source program FlashNXPLPC2888.c and change the constant
structure below and re-compile.
>
> const FlashDev_t LPC2888_Device[] > {
> 0x0102100A, // Dev ID (LPC2880 or LPC2888)
> 23, // number of sectors
> LPC2888_FlashLayout, // Sectors layout
> 0x10400000, // MEMO: 1/5/07 changed was 0x00000000 */
> // base address of the internal flash
> 512, // page size
> 0x104ff800, // MEMO: 1/5/07 was 0x000FF800,
> // flash programme valid adders
> { // flash programme valid data mark
> 0xAA55AA55,0xFFFFFFFF,
> 0xFFFFFFFF,0xFFFFFFFF
> }
> };
>
> dave simpson wrote:
> Hi,
> I had the same problem.. there was a simple address error in the
flash loader supplied by IAR. There is source for this program
supplied with the workbench so I could correct it. Ive included the
new source and objects. This cured my problem so hopefully will work
with you too
>
> hal_franco_avisado wrote:
> Hi! I'm having trouble loading and running my program from internal
> flash. I'm using an LPC2888 on the Nohau LPC2800 dev board. My
> compiler/assembler/linker/debugger is IAR Embedded workbench for ARM.
> Here's what I've done so far:
>
> 1) In the Project options Debugger section Download tab, I
> checked "Use flash loaders";
>
> 2) In the setup tab of the same section, I put
> "$TOOLKIT_DIR$\config\flashloader\NXP\FlashNXPLPC2888.mac"; as the
> macro file.
>
> 3) In the Linker section, I ticked "Allow C-Spy specific extra
> output file"; and in the Extra Output tab, I ticked "Generate extra
> output file."; I used the variant "simple-code."; This will generate the
> .sim file needed by the debugger.
>
> 4) In the config tab in the linker section, I used the Linker
> command file "$PROJ_DIR$\config\LPC2888_iFlash.xcl.";
>
> I tried putting the range 0x10410000 to 0x104fffff in the flash loader
> config but it still won't work. I get the error "Data outside flash"
> when I use "$PROJ_DIR$\config\LPC2888_iFlash.xcl" as the linker
> command file. When I use "$PROJ_DIR$\config\LPC2888_iRAM.xcl," It
> seems to load but I get the warning "The CSPY option 'run to main' is
> enabled but due to the lack of breakpoints this will require
> single-stepping, which may take a long time. Do you want to execute
> anyway or stop at the first instruction? "
>
> Thu Jun 28 10:36:36 2007: Flash download warning: 30306 out of 30306
> bytes from data record CODE:[0x00000000,0x00007661] will not be flashed
> Thu Jun 28 10:36:40 2007: Loaded macro file:
> $PROJ_DIR$\trunk\config\FlashNXPLPC2888.mac
> Thu Jun 28 10:36:40 2007: Executing execUserPreload
> Thu Jun 28 10:36:40 2007: Executing setup
> Thu Jun 28 10:36:41 2007: 30254 bytes downloaded into FLASH and
> verified (1.90 Kbytes/sec)
> Thu Jun 28 10:36:41 2007: Loaded debugee:
> $PROJ_DIR$\trunk\Debug\Exe\DSEMB01.d79
> Thu Jun 28 10:36:42 2007: Target reset
> Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
> of hardware breakpoints)
> Thu Jun 28 10:36:42 2007: Failed to set breakpoint at 0x000012CC (out
> of hardware breakpoints)
>
> ---------------------------------
> Yahoo! Mail is the world's favourite email. Don't settle for less,
sign up for your freeaccount today.
>
>
>
> ---------------------------------
> Yahoo! Mail is the world's favourite email. Don't settle for less,
sign up for your freeaccount today.
>
>
>
>
>
>
> ---------------------------------
> The all-new Yahoo! Mail goes wherever you go - free your email
address from your Internet provider.
>
>
>