Using the usbWiggler

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Using the usbWiggler

7,113 次查看
bonzo
NXP Employee
NXP Employee

Recently, I had the opportunity to test the low cost USBWigger on a iMX51 EVK (Babbage Board).  I was hoping to overcome the need to purchase/beg/borrow an ARM RealView system as it costs several thousands of dollars.  The USBWiggler, on the other hand, retails at about $250.  A faster version, called USB2Demon, offers faster data transfer at a slightly higher cost.  Both units connect to the JTAG port of the EVK, and the other end connects to the host PC running Window.  In my case, I am using Windows XP SP3. 

 

So far, the device seems to work reasonably well.  It has some limitations, as will be explained later on.  I was able to connect and examine internal SRAM memory, view the ARM registers, single step, and run the code. 

 

The software that comes with the device is called OCD Commander.  It's written in Java.  It's not a full-featured debugger, but it does allow you to upload code or macro commands, so it should be able to bring up a bare-metal system, set the clocks, power management, DDR registers, etc. 

 

Sounds good, right?  But there are some issues you need to be aware of before using this.

 

You need to short one of the resistors on the EVK to let the Wiggler firmware sense voltage correctly.  The resistor is R341.  It's located on the top of the PCB between the JTAG connector and the small button battery.  I simply soldered a wire to short the resistor.

 

You need to boot up with Uboot or RedBoot.  This is the limitation I spoke of earlier.  With no bootloader present, the EVK will never "turn on".  I suspect this is because the internal boot ROM is not enabling the PMIC or does not disable the WDT, or something.  But whatever the bootloader is doing, it allows the burn to turn on and stay on.  Hopefully, I find a way to allow JTAG connections without first running a bootloader.

 

You need to configure the OCDCommander to talk with the JTAG logic inside the ARM.  In the case of the iMX51, you need to define "multiple devices."  When the OCD Commander Setup window appears, click the check box Multiple Devices.  then add the following three devices:

 

Index       Vendor                 CPU           IR Len         Bypass Op     DR Bypass Len


0            FREESCALE        iMX51x          -                     -                        -      

1            OtherJtagDevice      -                  4                   f                         1

2            FREESCALE        iMX_SJC        -                    -                         -


 

If you look in the help file under OcdCommander Configuration, you'll see how to set up for other ARM processors (such as iMX23, etc).

 

NOTE:  When you first apply power to the EVK or Wiggler, it won't boot.  I think the reason is that the Wiggler is holding the reset line.  To fix this, run one of the provided programs.  You can use OCDCommander, but you'll have to run it again.  I use USBDemon Finder.  Once you do this, the Wiggler should connect.

 

When you first turn on the EVK, and with Uboot or RedBoot started, disable the booting of Linux by using Ctrl-C from the terminal program to get the bootloader prompt.  Or change the bootloader script to stop at the prompt and not load the OS.

 

When you get the message, "Initialized target at speed1:  6 MHz", you are connected. 

 

At this point, click on the Halt button.  Once the processor is halted, you can view memory and registers.

 

For example, to view the first 100 16-bit values of internal SRAM, type the command,

half 0x1ffe0000 100

to run a ram test on the first 0x100 locations, issue the command:

ramtest 0x1ffe0000 0x100 2

Curisously, this test fails if you use a "4" instead of a "2", signifying that the test should run using 32-bit words.  I guess internal SRAM is x16.  Can anyone verify this?

0 项奖励
回复
14 回复数

4,370 次查看
Yogesh1z
Contributor I
I need quick advise on how to compile macro file and how to write into few i.MX515 registers. Say if I wish to make some GPIO 1 or 0 thru MACRO how to do it. Please advise asap. I dont have any boot loader.
0 项奖励
回复

4,370 次查看
JamesMacGregor
Contributor I

If you have downloaded our hardware support package 9.1 from : http://www.macraigor.com/Eclipse/index.htm

you can find an example project with a simple board setup gdbinit file at : 

    /usr/local/macraigor/EclipseDemos/Helios/ARM/Freescale_iMX53_LOCO. (linux) or

    c:\cygwin\usr\local\macraigor\EclipseDemos\Helios\ARM\Freescale_iMX53_LOCO (windows)

the readme in this directory goes through the build/download/run process step by step.

0 项奖励
回复

4,370 次查看
Chris1z
Contributor III

