EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Seeking JTAG emulator for Atmel AT91 ARM Cores on Linux

Started by Johnson August 18, 2010
Johnson wrote:

> Good point and than you for your reply. > > We designed our own board, JTAG and USB ports are in the board, No > Serial Port or Ethernet. I am going to run GDB server on the board, and > use GDB for debugging. The USB has to be connected to a peripheral > during the debug process, so basically only JTAG is available for > debugging, which is the main reason that I am asking around about the > possibility to debug the firmware with JTAG. > > Do you have any idea for my trouble? Thanks a lot.
I would use at least two test points for a serial connection, if you don't need all IO pins for your application. And even then maybe you should design in some 0 ohm resistors to use the serial port and disconnect the application side. When I helped developing the software for a similar platform, it was very useful to see the u-boot output, setting environment variables in u-boot over the serial port and watching the kernel messages after linux booted. But maybe there is a way for all this with JTAG, too. -- Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
Grant Edwards skrev 2010-08-19 05:43:
> On 2010-08-18, Johnson<gpsabove@yahoo.com> wrote: > >> We are porting a windows application from desktop into embedded Linux >> on Atmel AT91 ARM Cores, thus we need JTAG to debug the firmware >> under a Linux environment. However, SAM-ICE only connects via USB to >> a PC running Microsoft Windows2000 or XP. So I am looking for a JTAG >> emulator running on Linux. If you have any good idea/knowledge, could >> you please help? > > OpenOCD with a $50 FT2232 USB<->JTAG adapter worked fine with the SAM9 > parts when I tried it, but I never had a need to actually use it in > anger.
I would say that a good emulator would be useful when you debug the kernel. You can often develop an application on a Linux PC, and then port it to the ARM. This will give you native gdb/insight or whatever. Debugging an application is a pain, when dynamic libraries are used.
> > http://openocd.berlios.de/web/ > http://www.sparkfun.com/commerce/product_info.php?products_id=8278 > > [I've never tried the SAM-ICE -- I don't really "do" Windows.] > > You do know that while a JTAG adapter may be useful for > troubleshooting hardware and debugging the bootloader or Linux startup > code, it's pretty much useless for debugging applications? For > debugging applications, you run gdb-server on the target and gdb on > your development host. > > If you're using an Atmel SAM9 part, then I'd be surprised if you > really need to do hard-core debugging of a bootloader or Linux startup > code, since U-Boot and Linux are already ported and pretty much "just > work". > > [I don't know as much about the SAM7 parts running Linux.] > > FWIW, I did all my hardware troubleshooting and board bring-up using > the bootloader code that's in the AT91SAM9 masked ROM. It implements > commands to read/write memory (and therefore registers), and lets you > load small test programs into SRAM and run them. > > The protocol spoken by the ROM bootloader is trivial [it's documented > in the part's user's manual], and I wrote a small Python program to > send it various commands (read/write registers, etc.). > >> BTW, a friend of mine recommended YAGARTO toolchain for JTAG under >> Linux, is it the best solution so far? > > Never tried it. > > If money was no object, I'd go for the Zylin Z1000. > > http://www.zylin.com/zy1000.html
Gee, I thought that if money were no object, you'd go for a Lauterbach!
> > Abatron's BDI3000 is also nice but it doesn't talk GDB's remote > protocol directly the way the Z1000 does. With the BDI3000 you've got > to run a daemon to translate between BDI's protocol and GDB's > protocol. > > But, I couldn't really justify spending that kind of cash when the > Atmel ROM bootloader code did everything I needed to do to bring up > boards. >
-- Best Regards Ulf Samuelsson These are my own personal opinions, which may or may not be shared by my employer Atmel Nordic AB
On 2010-08-19, Johnson <gpsabove@yahoo.com> wrote:
> Good point and than you for your reply. > > We designed our own board, JTAG and USB ports are in the board, No > Serial Port
IMO, a big mistake. Access to the debug UART is immensly useful. All you need to put on the board is a three-pin header (tx, rx, gnd). Logic level to RS232 level can be handled in a adapter.
> or Ethernet. I am going to run GDB server on the board, and use GDB > for debugging. The USB has to be connected to a peripheral during the > debug process, so basically only JTAG is available for debugging, > which is the main reason that I am asking around about the > possibility to debug the firmware with JTAG. > > Do you have any idea for my trouble? Thanks a lot.
Why do you say "only JTAG is available for debugging?" If you're running gdb-server on the target, you can connect to it via Ethernet. -- Grant Edwards grant.b.edwards Yow! I threw up on my at window! gmail.com
On 2010-08-19, Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote:

