EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Debugging freeRTOS with openocd within Eclipse

Started by iderrington May 7, 2007
Hello,

I have recenently bought the olimex arm-usb-ocd. I have installed the
software that is provided, This includes eclipse, gnu arm tool set
and the FDTI drivers for the debugger.

I have successfully managed to debug the sample code that is provide
with the software. This is the code that is part James Lycnh's
excellent tutorial.

However, I would like to move onto something a little meatier, and
decided to start playing around with freeRTOS. I can compile freeRTOS
with no issues, however when I try to download the code into a olimex
2106 prototype board it doesn't work. I get the following text from
the eclipse console:

(gdb) target state: halted
target halted in Thumb state due to debug request, current mode:
Supervisor
cpsr: 0x800000f3 pc: 0x7fffe24c
flash 'lpc2000' found at 0x00000000
erased sectors 0 through 0 on flash bank 0 in 0s 453125us
wrote file main.bin to flash bank 0 at offset 0x00000000 in 0s
171875us
requesting target halt and executing a soft reset
force hardware breakpoints enabled

Eclipse then seems to go into a state where says its launching, but
never actually gets past the 10% stage and doesn't break in main.

I have tried both the ROM and RAM versions and I get the same result
both times.

I have noticed a difference in the output extensions of the simple
projects that work and freeRtos which isnt working for me.

The simeple project generate a file called main.out. Where as
freeRTOS generates rtosDemo.elf. Is this the problem?

Any help would be appreciated.

Regards

Iain

An Engineer's Guide to the LPC2100 Series

iderrington wrote:
> erased sectors 0 through 0 on flash bank 0 in 0s 453125us
> wrote file main.bin to flash bank 0 at offset 0x00000000 in 0s
> 171875us

One reason why the program doesn't work is because you are deleting only
the 1st sector.
Change the following line in your configuration file:

flash erase 0 0 0
to:
flash erase 0 0 'x'

where 'x' is the number of the last sector you want to delete.

Regards,
Ales
Hello Iain,

please use a current version of the OpenOCD, not the one that came with your
ARM-USB-OCD. You can find precompiled binaries at www.yagarto.de.

Best regards,

Dominic

On Monday 07 May 2007 10:57:09 iderrington wrote:
> Hello,
>
> I have recenently bought the olimex arm-usb-ocd. I have installed the
> software that is provided, This includes eclipse, gnu arm tool set
> and the FDTI drivers for the debugger.
>
> I have successfully managed to debug the sample code that is provide
> with the software. This is the code that is part James Lycnh's
> excellent tutorial.
>
> However, I would like to move onto something a little meatier, and
> decided to start playing around with freeRTOS. I can compile freeRTOS
> with no issues, however when I try to download the code into a olimex
> 2106 prototype board it doesn't work. I get the following text from
> the eclipse console:
>
> (gdb) target state: halted
> target halted in Thumb state due to debug request, current mode:
> Supervisor
> cpsr: 0x800000f3 pc: 0x7fffe24c
> flash 'lpc2000' found at 0x00000000
> erased sectors 0 through 0 on flash bank 0 in 0s 453125us
> wrote file main.bin to flash bank 0 at offset 0x00000000 in 0s
> 171875us
> requesting target halt and executing a soft reset
> force hardware breakpoints enabled
>
> Eclipse then seems to go into a state where says its launching, but
> never actually gets past the 10% stage and doesn't break in main.
>
> I have tried both the ROM and RAM versions and I get the same result
> both times.
>
> I have noticed a difference in the output extensions of the simple
> projects that work and freeRtos which isnt working for me.
>
> The simeple project generate a file called main.out. Where as
> freeRTOS generates rtosDemo.elf. Is this the problem?
>
> Any help would be appreciated.
>
> Regards
>
> Iain
Hello Dominic,

I have downloaded the latest version of OpenOCD.
After trying again I have realised that debugging does work when running in RAM (for both simple examples and freeRTOS), but not when I try and download into flash. Im sure i tried in both RAM and ROM before and neither worked.

Do you have any other suggestions?
I am new to gcc, gdb, eclipse and LPC micros, so it maybe something ridiculously silly, Im just not seeing it.

Regards

Iain
----- Original Message ----
From: Dominic Rath
To: l...
Sent: Monday, 7 May, 2007 10:53:56 AM
Subject: Re: [lpc2000] Debugging freeRTOS with openocd within Eclipse
Hello Iain,

please use a current version of the OpenOCD, not the one that came with your
ARM-USB-OCD. You can find precompiled binaries at www.yagarto.de.

Best regards,

Dominic

On Monday 07 May 2007 10:57:09 iderrington wrote:
> Hello,
>
> I have recenently bought the olimex arm-usb-ocd. I have installed the
> software that is provided, This includes eclipse, gnu arm tool set
> and the FDTI drivers for the debugger.
>
> I have successfully managed to debug the sample code that is provide
> with the software. This is the code that is part James Lycnh's
> excellent tutorial.
>
> However, I would like to move onto something a little meatier, and
> decided to start playing around with freeRTOS. I can compile freeRTOS
> with no issues, however when I try to download the code into a olimex
> 2106 prototype board it doesn't work. I get the following text from
> the eclipse console:
>
> (gdb) target state: halted
> target halted in Thumb state due to debug request, current mode:
> Supervisor
> cpsr: 0x800000f3 pc: 0x7fffe24c
> flash 'lpc2000' found at 0x00000000
> erased sectors 0 through 0 on flash bank 0 in 0s 453125us
> wrote file main.bin to flash bank 0 at offset 0x00000000 in 0s
> 171875us
> requesting target halt and executing a soft reset
> force hardware breakpoints enabled
>
> Eclipse then seems to go into a state where says its launching, but
> never actually gets past the 10% stage and doesn't break in main.
>
> I have tried both the ROM and RAM versions and I get the same result
> both times.
>
> I have noticed a difference in the output extensions of the simple
> projects that work and freeRtos which isnt working for me.
>
> The simeple project generate a file called main.out. Where as
> freeRTOS generates rtosDemo.elf. Is this the problem?
>
> Any help would be appreciated.
>
> Regards
>
> Iain

The 2024 Embedded Online Conference