I am looking for a usbWiggler script for the iMX53 Quick Start board.  Anyone have one they would like to share? 

Thanks,

Chris

0 项奖励
回复

4,370 次查看
Yogesh1z
Contributor I

Hi Brad,

Thanks for your reply. I tried this as well for i.mx515. All these ways I tried.

Through USB OTG (Mini USB AB) also used to charge the battery. When we connect my laptop to board my laptop recoznizes i.MX as i.MX515TO2 in device driver information. So connectivity is fine I believe. Then by opening manufacturing tool I could see 4 USB section always monitoring for connection. But does not show any devices.

 

I am not sure how UART or JTAG is used with this manufacturing tool. UART is working fine and I could see some output of OBDS downloaded thru JTAG usbwiggler. Not really sure how I can program our NOR flash.

Brad Stewart said:

Try using the Manufacturing Tool, available on the download tab in the iMX515 page.  This supercedes the ATK.  It may support your Windbond SPI.



Yogesh said:

Hi,

We have our custom i.MX515 board with all similar peripherals but from diferent vendors. One of them is NOR flash from Winbond. (EVK has from ATMEL). Can anyone guide me how to program or is it possible to program NOR flash thru SPI using usbWiggler. I tried using ATK but it says wrong flash or incorrect flash which is anticipated.

I believe uboot.bin should be same for all i.MX515 with NOR flash (SPI interfaced with i.MX515)

 

0 项奖励
回复

4,370 次查看
bonzo
NXP Employee
NXP Employee

Try using the Manufacturing Tool, available on the download tab in the iMX515 page.  This supercedes the ATK.  It may support your Windbond SPI.



Yogesh said:

Hi,

We have our custom i.MX515 board with all similar peripherals but from diferent vendors. One of them is NOR flash from Winbond. (EVK has from ATMEL). Can anyone guide me how to program or is it possible to program NOR flash thru SPI using usbWiggler. I tried using ATK but it says wrong flash or incorrect flash which is anticipated.

I believe uboot.bin should be same for all i.MX515 with NOR flash (SPI interfaced with i.MX515)

 

0 项奖励
回复

4,370 次查看
JamesMacGregor
Contributor I


Marcus Choi said:

Wow... fast reply... thanks.

I don't use cygwin but ubuntu.  I have errors to install OCDremote...

 

include/linux/key.h:129: error: field 'sem' has incomplete type
make[4]: *** [/usr/local/macraigor/WinDriver/redist/wdusb_linux.o] Error 1
make[3]: *** [_module_/usr/local/macraigor/WinDriver/redist] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-2.6.32-28-generic'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/macraigor/WinDriver/redist'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/macraigor/WinDriver/redist'
make: *** [all] Error 2
dpkg: error processing mcgr-hwsupport (--install):
subprocess installed post-installation script returned error exit status 2
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
mcgr-hwsupport

 

Verify that you have installed the linux source on your system (via apt-get) before runlning the dpkg. 

See  the "http://macraigor.com/Eclipse/eclipse_faq.htm#mcgr DEB on Ubuntu" Eclipse FAQ answer

on our Eclipse  Helios web page for more information.

 

0 项奖励
回复

4,370 次查看
Yogesh1z
Contributor I

Hi,

We have our custom i.MX515 board with all similar peripherals but from diferent vendors. One of them is NOR flash from Winbond. (EVK has from ATMEL). Can anyone guide me how to program or is it possible to program NOR flash thru SPI using usbWiggler. I tried using ATK but it says wrong flash or incorrect flash which is anticipated.

I believe uboot.bin should be same for all i.MX515 with NOR flash (SPI interfaced with i.MX515)

0 项奖励
回复

4,370 次查看
marcus_c
Contributor I

Wow... fast reply... thanks.

I don't use cygwin but ubuntu.  I have errors to install OCDremote...

 

include/linux/key.h:129: error: field 'sem' has incomplete type
make[4]: *** [/usr/local/macraigor/WinDriver/redist/wdusb_linux.o] Error 1
make[3]: *** [_module_/usr/local/macraigor/WinDriver/redist] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-2.6.32-28-generic'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/macraigor/WinDriver/redist'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/macraigor/WinDriver/redist'
make: *** [all] Error 2
dpkg: error processing mcgr-hwsupport (--install):
subprocess installed post-installation script returned error exit status 2
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
mcgr-hwsupport

