[En-Nut-Discussion] Ethernut 5 + Eclipse tutorial

13 views
Skip to first unread message

Markus Dost

unread,
Feb 9, 2012, 2:58:26 AM2/9/12
to Ethernut User Chat (English)
Hi,

I have the next question/problem. I want to pass the tutorial to build
and debug applications with the Ethernut 5 and the Eclipse IDE:
http://www.ethernut.de/en/hardware/enut5/debugging.html

But when I want to build the project, Eclipse puts out "Cannot run
program "make" ". I have no idea, what I've made wrong. The path-
variable for yargarto is set correctly.
When I try to build the application with the cmd.exe and the command
"make all", it works.

Best regards,
Markus
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Harald Kipp

unread,
Feb 11, 2012, 6:12:09 AM2/11/12
to Ethernut User Chat (English)
Hi Markus,

On 09.02.2012 08:58, Markus Dost wrote:

> I have the next question/problem. I want to pass the tutorial to build
> and debug applications with the Ethernut 5 and the Eclipse IDE:
> http://www.ethernut.de/en/hardware/enut5/debugging.html

Please note, that I recently added an updated, more general guide

http://www.ethernut.de/en/tools/eclipse/


> But when I want to build the project, Eclipse puts out "Cannot run
> program "make" ". I have no idea, what I've made wrong. The path-
> variable for yargarto is set correctly.

Guess, your PC is running Windows. You need to add the path to

x:\ethernut-x.y\nut\tools\win32

http://www.ethernut.de/img/indigo-project-prop-build-env.png

Hope, this helps,

Harald
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Markus Dost

unread,
Feb 13, 2012, 3:02:11 AM2/13/12
to Ethernut User Chat (English)
Hi Harald

Am 11.02.2012 um 12:12 schrieb Harald Kipp:

>> But when I want to build the project, Eclipse puts out "Cannot run
>> program "make" ". I have no idea, what I've made wrong. The path-
>> variable for yargarto is set correctly.
>
> Guess, your PC is running Windows. You need to add the path to
>
> x:\ethernut-x.y\nut\tools\win32
>
> http://www.ethernut.de/img/indigo-project-prop-build-env.png

I did that. Additional the WinAVR-package is installed and added to
the path-variable, too. So eclipse should find the make.exe twice.

Harald Kipp

unread,
Feb 15, 2012, 1:25:40 PM2/15/12
to en-nut-d...@egnite.de
Just for the records:

>>> But when I want to build the project, Eclipse puts out "Cannot run
>>> program "make" ". I have no idea, what I've made wrong. The path-
>>> variable for yargarto is set correctly.

Markus found the problem: The C/C++ Plugin wasn't properly installed.

Regards,

Harald
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Markus Dost

unread,
Feb 20, 2012, 2:22:17 AM2/20/12
to Ethernut User Chat (English)
Hi,

I try to debug the Ethernut 5 board with the turtelizer2 and Eclipse.
After starting OpenOCD, I want to run the debugging and the console
puts out:
"Info: accepting 'gdb' connection from 3333"

But then the progress stops and this error message appears:
"Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
Malformed response to offset query, timeout
Malformed response to offset query, timeout"

Does anybody know what I've made wrong?

Harald Kipp

unread,
Feb 20, 2012, 3:28:44 AM2/20/12
to Ethernut User Chat (English)
Hi Markus,

On 20.02.2012 08:22, Markus Dost wrote:

> But then the progress stops and this error message appears:
> "Error in final launch sequence
> Failed to execute MI command:
> -target-select remote localhost:3333
>
> Error message from debugger back end:
> Malformed response to offset query, timeout
> Malformed response to offset query, timeout"

Are you sure that you selected "Standard GDB Hardware Debugging Launcher"

http://www.ethernut.de/img/indigo-debug-config-main.png

If not, click on "Select other...".

May be you should first make sure that the OpenOCD - Turtelizer -
Ethernut chain is working.

http://www.ethernut.de/en/hardware/enut5/openocd.html

Markus Dost

unread,
Feb 20, 2012, 5:17:12 AM2/20/12
to Ethernut User Chat (English)
Hi Harald,

Am 20.02.2012 um 09:28 schrieb Harald Kipp:

> Are you sure that you selected "Standard GDB Hardware Debugging
> Launcher"
>

