Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Problem debugging with Eclipse+yagarto+J-LINK

Posted by gnello on November 3, 2009
Hi all,
I am trying to debug a freertos-demo like ARM7_AT91SAM7X256_Eclipse, using eclipse + yagarto + j-link.
I followed instructions found in yagarto-site to create a new eclipse project. Compiling work fine, but I have some problems to debug firmware.

The gdb script used is the same provided by yagarto. It is:

#
# This config file was tested with J-Link GDB Server v4.04
#
# Listening for commands on this PC's tcp port 2331
target remote localhost:2331
# Enable flash download and flash breakpoints.
# Flash download and flash breakpoints are features of
# the J-Link software which require separate licenses
# from SEGGER.
# Select flash device
monitor flash device = AT91SAM7X512
# Enable FlashDL and FlashBPs
monitor flash download = 1
monitor flash breakpoints = 1
# Set gdb server to little endian
monitor endian little
# Set JTAG speed to 30 kHz
monitor speed 30
# Reset the chip to get to a known state.
monitor reset 8
monitor sleep 10
#
# Disable the watchdog and setup the PLL
#
# WDT_MR, disable watchdog
monitor writeu32 0xFFFFFD44 = 0x00008000
# CKGR_MOR
monitor writeu32 0xFFFFFC20 = 0x00000601
monitor sleep 10
# CKGR_PLLR
monitor writeu32 0xFFFFFC2C = 0x00480a0e
monitor sleep 10
# PMC_MCKR
monitor writeu32 0xFFFFFC30 = 0x00000007
monitor sleep 10
# PMC_IER
monitor writeu32 0xFFFFFF60 = 0x00480100
monitor sleep 100
# Set JTAG speed in khz
monitor speed 12000
load
break main
continue

It flashes correctly the microP, but it crashes at/after the branch instruction:

ldr lr, =main

in the boot.s file.
Some one can help me?

Thank you.

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gnello on November 4, 2009
Hi all and good morning :)
If someone have to give me any suggestion, thanks a lot, but for me is alse very useful to know if someone use the same confuguration used by me. It is:
IDE: ECLIPSE
COMPILER: GCC (Yagarto for win)
J-TAG: j-link Segger

Bye bye.

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gunutox on November 5, 2009
Hi!
Looks like I have the same problem :-(

The example from the yagarto (http://www.yagarto.de/download/yagarto/SAM7X256Test.zip) works with no problems (RAM and ROM)

The FreeRTOS demo ARM7_AT91SAM7X256_Eclipse makes trouble. Eclipse stops launching at 27%.
Eclipse Console:

...
load
Loading section startup, size 0x44 lma 0x100000
Loading section prog, size 0xe580 lma 0x100048
Loading section .data, size 0x868 lma 0x10e5c8
Loading section .eh_frame, size 0xa50 lma 0x20ad6c
Start address 0x106a00, load size 63612
Transfer rate: 27 KB/sec, 3534 bytes/write.
break main
Breakpoint 2 at 0x10074c: file main.c, line 168.
continue

J-Link Console:

...
Downloading 2640 bytes @ address 0x0020AD6C
Writing register (PC = 0x00106A00)
Setting breakpoint @ address 0x0010076E, Size = 2, BPHandle = 0x0001
Setting breakpoint @ address 0x0010074C, Size = 2, BPHandle = 0x0002
Starting target CPU...

If I try to debug with Insight I get the same error.

My Hardware:

- AT91SAM7X256-EK
- SAM-ICE (Segger JTAG)

My Software:

- Eclipse CDT
- Zylin Embedded CDT debug plugin
4.10.1
- yagarto-bu-2.19.1 (2009-10-18)
- FreeRTOS 6.0.0

Unfortunately I have no idea what’s going wrong.



RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gnello on November 5, 2009
Exactly !!! I have the same symptoms you describe!

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by Richard on November 5, 2009
Its a bit specific to the debug interface. Have you asked Zylin support?

Can you telnet into the debug interface, like you can with OpenOCD?

Regards.

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gunutox on November 5, 2009
Hm, don’t believe it’s a Zylin problem. If I debug with Insight the problem is the same. So Eclipse or Zylin can’t be the fault location.

I’m not sure. But I believe the Segger JTAG has no telnet interface.

Something else: I build the project without errors or warnings. But if I try to flash the device with J-Flash ARM (Segger) or SAM-BA (Atmel) both programmers tell me, the program doesn’t fit in the flash.


RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by Richard on November 5, 2009
All eclipse is doing is running a series of command line commands, and displaying the results in the IDE. It should be possible to run these commands from the command line yourself - outside of the IDE. That might provide you with better feedback.

I have seen Eclipse hang indefinitely at certain percentages before. From memory it was something to do with the path setup, in that there was something it could not find - but I would not like to tell you that was what the problem was in case it takes you off in the wrong direction.

If you have a project that works, and one that doesn't work I can only really suggest that you compare the compiler and linker options to see if the project that does work is adding something in that is assisting Eclipse.

I would also say that I have not used the Zylin tools in many years, have they been updated recently (within a year or two)? Also the Eclipse and CDT distributions on the Yagarto site used to be very, very, out of date. I have not looked recently so maybe this is no longer the case, but recent versions of Eclipse have their own cross debugging features rendering the Zylin plug-in obsolete. My information is probably out of date though!

Regards.

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gnello on November 5, 2009
I can give some information, if it is useful to someone ...
First problem is related to the crash at '27%'. The problem is that master clock and pll fall in fault due to the previous initialization given by j-link during flashing. Comparing source code of freertos-demo and yagarto-demo, I substitude the pll initialization

pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 5) |
(AT91C_CKGR_PLLCOUNT & (28<<8)) |
(AT91C_CKGR_MUL & (25<<16)));

