freeRTOS w/ Eclipse and JLink

Hi I want to use freeRtos with Jlink-Debugging. Is anyone outthere who uses the same setup? The standard environment wont work as delivered in the freertos package… thanx
shorsh

freeRTOS w/ Eclipse and JLink

I think you would have to get the GDB server from Segger to do that, unless anybody knows of any open source implementations?

freeRTOS w/ Eclipse and JLink

hi i have the gdb debug server from segger -thats not the problem.
the real issue is that the freertos debug config is setup for openocd and i dont know what to change to get it working with j-link
what do i habe to change, or has anyone this configuration done thereselves? greatings
shorsh

freeRTOS w/ Eclipse and JLink

I don’t think this is FreeRTOS specific. You are better off asking the people who supplied you the debug server.

freeRTOS w/ Eclipse and JLink

Hi,  I got j-link working with eclipse in linux yesterday.  I’ll explain quick while it’s still fresh in memory: I followed the instructions provided by Stefano from here: http://developers.stf12.net/linux-demo (if ur a windows user a similar then go here http://developers.stf12.net/eclipse-demo)  Be sure to download the latest OpenOCD (I’m using 0.4.0) and use the jlink.cfg and ‘target’.cfg that came with the new version (old version .cfg files wont work…)   This will be perfect if you’re using an STM32 microcontroller.  However you are not, then get a demo project that is specific to your core and configure the debugger and openocd Stefano’s way.  Hope this helps

freeRTOS w/ Eclipse and JLink

@spotdott: can you please post your config files? I followed the linked instructions as you too. I’ve compiled openocd 0.4.0rc2 with “-enable jlink” (i don’t know the command exactly any more) as the only configuration option. Then I replaced the jtag config with the jlink version and the smt32_mdb (or something like that) with the stm32 config file. Now Eclipse reports an error, it doesn’t know the commands “halt” and “poll halt” in the eclipse program config. I’ve played a while around but i didn’t work :) Thanks for your help
Greetz Simon

freeRTOS w/ Eclipse and JLink

Of course.  Here are my config files
jlink.cfg:
#
# Segger J-Link
#
# http://www.segger.com/jlink.html
#
interface jlink
stm32.cfg:
# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
jtag_khz 565
jtag_nsrst_delay 100
jtag_ntrst_delay 100
#jtag scan chain
if { [info exists CPUTAPID ] } {
   set _CPUTAPID $CPUTAPID
} else {
  # See STM Document RM0008
  # Section 26.6.3
   set _CPUTAPID 0x3ba00477
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
if { [info exists BSTAPID ] } {
   # FIXME this never gets used to override defaults...
   set _BSTAPID $BSTAPID
} else {
  # See STM Document RM0008
  # Section 29.6.2
  # Low density devices, Rev A
  set _BSTAPID1 0x06412041
  # Medium density devices, Rev A
  set _BSTAPID2 0x06410041
  # Medium density devices, Rev B and Rev Z
  set _BSTAPID3 0x16410041
  # High density devices, Rev A
  set _BSTAPID4 0x06414041
  # Connectivity line devices, Rev A and Rev Z
  set _BSTAPID5 0x06418041
}
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 
    -expected-id $_BSTAPID2 -expected-id $_BSTAPID3 
    -expected-id $_BSTAPID4 -expected-id $_BSTAPID5
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME stm32x 0 0 0 0 $_TARGETNAME
# For more information about the configuration files, take a look at:
# openocd.texi
stm32_gdb.cfg:
# default ports
telnet_port 4444
gdb_port 3333
tcl_port 6666
init
jtag_khz 565
reset init
verify_ircapture disable
Also, please make sure that you have libusb installed and running Eclipse as root.  In the External Tools Configurations you should have OpenODB Programmer and OpenODB Server pass in arguments of “-f jlink.cfg -f stm32.cfg -f stm32_program_eclipse.cfg” and “-f jlink.cfg -f stm32.cfg -f stm32_gdb.cfg”, respectively.  Make sure that Eclipse knows where you installed OpenODB.  This is also done in the External Tools Configurations’ Main tab under Location  (for me it’s /usr/local/bin/openocd).  In Debug Configurations make sure that under the Debugger tab only GDB Command has a value (for me it’s /home/lsong/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gdb) and under the Startup tab only Initialize Commands is filled as follows:
target extended-remote localhost:3333
b main
monitor soft_reset_halt
monitor sleep 500
continue
clear main
Hope this will get rid of your error messages. Spotdott