Right, I forgot it. But now I get the following error:
"symbol-file C:\\ethernut-4.10\\nutapp\\events\\events.elf
Ignoring packet error, continuing ...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing ...
Ignoring packet error, continuing ...
Ignoring packet error, continuing ...
Ignoring packet error, continuing ...
Ignoring packet error, continuing ...
load C:\\ethernut-4.10\\nutapp\\events\\events.elf
You can't do that when your target is 'None'"

The settings for the debugger are the same as in the tutorial. Is it
necessary to start a GDB-server? I'm very new at this stuff ...

> May be you should first make sure that the OpenOCD - Turtelizer -
> Ethernut chain is working.

I would say the chain is working. I can load .bin-Files to the board
and execute them.

Regards,
Markus
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Harald Kipp

unread,
Feb 20, 2012, 2:05:55 PM2/20/12
to en-nut-d...@egnite.de
Hi Markus,

On 20.02.2012 11:17, Markus Dost wrote:
> warning: unrecognized item "timeout" in "qSupported" response
> Ignoring packet error, continuing ...
> Ignoring packet error, continuing ...
> Ignoring packet error, continuing ...
> Ignoring packet error, continuing ...
> Ignoring packet error, continuing ...
> load C:\\ethernut-4.10\\nutapp\\events\\events.elf
> You can't do that when your target is 'None'"
>
> The settings for the debugger are the same as in the tutorial. Is it
> necessary to start a GDB-server? I'm very new at this stuff ...

OpenOCD works as a GDB server in this case and yes, it needs to be started, either manually or from within OpenOCD.

http://www.ethernut.de/en/tools/eclipse/confdebug.html
(Near the end of that page)

The tricky part may be how to start it. You may set the SDRAM Configuration in Eclipse

http://www.ethernut.de/en/hardware/enut5/enut50scd43.png

but I prefer the command line version

openocd -d3 -s ../../nut/tools/turtelizer2 -c "source [find interface/turtelizer2.cfg]" -c "source [find board/ethernut5.cfg]" -c init -c "reset init" -c halt

as done here

http://www.ethernut.de/img/indigo-debug-tools.png

In this case you don't need to specify any montior commands

http://www.ethernut.de/img/indigo-debug-config-startup.png
(Textarea below "Halt" is left empty)

Best regards,

Harald

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Markus Dost

unread,
Feb 21, 2012, 2:09:02 AM2/21/12
to Ethernut User Chat (English)
Hi Harald

Am 20.02.2012 um 20:05 schrieb Harald Kipp:

> OpenOCD works as a GDB server in this case and yes, it needs to be
> started, either manually or from within OpenOCD.
>
> http://www.ethernut.de/en/tools/eclipse/confdebug.html
> (Near the end of that page)
>
> The tricky part may be how to start it. You may set the SDRAM
> Configuration in Eclipse
>
> http://www.ethernut.de/en/hardware/enut5/enut50scd43.png
>
> but I prefer the command line version
>
> openocd -d3 -s ../../nut/tools/turtelizer2 -c "source [find
> interface/turtelizer2.cfg]" -c "source [find board/ethernut5.cfg]" -
> c init -c "reset init" -c halt
>
> as done here
>
> http://www.ethernut.de/img/indigo-debug-tools.png
>
> In this case you don't need to specify any montior commands
>
> http://www.ethernut.de/img/indigo-debug-config-startup.png
> (Textarea below "Halt" is left empty)

Thank your for your help but my settings for OpenOCD and the debug
configuration are exactly what you've written here.
Here are the console outputs after starting OpenOCD:

Open On-Chip Debugger 0.5.0 (2011-11-23-10:33)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 300
jtag_ntrst_delay: 200
RCLK - adaptive
srst_only separate srst_gates_jtag srst_open_drain
Info : device: 4 "2232C"
Info : deviceID: 67354056
Info : SerialNumber: TLV6QNFFA
Info : Description: Turtelizer JTAG/RS232 Adapter A
Info : RCLK (adaptive clock speed) not supported - fallback to 3 kHz
Info : JTAG tap: at91sam9260.cpu tap/device found: 0x0792603f (mfg:
0x01f, part: 0x7926, ver: 0x0)
Info : Embedded ICE version 6
Info : at91sam9260.cpu: hardware has 2 breakpoint/watchpoint units
RCLK not supported - fallback to 5 kHz
target state: halted
target halted in ARM state due to debug-request, current mode:
Supervisor
cpsr: 0x400000d3 pc: 0x27f72084
MMU: disabled, D-Cache: disabled, I-Cache: enabled
Info : JTAG tap: at91sam9260.cpu tap/device found: 0x0792603f (mfg:
0x01f, part: 0x7926, ver: 0x0)
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000000d3 pc: 0x00000000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
RCLK not supported - fallback to 3000 kHz
dcc downloads are enabled
Warn : NOTE! Severe performance degradation without fast memory
access enabled. Type 'help fast'.