whith

#define BOARD_USBDIV AT91C_CKGR_USBDIV_1
#define BOARD_CKGR_PLL AT91C_CKGR_OUT_0
#define BOARD_PLLCOUNT (16 << 8)
#define BOARD_MUL (AT91C_CKGR_MUL & (72 << 16))
#define BOARD_DIV (AT91C_CKGR_DIV & 14)

/* Initialize PLL at 96MHz (96.109) and USB clock to 48MHz */
pPMC->PMC_PLLR = BOARD_USBDIV | BOARD_CKGR_PLL | BOARD_PLLCOUNT
| BOARD_MUL | BOARD_DIV;

The second problem (the actual for me) is at the line

ldr lr, =main

in the boot.s file. At this jump, debugger crash ... I don't know why and I havo no more ideas :-(

Bye bye


RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gunutox on November 6, 2009
Good morning!

After I have adjusted the PLL configuration, the demo works! Debugging with Eclipse is also possible.

Thank you all for the support!

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gnello on November 6, 2009
Ok, perfect, I am very happy for you :-) , but I am sad for me :-(

I have the same problems too. One way to solve my problem could be to compare my project with yours. Could you send me by e-mail? So, if I find my problem then I can post solution for everyone.

Bye bye.

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gunutox on November 6, 2009
Please tell me your mail address and I will send you my project.

Regards

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by Richard on November 6, 2009
Posting mail addresses is fine - but please obfuscate them so robots can't pick them up. For example, write (at) instead of using the @ symbol, and [dot] instead of ' . '. Thanks.

Regards.

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by gnello on November 6, 2009
Following hints of our dear Richard :-)
here it is my address:

paolo.desii AT powersoft.it

Thank you,

bye bye

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by Farah Naz on April 26, 2012
Hiii....I am trying to debug a FreeRTOS example for uIP stack on AT91SAM7X-EK board.I am using Eclipse indigo,Ygarto tool and J-link debugger. I am able to compile my code without any errors but when i am debugging it ,launching process stops in between saying "Internal error occured during launching" .
I am nt able to solve this problem...may be sm settings are not proper for debugging...i am not able to fix it...I have changed the PLL initialization as suggested...den also same error is popping up...
If anybody could provide me any salution.....?

Thanks and regards

RE: Problem debugging with Eclipse+yagarto+J-LINK

Posted by Dave on April 30, 2012
This is a set up you have put together yourself, and there are too many variables to be able to offer any helpful advice without being there. This is not a freeRTOS question, but a tools set up question.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists