EmbDev.net

Forum: ARM programming with GCC/GNU tools insight does not debu on openocd, plus helloworld example


von Zohair A. (zohair)


Rate this post
useful
not useful
Hi,
I am trying to compile and run the Helloworld example in the WinARM
archive. I've modified it to run on my Olimex AT91SAM7P64 board. The
program blinks an LED every time it sends a packet. this LED is
constantly blinking all the time, but I receive no data on the
terminal.exe program,( and neither on hyperterminal). Am I doing
something wrong? These are my terminal settings.
baud = 115200, parity none, stop bit 1, 8 characters. And handshaking
set to none.
Also, if I set the US_MR register for normal mode, is this a test mode?
as given on AT91SAM7s' datasheet pg 328 (section 31.6.8). And would this
effect my output?
I tried to debug it using JTAG with insight. (the simulator straightaway
crashes). I used openocd to connect to the target(through
GDBServer/TCP). The connection goes well, but I can't seem to add any
breakpoints to the code. Doing so, causes the PC to go to a very high
value and the code refuses to run. How do I add breakpoints while I am
running openocd?

von Martin Thomas (Guest)


Rate this post
useful
not useful
Zohair Ahmad wrote:
> I am trying to compile and run the Helloworld example in the WinARM
> archive. I've modified it to run on my Olimex AT91SAM7P64 board. The
> program blinks an LED every time it sends a packet. this LED is
> constantly blinking all the time, but I receive no data on the
> terminal.exe program,( and neither on hyperterminal). Am I doing
> something wrong? These are my terminal settings.
> baud = 115200, parity none, stop bit 1, 8 characters. And handshaking
> set to none.

If you are using the example at91sam7s64_Hello (please give the exact
name of the directory or archive): It sends/receives from/to UART0. It
does not blink on any received package. At least one of the LEDs is a
"I'm alive"-sign which blinks all the time. Did you check that the PC is
connected to the correct UART? IRC there are also jumpers on the
OX-Board to select which ARM-UART is connected to the RS232
level-shifter. Verify that this connection is correct. Your RS232
settings on the PC-side should be correct.

> Also, if I set the US_MR register for normal mode, is this a test mode?
> as given on AT91SAM7s' datasheet pg 328 (section 31.6.8). And would this
> effect my output?

I don't think so.

> I tried to debug it using JTAG with insight. (the simulator straightaway
> crashes). I used openocd to connect to the target(through
> GDBServer/TCP). The connection goes well, but I can't seem to add any
> breakpoints to the code. Doing so, causes the PC to go to a very high
> value and the code refuses to run. How do I add breakpoints while I am
> running openocd?

Sorry, I can not tell you much about debugging with insight and openocd.
Maybe another forum-reader can help here.

Martin Thomas

von outer_space (Guest)


Rate this post
useful
not useful
Zohair Ahmad wrote:
> Hi,
> I am trying to compile and run the Helloworld example in the WinARM
> archive. I've modified it to run on my Olimex AT91SAM7P64 board. The
> program blinks an LED every time it sends a packet. this LED is
> constantly blinking all the time, but I receive no data on the
> terminal.exe program,( and neither on hyperterminal). Am I doing
> something wrong? These are my terminal settings.
> baud = 115200, parity none, stop bit 1, 8 characters. And handshaking
> set to none.
> Also, if I set the US_MR register for normal mode, is this a test mode?
> as given on AT91SAM7s' datasheet pg 328 (section 31.6.8). And would this
> effect my output?
> I tried to debug it using JTAG with insight. (the simulator straightaway
> crashes). I used openocd to connect to the target(through
> GDBServer/TCP). The connection goes well, but I can't seem to add any
> breakpoints to the code. Doing so, causes the PC to go to a very high
> value and the code refuses to run. How do I add breakpoints while I am
> running openocd?

Some olimex SAM7S64 boards have a 12MHz crystal while others have a
18.xx one.  If yours is 12MHz make sure you adjust the mult and div bits
of the pll control register.

von Zohair A. (zohair)


Rate this post
useful
not useful
I found the solution to the openocd problem. The site is down right now,
so I'll post it later.
The blinking in the code is a modification I made so that I would know
whether the usart is sending or not. COde will be atatched later/
>Did you check that the PC is
>connected to the correct UART?
If you are talking about the Debug/USART jumper, it is in the USART
position.

von Zohair A. (zohair)


Rate this post
useful
not useful
Zohair Ahmad wrote:
> I found the solution to the openocd problem. The site is down right now,
> so I'll post it later.
http://openfacts.berlios.de/index-en.phtml?title=OpenOCD_FAQ
>Q: I'm trying to set a breakpoint using GDB (or a frontend like Insight or 
>Eclipse), but OpenOCD complains that "Info: arm7_9_common.c:213 
>arm7_9_add_breakpoint(): sw breakpoint requested, but software breakpoints not 
>enabled".
>Q: I'm trying to single-step using GDB (or a frontend like Insight or Eclipse), 
>but OpenOCD complains that "Info: arm7_9_common.c:213 arm7_9_add_breakpoint(): sw 
>breakpoint requested, but software breakpoints not enabled".
>A: GDB issues software breakpoints when a normal breakpoint is requested, or to 
>implement source-line single-stepping. On ARMv4T systems, like ARM7TDMI, ARM720t 
>or ARM920t, software breakpoints consume one of the two available hardware 
>breakpoints, and are therefor disabled by default. If your code is running from 
>RAM, you can enable software breakpoints with the "arm7_9 sw_bkpts enable" 
>command. If your code resides in Flash, you can't use software breakpoints, but 
>you can force OpenOCD to use hardware breakpoints instead: "arm7_9 force_hw_bkpts 
>enable".

> The blinking in the code is a modification I made so that I would know
> whether the usart is sending or not. COde will be atatched later/
It was actually already in the code

>n = pPIO->PIO_PDSR;                   /* Read Pin Data */
>if (/*(n & SW1) == 0*/1) {                /* Check if SW1 is pressed */
>  pPIO->PIO_CODR = LED1;                /* Turn On LED1 */
>  iprintf ("Hello World !\n");          /* Print "Hello World !" */
>  wait(100);                            /* Wait 100ms */
>  pPIO->PIO_SODR = LED1;                /* Turn Off LED1 */
>  wait(100);                            /* Wait 100ms */
>  }

I merely modified the definitions for the LEDs to use the ones on the
Olimex board. I also changed the if statement to make it work everytime.

Also, I see that this example is using iprintf. I could not find the
exact funtion's source though. Can anyone tell me if it actually does
print to the USART?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.