Info : accepting 'gdb' connection from 3333

and the arm-none-eabi-gdb.exe:

symbol-file C:\\ethernut-4.10\\nutapp\\events\\events.elf
Ignoring packet error, continuing...


warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...

Ignoring packet error, continuing...


load C:\\ethernut-4.10\\nutapp\\events\\events.elf
You can't do that when your target is `None'

set $pc=0x20000000
No registers.
tbreak main
Cannot access memory at address 0x200002a4
continue
The program is not being run.

For me it seems that the arm-none-eabi-gdb.exe has problems to access
the controller.

Harald Kipp

unread,
Feb 21, 2012, 6:48:50 AM2/21/12
to en-nut-d...@egnite.de
Hi Markus,

On 21.02.2012 08:09, Markus Dost wrote:
> and the arm-none-eabi-gdb.exe:
>
> symbol-file C:\\ethernut-4.10\\nutapp\\events\\events.elf
> Ignoring packet error, continuing...
> warning: unrecognized item "timeout" in "qSupported" response
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> load C:\\ethernut-4.10\\nutapp\\events\\events.elf
> You can't do that when your target is `None'
> set $pc=0x20000000
> No registers.
> tbreak main
> Cannot access memory at address 0x200002a4
> continue
> The program is not being run.
>
> For me it seems that the arm-none-eabi-gdb.exe has problems to access
> the controller.

Mh...no idea right now. I've updated the webpage

http://www.ethernut.de/en/tools/eclipse/confdebug.html

Here's my ethernut5.cfg

=======================================================================
# We add to the minimal configuration.
source [find target/at91sam9260.cfg]

# If DCC downloads are enabled, we need a work area.
# The configuration line below is intentionally commented,
# because this option may fail when code is directly loaded
# into internal SRAM. In this case you may provide another
# area, a few kB will do. The configuration below will occupy
# the complete SRAM.
#$_TARGETNAME configure -work-area-phys 0x00300000 -work-area-size 0x8000

$_TARGETNAME configure -event reset-start {
# At reset CPU runs at 32.768 kHz.
# JTAG Frequency must be 6 times slower if RCLK is not supported.
jtag_rclk 5

# For memory access we must halt the CPU
halt
wait_halt

# Optionally enable DCC downloads. If enabled,
# a work area must be provided too (see above).
# arm7_9 dcc_downloads enable ;# Enable faster DCC downloads

# RSTC_MR : enable user reset, MMU may be enabled... use physical address
mww phys 0xfffffd08 0xa5000501
}

$_TARGETNAME configure -event reset-init {
mww 0xfffffd44 0x00008000 ;# WDT_MR : disable watchdog

mww 0xfffffc20 0x00004001 ;# CKGR_MOR : enable the main oscillator
sleep 20 ;# wait 20 ms
mww 0xfffffc30 0x00000001 ;# PMC_MCKR : switch to main oscillator
sleep 10 ;# wait 10 ms
mww 0xfffffc28 0x2060bf09 ;# CKGR_PLLAR: Set PLLA Register for 198.656 MHz
sleep 20 ;# wait 20 ms
mww 0xfffffc30 0x00000101 ;# PMC_MCKR : Select prescaler (divide by 2)
sleep 10 ;# wait 10 ms
mww 0xfffffc30 0x00000102 ;# PMC_MCKR : Clock from PLLA is selected (99.328 MHz)
sleep 10 ;# wait 10 ms

# Increase JTAG Speed to 6 MHz if RCLK is not supported
jtag_rclk 5000

# Fast memory access may fail, when the CPU is running
# in slow clock mode. Intentionally disabled by default.
# arm7_9 fast_memory_access enable

mww 0xfffff870 0xffff0000 ;# PIO_ASR : Select peripheral function for D15..D31
mww 0xfffff804 0xffff0000 ;# PIO_PDR : Disable PIO function for D15..D31

mww 0xffffef1c 0x00010002 ;# EBI_CSA : Assign EBI Chip Select 1 to SDRAM, VDDIOMSEL set for +3V3 memory

mww 0xffffea08 0x85227259 ;# SDRAMC_CR : Configure SDRAM (2 x Micron MT48LC16M16A2 : 4M x 16Bit x 4 Banks)

mww 0xffffea00 0x1 ;# SDRAMC_MR : issue a NOP command
mww 0x20000000 0
mww 0xffffea00 0x2 ;# SDRAMC_MR : issue an 'All Banks Precharge' command
mww 0x20000000 0
mww 0xffffea00 0x4 ;# SDRAMC_MR : issue 8 x 'Auto-Refresh' Command
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x4
mww 0x20000000 0
mww 0xffffea00 0x3 ;# SDRAMC_MR : issue a 'Load Mode Register' command
mww 0x20000000 0
mww 0xffffea00 0x0 ;# SDRAMC_MR : normal mode
mww 0x20000000 0
mww 0xffffea04 0x2b6 ;# SDRAMC_TR : Set refresh timer count to 7us

# mww 0xFFFFEF00 0x00000003 ;# MATRIX_MRCR : Remap internal SRAM to address 0
}
=======================================================================