> This looks pretty much tha same situation I was in. > > If you run JTAG via OpenOCD, it can serve as a GDB server, so there > is no need to have the server on target board.
Can such a setup be used to debug user-space application code? -- Grant Edwards grant.b.edwards Yow! Hey, waiter! I want at a NEW SHIRT and a PONY TAIL gmail.com with lemon sauce!
On 2010-08-19, Ulf Samuelsson <ulf@invalid.atmel.com> wrote:
> Grant Edwards skrev 2010-08-19 05:43: >> On 2010-08-18, Johnson<gpsabove@yahoo.com> wrote: >> >>> We are porting a windows application from desktop into embedded Linux >>> on Atmel AT91 ARM Cores, thus we need JTAG to debug the firmware >>> under a Linux environment. However, SAM-ICE only connects via USB to >>> a PC running Microsoft Windows2000 or XP. So I am looking for a JTAG >>> emulator running on Linux. If you have any good idea/knowledge, could >>> you please help? >> >> OpenOCD with a $50 FT2232 USB<->JTAG adapter worked fine with the >> SAM9 parts when I tried it, but I never had a need to actually use it >> in anger. > > I would say that a good emulator would be useful when you debug the > kernel. You can often develop an application on a Linux PC, and then > port it to the ARM. This will give you native gdb/insight or > whatever. > > Debugging an application is a pain, when dynamic libraries are used.
>>> BTW, a friend of mine recommended YAGARTO toolchain for JTAG under >>> Linux, is it the best solution so far? >> >> Never tried it. >> >> If money was no object, I'd go for the Zylin Z1000. >> >> http://www.zylin.com/zy1000.html > > Gee, I thought that if money were no object, you'd go for a > Lauterbach!
Sure, if I had a core with a trace interface (which I don't). -- Grant Edwards grant.b.edwards Yow! I want to mail a at bronzed artichoke to gmail.com Nicaragua!
On 19.8.10 9:58 , Grant Edwards wrote:
> On 2010-08-19, Tauno Voipio<tauno.voipio@notused.fi.invalid> wrote: > >> This looks pretty much tha same situation I was in. >> >> If you run JTAG via OpenOCD, it can serve as a GDB server, so there >> is no need to have the server on target board. > > Can such a setup be used to debug user-space application code? >
I guess that it will be difficult. My application was stand-alone code. The JTAG debug connection is for desperate situations. It understands hardware addresses, and with an enabled MMU, addressing can get challenging for the debugger. If you can run a kernel on the target, gdbserver and network connection is the way to go. -- Tauno Voipio tauno voipio (at) iki fi
On Aug 19, 2:02=A0pm, Tauno Voipio <tauno.voi...@notused.fi.invalid>
wrote:
> On 19.8.10 9:58 , Grant Edwards wrote: > > > On 2010-08-19, Tauno Voipio<tauno.voi...@notused.fi.invalid> =A0wrote: > > >> This looks pretty much tha same situation I was in. > > >> If you run JTAG via OpenOCD, it can serve as a GDB server, so there > >> is no need to have the server on target board. > > > Can such a setup be used to debug user-space application code? > > I guess that it will be difficult. My application > was stand-alone code. > > The JTAG debug connection is for desperate situations. > It understands hardware addresses, and with an enabled > MMU, addressing can get challenging for the debugger. > > If you can run a kernel on the target, gdbserver and > network connection is the way to go. > > -- > > Tauno Voipio > tauno voipio (at) iki fi
Thank you very much for sharing the knowledge! It is really my dream to use JTAG plus OpenOCD for all purpose: firmware download, boot load debugging, and application debugging. I certainly need to debug user-space application code, and I understand it is far from easy. If I tried not to use multi-threading in my application code, do you think it will make debug with JTAG + OpenOCD easier? BTW, is there any links/Application Notes for debugging with JTAG + OpenOCD?
On Aug 19, 12:58=A0pm, Grant Edwards <inva...@invalid.invalid> wrote:
> On 2010-08-19, Johnson <gpsab...@yahoo.com> wrote: > > > Good point and than you for your reply. > > > We designed our own board, JTAG and USB ports are in the board, No > > Serial Port > > IMO, a big mistake. =A0Access to the debug UART is immensly useful. =A0Al=
l
> you need to put on the board is a three-pin header (tx, rx, gnd). > Logic level to RS232 level can be handled in a adapter. =A0 > > > or Ethernet. I am going to run GDB server on the board, and use GDB > > for debugging. The USB has to be connected to a peripheral during the > > debug process, so basically only JTAG is available for debugging, > > which is the main reason that I am asking around about the > > possibility to debug the firmware with JTAG. > > > Do you have any idea for my trouble? Thanks a lot. > > Why do you say "only JTAG is available for debugging?" If you're > running gdb-server on the target, you can connect to it via Ethernet. > > -- > Grant Edwards =A0 =A0 =A0 =A0 =A0 =A0 =A0 grant.b.edwards =A0 =A0 =A0 =A0=
Yow! I threw up on my
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 at =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 window!
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gmail.com =A0=
=A0 =A0 =A0 =A0 =A0 Sorry no ethernet provided.
On Aug 19, 2:40=A0pm, Johnson <gpsab...@yahoo.com> wrote:
> On Aug 19, 2:02=A0pm, Tauno Voipio <tauno.voi...@notused.fi.invalid> > wrote: > > > > > > > On 19.8.10 9:58 , Grant Edwards wrote: > > > > On 2010-08-19, Tauno Voipio<tauno.voi...@notused.fi.invalid> =A0wrote=
:
> > > >> This looks pretty much tha same situation I was in. > > > >> If you run JTAG via OpenOCD, it can serve as a GDB server, so there > > >> is no need to have the server on target board. > > > > Can such a setup be used to debug user-space application code? > > > I guess that it will be difficult. My application > > was stand-alone code. > > > The JTAG debug connection is for desperate situations. > > It understands hardware addresses, and with an enabled > > MMU, addressing can get challenging for the debugger. > > > If you can run a kernel on the target, gdbserver and > > network connection is the way to go. > > > -- > > > Tauno Voipio > > tauno voipio (at) iki fi > > Thank you very much for sharing the knowledge! It is really my dream > to use JTAG plus OpenOCD for all purpose: firmware download, boot load > debugging, and application debugging. > > I certainly need to debug user-space application code, and I > understand it is far from easy. If I tried not to use multi-threading > in my application code, do you think it will make debug with JTAG + > OpenOCD easier? > > BTW, is there any links/Application Notes for debugging with JTAG + > OpenOCD?- Hide quoted text - > > - Show quoted text -
Basides of the two link that Grant Ed. provided at the top, I want more application notes and links.
On Aug 19, 12:58=A0pm, Grant Edwards <inva...@invalid.invalid> wrote:
> On 2010-08-19, Johnson <gpsab...@yahoo.com> wrote: > > > Good point and than you for your reply. > > > We designed our own board, JTAG and USB ports are in the board, No > > Serial Port > > IMO, a big mistake. =A0Access to the debug UART is immensly useful. =A0Al=
l
> you need to put on the board is a three-pin header (tx, rx, gnd). > Logic level to RS232 level can be handled in a adapter. =A0 > > > or Ethernet. I am going to run GDB server on the board, and use GDB > > for debugging. The USB has to be connected to a peripheral during the > > debug process, so basically only JTAG is available for debugging, > > which is the main reason that I am asking around about the > > possibility to debug the firmware with JTAG. > > > Do you have any idea for my trouble? Thanks a lot. > > Why do you say "only JTAG is available for debugging?" If you're > running gdb-server on the target, you can connect to it via Ethernet. > > -- > Grant Edwards =A0 =A0 =A0 =A0 =A0 =A0 =A0 grant.b.edwards =A0 =A0 =A0 =A0=
Yow! I threw up on my
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 at =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 window!
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gmail.com =A0=
=A0 =A0 =A0 =A0 =A0 If it is a mistake, I got to fix it. Is it a good idea for the USB firmware to generate one more virtual port for debugging (with GDB server)? The other virtual port will still be reserved for the peripheral.

Memfault Beyond the Launch