0 项奖励
回复

4,370 次查看
JamesMacGregor
Contributor I

In response:

I'm now wondering what I can do for actually debugging.

    If you don't want to use Eclipse, you can use arm-elf-gdb from the command line. The example iMX51_ADS

    project readme goes though how to do this.

 

Then what kinds of settings I should do for eclipse?

  After you install Ocdremote the director :

   c:/cywin/usr/local/macraigor/EclipseDemos/ARM/Freescale_iMX515_ADS

  contains an example Eclipse and/or gcc/gdb project with source, makefile, ldscript, readme, and gdbinit.

  The readme will tell you how to build and run the project on the iMX515_ADS board. You can then modify the

  example project Makefile, etc, to build and run your image.

  Our Eclipse FAQ page has a question/answer on how to clone/rename one of our example

  Eclipse/GNU projects to a new "your" Eclipse / gnu project.  

0 项奖励
回复

4,370 次查看
marcus_c
Contributor I

Hi, I'm a newbie here and macraigor jtag tools.

Using OCD commander, I can download u-boot and run throughout your article.  Thanks..

 

I'm now wondering what I can do for actually debugging.

macraigor website says to use eclipse.  I actually hate eclipse as my machine is very slow and it often shouts java errors.

 

Anyway,. I don't know what I should start now...

I downloaded eclipse c/c++ ide and created workspaces... set up arm toolchains and built... ... and I have a binary and srec code.

 

With built srec code, I can download it and run thru again OCD Commander.  Which means toolchains set up correctly.. :)

Then, what now? I wanna run it on eclipse so that I can break points and see reg status and etc.

 

I Downloaded Linux 32 OCDRemote v9.0 and trying to install it..

Then what kinds of settings I should do for eclipse?

Any instructions would be helpful for me..

0 项奖励
回复

4,370 次查看
JamesMacGregor
Contributor I
I believe because of the "post boot System JTAG Controller" setup required on this board to enable JTAG debug the OcdCommander/OcdRemote: Reset and ResetAndRun comands will put the board in a "JTAG debug disabled" state. You can simulate a reset by : 1) halting the CPU 2) setting the control reister to it's after reset value "reg control = 0x0c50078" 3) setting the PC to 0x0 From there you can run/step though the board's boot code. I assume you are using the correct OcdCommander setup parameters see OcdCommander Help->Contents: OcdCommander Configuration : Freescale iMX51x configuration settings and/or OcdRemote command line parameters see ...macraigor\EclipseDemos\Galileo\ARM\Freescale_iMX515ADS\readme The iMX51 has 3 devices on it's JTAG scan chain that have to be defined for these two utilities. You can also use the JTAGScanChainAnalyzer to view these devices. Do the people at Freescale have a jumper setting for this board that will enable immediate post boot JTAG debug ? Duc NGUYEN NGO said:
Hi Brad, it is really a nice article to start the usbWiggler with i.MX51 Eval Kit.

I cannot boot the kit after using USBDemon Finder.

Could you please tell me more detail how to boot this kit with usbWiggler.

Thank you
0 项奖励
回复

4,370 次查看
gaubuali01
Contributor III
Hi Brad, it is really a nice article to start the usbWiggler with i.MX51 Eval Kit. I cannot boot the kit after using USBDemon Finder. Could you please tell me more detail how to boot this kit with usbWiggler. Thank you
0 项奖励
回复

4,370 次查看
JamesMacGregor
Contributor I
The problem that caused ramtest 0xFFE00000 0x100 4 to fail on the iMX515 board in the OcdCommander has been fixed. The latest version is avaiable on our web site : http://www.macraigor.com/ocd_cmd.htm
0 项奖励
回复

4,370 次查看
bonzo
NXP Employee
NXP Employee
UPDATE!!! I am now able to completely get a bare metal iMX51 configured using the usbWiggler! No bootloader is required. Here is what you do. 1. Turn switch #10 on the EVK board. This bypasses the GPIO pin that enables the power supply which is normally controlled by the boot loader. As a result, the EVK will remain powered on. 2. Once you have the USBwiggler connected, run the attached macro file. It will set up the clocks and the DDR memory and run a short memory test. The macro file is in ASCII and contains valuable comments. I'd like to thank Gerry Vahe for all his contributions!
0 项奖励
回复