Here is the at91sam9260.cfg

=======================================================================
######################################
# Target: Atmel AT91SAM9260
######################################

if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME at91sam9260
}

if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}

if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
# force an error till we get a good number
set _CPUTAPID 0x0792603f
}

reset_config trst_and_srst separate trst_push_pull srst_open_drain

#
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

jtag_nsrst_delay 300
jtag_ntrst_delay 200

jtag_rclk 3

######################
# Target configuration
######################

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs

# Internal sram1 memory
$_TARGETNAME configure -work-area-phys 0x00300000 -work-area-size 0x1000 -work-area-backup 1
=======================================================================

and finally the turtelizer2.cfg

=======================================================================
#
# egnite Turtelizer 2
#
# http://www.ethernut.de/en/hardware/turtelizer/index.html
#

interface turtle

ft2232_device_desc "Turtelizer JTAG/RS232 Adapter"
ft2232_layout turtelizer2
ft2232_vid_pid 0x0403 0xbdc8

reset_config srst_only
=======================================================================

One thing you may try is to reduce

jtag_rclk 5000

to mmmmhhhh...

jtag_rclk 1000

Just in case that there are cable problems. Btw. are you using the original red JTAG adapter board with the four header connectors?

Markus Dost

unread,
Feb 21, 2012, 8:27:26 AM2/21/12
to Ethernut User Chat (English)
Hi Harald,

there were some differences between my ethernut5.cfg- and
turtelizer2.cfg-files and yours. Mainly in the ethernut5.cfg. But when
I use your files the debugging works :-) .

Only the console of OpenOCD displays some warnings after starting it:

Warn : NOTE! DCC downloads have not been enabled, defaulting to slow
memory writes. Type 'help dcc'. Warn : NOTE! Severe performance

degradation without fast memory access enabled. Type 'help fast'.

And after starting the debugging it puts out:

Warn : acknowledgment received, but no packet pending

Do I have to worry about these?

Thank you very much for your help.

Harald Kipp

unread,
Feb 21, 2012, 8:51:48 AM2/21/12
to Ethernut User Chat (English)
Hi Markus,

I further enhanced the debugging page

http://www.ethernut.de/en/tools/eclipse/confdebug.html

with a new chapter "Solving OpenOCD and GDB Problems"

On 21.02.2012 14:27, Markus Dost wrote:
> there were some differences between my ethernut5.cfg- and
> turtelizer2.cfg-files and yours. Mainly in the ethernut5.cfg. But when
> I use your files the debugging works :-) .

Mh...may be the Turtelizer/OpenOCD package needs to be updated.

In any case

http://www.ethernut.de/en/hardware/enut5/openocd.html

should help to understand what is going on.


> Only the console of OpenOCD displays some warnings after starting it:
>
> Warn : NOTE! DCC downloads have not been enabled, defaulting to slow
> memory writes. Type 'help dcc'. Warn : NOTE! Severe performance
> degradation without fast memory access enabled. Type 'help fast'.

This is explained on that page in chapter "Optimizing Binary Downloads".


> And after starting the debugging it puts out:
>
> Warn : acknowledgment received, but no packet pending
>
> Do I have to worry about these?

Same here, no idea. Seems to be harmless.


> Thank you very much for your help.

Thank _you_ for your patience.

Sometimes the OpenOCD/GDB/Eclipse combo is a bullheaded bastard, that
drives me crazy. But over the time I understand more details and found,
that actually everything is running quite well. Anyway, my writing is
behind and the documents still need some polishing.

Reply all
Reply to author
Forward
0 new messages