Recover Broken NGW100 U-Boot With JTAG ICE MKII
May 23rd, 2009 by TheKidd
So as I mentioned, I attempted the flash method to update u-boot to the latest version. I got to the erase flash part of the instructions and I ended up getting a support call and had to run. Storm rolled through while I was gone and killed the power and, because it was down for more than an hour, the battery backup too. So I returned home to find a ‘dead’ NGW100 board.
Just to mention, there are three ways to perform a NGW100 U-Boot/Root FS update. They are as follows:
- Update through u-boot itself
- Update using Atmel’s flash-update program
- Update with the JTAG ICE MKII (which I will demonstrate)
- You can also update the root filesystem via SD Card, Network, Serial, or JTAG. I decided to use JTAG ICE to restore both U-Boot and the root filesystem.
For this exercise, I will be basing my walk through off of AVR Freak’s Wiki documentation. For other updating options, please refer to the Firmware Upgrade page on AVR Freak’s Wiki.
Notes
- U-Boot is stored in /dev/mtd0. Its partition is from 0×000000 - 0×01FFFF.
- Root Filesystem is stored in /dev/mtd1. Its partition is from 0×020000 - 0×7EFFFF.
- The U-Boot environment area (used for storing environmental variables for U-Boot) is located in /dev/mtd2. Its partition is from 0×7F0000 - 0×7FFFFF.
- Usr Filesystem is stored in /dev/mtd3.
- If you have an old root image. Do not worry if the system light blinks red after updating. The code in the kernel has changed to represent a cpu heartbeat and is normal.
After purchasing the JTAG ICE MKII and after setting up Ubuntu with a AVR32 development environment, I did the following to replace u-boot.
Prepare NGW100 For JTAG ICE Restore
- Remove power to the NGW100 board.
- Connect the JTAG ICE MKII to power and connect a USB cable between Linux and the programmer.
- Make sure the JTAG ICE power is off. Now connect the JTAG connector to the NGW100 (I’ve included a picture above with the correct way to plug the connector into the NGW100.
- Now power the JTAG ICE device. If you check /var/log/messages on your Linux box, you should see that your system detected the JTAG programmer.
- Now apply power to the NGW100.
- Go to atmel.no/buildroot/binaries and pick the latest version. I downloaded the following files from version 2.3.0: u-boot.bin and root.avr32.jffs2-root.
- Next we restore u-boot with the JTAG ICE
Use JTAG ICE To Flash U-Boot and Root On The NGW100
- First we erase the entire flash of the NGW100 board with sudo avr32program erase -fcfi@0 to ensure the board is clear.
- Now we flash the u-boot image onto the NGW100 board with sudo avr32program program -F bin -vfcfi@0 u-boot.bin.
- Now we flash the root image onto mtd1 with sudo avr32program program -F bin -vfcfi@0 -O 0×20000 root.avr32.jffs2-root.
- All done! Unplug the power from the NGW100 and turn off the JTAG ICE MKII.
- Disconnect the JTAG connector from the NGW100.
- Plug in your NGW100 board and watch it fly.
Note: The first time I tried to boot the root filesystem, I got some unexpected errors. For more information check here.
That is how you use a JTAG ICE MKII to restore/upgrade/install a fresh u-boot and root image onto your Atmel NGW100 board. You can also use TFTP to load a root image or you can move on to loading the usr filesystem.
Hi!
thanx for the manual!
But what about flashing the /usr partition? I mean the rootfs.avr32.jffs2-usr file.
Regards,
Denis