Home Live Radio Podcast Live TV Vodcast Forum Files Login Register :     Contact : 
 
Forum index Forum: Device: AudioTron Topic: Audiotron Firmware, bootloader, jtag and more Last replied to: June 24, 2010, 6:41 am Back to post view
AuthorPostOptions
Posted by penbex Message # 1     Posted at June 24, 2010, 6:36 am,     subject: Audiotron Firmware, bootloader, jtag and more  
Messages: 2265 posts
Registration date: May 21, 2009
Status: Offline

I found various interesting posts regarding the Audiotron hardware and firmware that I will re-post here so that the information does not get lost.

 
Posted by penbex Message # 2     Posted at June 24, 2010, 6:39 am,     subject: Audiotron Firmware, bootloader, jtag and more  
Messages: 2265 posts
Registration date: May 21, 2009
Status: Offline

Date: Tue, 25 Nov 2003 21:13:09 +0100 (CET)
From: Carsten Koester <carsten@ckoester.net>
Subject: Re: AT serial port

Hello all,

I had been contacted by Konrad as I have done a few experiments with the AudioTron before. This whole thing started off with the idea to run Linux on the AT, an idea on which I wanted to work during my free time, but I eventually found myself no longer having any free time, and never really continued on it. Anyway I can provide you with the information I already have, in case it turns out to be useful

Sorry for providing this information so late; I was travelling the last few weeks, and most of this stuff solely existed on a piece of paper on my desk somewhere

Hardware
========

Look at the open AT, with the LCD and buttons facing towards you. In the lower right corner of the mainboard, next to the pin header connecting to the LCD, you will find three unused pin headers (from left to right):

- A 2-pin jumper labelled JP7,
- a 20-pin header labelled JP5,
- a 10-pin header labelled JP6.

Apparently, on some boards the header in JP5 is no longer present, so you will find the empty pads on the board.

A quick look at these connectors, tested using a multimeter. With the exception of GND and VCC (3.3V), all pins connect directly to the Cirrus Logic EP7312 device.

- JP7 connects between GND and ping 155 (nBROM)

- JP6 pinout is as follows (JP6 pin# - function (EP7312 pin#))

1 - VCC
2 - PD[0]/LEDFLASH (62)
3 - PE[2]/CLKSEL (45)
4 - RXD[1] (36)
5 - RXD[2] (10)
6 - CTS (35)
7 - TXD[2] (9)
8 - TXD[1] (32)
9 - GND
10 - GND

- JP5 pinout is as follows (JP5 pin# - function (EP7312 pin#))

1,2 - VCC
4,6,8,10,11,12,14,16,18,20 - GND
17,19 - not connected (at least no connection I've found...
3 - nTRST (125)
5 - TDI (11)
7 - TMS (58)
9 - TLCK (90)
13 - TDO (22)
15 - nURESET (156)

For the complete details of each pin, please refer to the EP7312 data sheet and user manual,

http://www.cirrus.com/en/pubs/proDatasheet/EP7312-5.pdf
http://www.cirrus.com/en/pubs/manual/ep73xx_um-4.pdf

In short,

- JP7, if set during power-on, will cause the processor to boot from an internal boot ROM instead of booting from flash. See chapter 6 in the EP7312 user manual.

- JP5 is a JTAG interface (ref. chapter 14 in the EP7312 user interface). This, in a nutshell, allows you to perform debugging on the running
system: Examine memory, set break/watchpoints, .... For more generic information on JTAG, a google search for keywords such as "JTAG", "ARM", "GDB", ... (in any combination) will get you plenty of results. Leveraging this JTAG port to "reverse-engineer" how the AT control's it's display controller was on my to-do list, but I've never gotten that far.

- JP6 features the EP7312's two Serial interfaces.


Serial interfaces
=================

To connect to the two serial interfaces, all you need is RS-232 transceiver. I have used Maxim's MAX3232 device because it's easy to use (only needs a bunch of external capacitors), provides two ports, and can live with the 3.3V voltage conveniently supplied by the AudioTron board.

It is worth noticing that you most likely do not want to connect CTS to your Serial port. The BSQUARE loader which comes with the AT firmware (and is not to be confused with the EP7312's internal loader) uses this to enter a boot mode, so you probably want to connect this to a jumper against GND. More on this later.

Building a Serial port adaptor is *really* easy. Some quick info and datasheet for the MAX3232 are available at the following URLs:

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1068/ln/en
http://pdfserv.maxim-ic.com/en/ds/MAX3222-MAX3241.pdf

Attached to this email, there both an Eagle schematics file (uart.sch), as well as a JPEG, showing the adapter I was using. Note that only the upper part (JP1, JP3, IC1, C1, C3, C4, C5, C6) are relevant right now. The capacitors are all 0.1uF. The pinout is for a male DB-9 connector as I was using a null-modem cable; if you want to use a female connector (and straight-thru cable) or DB-25, the pinout differs accordingly.


Using the Serial port with the AT
=================================

Make sure to set your terminal program to NO FLOWCONTROL, 115200 bps, 8N1. Do not install a jumper on the AT JP7 or on the serial port CTS.  Connect to the UART1 port. Power on your AT on the back, and hit the power button in the front.

You should then receive a couple of diagnostic lines from the BSQUAT loader, as it copies itself to DRAM and de-compresses the actual audio firmware, followed by some "junk" which keeps popping up while the AudioTron runs.

If you change the serial port speed and mode to 38400 7E1, this "junk" decodes to Windows CE debugging output. Power cycle (by saying "power cycle", I generally mean the cycling the switch at the back, and then hitting the power-on button at the front again) the AT while at 38400/7E1 to see them all right from the start.

Now, set the jumper on the CTS pin, and set the terminal back to 115200/8N1. Power-cycle again.

Instead of booting all the way through, the AT will still load it's Windows CE loader from flash, but then come up with a menu that

- allows you to do a firmware download via Serial interface (xmodem)
- allows you to do a download via Ethernet, but apparently uses some proprietary prococol, haven't managed to get this working but didn't really try either
- perform a couple of tests
- read/write to memory
- and other stuff.

This bootloader is stored on the first 64k of flash, it is part of the firmware image, but apparently is NOT overwritten during the "normal" firmware upgrade process. If you corrupted your firmware during a failed upgrade but you still get this far, you can simply hit "0" in the menu, send the firmware file again via x-modem, power-cycle, and stop reading here

Finally, remove the jumper from the CTS port, set the jumper JP7 on the AT board, set you terminal client to 9600 bps/8N1 and power-cycle again. All you should see is a "<" character (and, unlike before, no output on the display at all), you are now in the EP7312's own ROM boot loader.

In this mode, the serial port 1 will be set to 9600 baud, it will print a "<" character, read exactly 2048 bytes of data, print a ">" character and then execute the previously read code. This way you to uploade your own bootloader that will further initialize and write to flash memory, and can be used if things had gone really wrong and even the first 64kB of flash memory had been erased.


Running your own boot loader
============================

Before you start: Grab a firmware image from the Turtle Beach site and extract the first 64k. On linux, this can be done something like

 $ cat atron30101.nb0 | head -b 64k > at-loader

and this will give you the bsquare loader that can be loaded from the first 64k of flash and then be used to restore the full audiotron image.

We will then need three pieces of software:

- a bootstrap loader/downloader. This is the small piece of software, no larger than 2kB, that has just enough functionality to erase the flash copy a bootloader onto it.

At that time, I had modified Mike Touloumtzis' "shoehorn" loader. The original can be found at

http://www.bluemug.com/~miket/arm/arm.html
http://www.bluemug.com/~miket/arm/shoehorn/

and I have a modified version that supports the AT's flash. More on this
later.

- a bootloader. This is either bsquare for Windows CE (the orig AT firmware), or something similar for Linux.

I had decided to start with U-Boot,

http://sourceforge.net/projects/u-boot/

as it already supports the ethernet chipset and the flash memory. It just needs an additional file to tell it which device can be found at what
memory location.

Again, more on that later.

- A linux kernel. Well, obviously, this is what we want to get running.


Shoehorn
========

Shoehorn was written for the EP7211 and it's evaluation board. The CPU core is the same, but the flash memory operates differently.

This bootloader's purpose is to erase the flash, receive the larger bootloader (~64k) from the serial port, and write them to flash. At the same time, this executable itself must not be larger than 2kB - therefore sophisticated features such as ethernet support, XModem protocol etc. are probably not feasible.

The flash memory used by the AT (mine, at least) is the SST39VF160.
Detailed info, data sheet, and even a driver sample code are available:

http://www.sst.com/products.xhtml/parallel_flash/39/x16/SST39VF160

I had incorporated this driver into shoehorn, a modified version is available at:

 http://www.ckoester.net/shoehorn-at.tar.gz

This location is likely to change, a more complete package and doc might follow. The serial protocol used by this loader is not particulary fast. It is sufficient, though, to upload either u-boot or the first 64k of the original atron image (which contain the atron's boot loader), which can then do the rest. If you get this working, you are in a position where you can "convert" your AT between experimenting with Linux and restoring the original firmware, and where you can recover even if the flash gets completely erased.


U-Boot
======

This is a boot-loader for linx. I had picked this one because it already supports the hardware and flash; other bootloaders are available.

The version I tested with was copied out of the CVS tree in June 2003, and it's probably not much point in sharing or further using that version. I will try to merge my changes into version 1.0.0 which is now available, but cannot promise to find time for that in the near future. In the meanwhile, if someone wants to try:

- untar the u-boot source from the sourceforge site
- create a new architecture in the "board/" directory, I have copied from the ep7312/ directory and then made my modifications.
- also create a new hardware include file in include/configs

Attached to this email, for reference, I have attached the files I believe I had modified at that time (u-boot-diffs.tar.gz). However, no guarantees that they are complete or that they will work against a recent U boot version. Best start from scratch and use these files as reference only. In the files, you CAN already look up some details that will be essential when getting the boot loader as well as the linux kernel modified:

- The MEMCFG, SYSCON, SDCONF, SDRFPR registers as they are set by the BSQUARE loader (I obtained these values by dumping the corresponding registers while in AT's loader), ref.  board/audiotron/memsetup.S;

- The layout and size of flash and DRAM memory (we seem to have two banks of 8mB DRAM each, so total 16mB, and that 39VF160 flash discussed earlier), their base addresses as visible to the processor can be seen in include/configs/audiotron.h;

- we have a CS8900 ethernet chip at address 0x30000000. I remember that I had some trouble with the register size (we have 16-bit registers, but aligned to 32 bit boundaries, I believe), so it might be crucical that you set CS8900_BUS32.. again, this is in include/configs/audiotron.h.

- As an additional piece of info, I seem to remember that the front-panel LEDs could be set by writing to 0x50000000. This location is a bit-map where each bit would represent one of the eight LED's: 1- power, 2- stop, 3- play, 4-pause, 5-random, 6-group, 7-mute, 8-repeat.


Linux
=====

Once u-boot (or another boot loader) is running again, you probably want to get the linux kernel booted next. This is where I gave up, I never got beyond initializing the memory map. I'm sure though that this is just a question of investing some time in it; in theory it should be possible to thet this working.

That's kinda all I remember or can find back for now. Again, no guarentees on anything, but maybe this info can help to avoid some duplicate work. I'll keep an eye on the email list and let you all know if I can remember something else

Regards,

-Carsten

--

Just because everything is different doesn't mean anything has
changed.
  -- Irene Peter
    [ Part 2, ""  Application/OCTET-STREAM (Name: "uart.jpg")  111KB. ]
    [ Unable to print this part. ]


    [ Part 3, ""  Application/OCTET-STREAM (Name: "uart.sch")  124KB. ]
    [ Unable to print this part. ]


    [ Part 4, ""  Application/OCTET-STREAM (Name: "u-boot-diffs.tar.gz")  ]
    [ 10KB. ]
    [ Unable to print this part. ]
 

 
Posted by penbex Message # 3     Posted at June 24, 2010, 6:40 am,     subject: Audiotron Firmware, bootloader, jtag and more  
Messages: 2265 posts
Registration date: May 21, 2009
Status: Offline

Date: Thu, 4 Dec 2003 23:48:18 +0100 (CET)
From: Carsten Koester <carsten@ckoester.net>
Subject: JTAG connector

Folks,

just to let you know... I have built the parallel JTAG dongle which was part of the schematics I sent around earlier, and hardware-wise, this seems to work...

Using the "jtag" tool from http://openwince.sourceforge.net/jtag/, I can then scan the jtag chain:


ckoester-nb2:~# jtag
JTAG Tools 0.5.1
[...]
jtag> cable parallel 0x378 WIGGLER
Initializing Macraigor Wiggler JTAG Cable on parallel port at 0x378
jtag> detect
IR length: 4
Chain length: 1
Device Id: 00001111000011110000111100001111
  Unknown manufacturer!
chain.c(110) Part 0 without active instruction
chain.c(133) Part 0 without active instruction
chain.c(110) Part 0 without active instruction
jtag>

The "Device ID" found, 00001111000011110000111100001111, matches the Device-ID shown in the EP73xx User's Guide, page 14-2.

This is completely and utterly useless at this moment, since the openwince JTAG tool does not support ARM720T processors (yet). When I find some time, I'll take a look if other open-source JTAG utilities work. Anyway, looks like the hardware passed the test

-Carsten
 

 
Posted by penbex Message # 4     Posted at June 24, 2010, 6:41 am,     subject: Audiotron Firmware, bootloader, jtag and more  
Messages: 2265 posts
Registration date: May 21, 2009
Status: Offline

Date: Tue, 13 Jan 2004 01:50:28 +0100 (CET)
From: Carsten Koester <carsten@ckoester.net>
Subject: U-Boot 1.0 and Linux kernel 2.6.0

Folks,

FYI, I've applied my previous u-Boot patches (which were back in June 2002 on a fairly outdated u-Boot version) to the latest CVS release, currently 1.0.2... and they still seem to work.

I will upload the latest diffs to my homepage (www.ckoester.net/audiotron) later today. Here's a step-by-step howto. This overlaps with what I sent before, but this time is more complete and includes examples

1.) Grab the shoehorn AudioTron hack from

  http://www.ckoester.net/audiotron/shoehorn-at.tar.gz

Shoehorn consists of a client-side loader (loader.bin) which receives a file from the serial port, erases the flash and writes the received file to flash; and a host-side utility which configures the serial port, waits for the "<" char, sends the beforementioned loader, waits for the ">" char and then sends the actual bootloader (uboot/bsquare) to the running
loader.bin.

2.) A compiled "loader.bin" is already included in the .tar file, and so is the host-side "shoehorn" utility (renamed to atron-dl). You can re-compile them if you like, just run "make".... NOTE: I used arm-linux-gcc v2.95.4 and binutils 2.12.90.0.1 for this, just in case


ckoester@ckoester-nb2:~/src/shoehorn-3.4$ make
arm-linux-gcc -Wall -fomit-frame-pointer -O2 -nostdlib \
        -Wl,-Ttext,0x10000000 -N init.S loader.c -o loader.elf
arm-linux-objcopy -O binary loader.elf loader.bin
cc -g -Wall    -c -o eth.o eth.c
cc -g -Wall    -c -o serial.o serial.c
cc -g -Wall    -c -o shoehorn.o shoehorn.c
cc -g -Wall    -c -o util.o util.c
rm -f .setuid.stamp
cc -g -o shoehorn eth.o serial.o shoehorn.o util.o
cc -g -Wall  -g -o atron-dl serial.c atron-dl.c util.c
ckoester@ckoester-nb2:~/src/shoehorn-3.4$ ls -l loader.bin atron-dl
-rwxr-xr-x    1 ckoester ckoester    55870 Jan 13 00:40 atron-dl
-rwxr-xr-x    1 ckoester ckoester     1344 Jan 13 00:40 loader.bin
ckoester@ckoester-nb2:~/src/shoehorn-3.4$

3.) Grab the u-Boot sources, either from www.sourceforge.net (v1.0.0) or from CVS (currently v1.0.2). Then, grab the following file:

  http://www.ckoester.net/audiotron/u-boot-1.0.2_diff.gz

Then, apply the patch, and build the u-boot loader for the "audiotron" platform.


ckoester@ckoester-nb2:~/tmp$ cvs
-d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/uboot login
ckoester@ckoester-nb2:~/tmp$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/u-boot co u-boot
cvs server: Updating u-boot
[...]
ckoester@ckoester-nb2:~/tmp/u-boot$ zcat ../../u-boot-1.0.2.diff.gz |
patch -p1
patching file MAKEALL
patching file Makefile
patching file board/audiotron/Makefile
patching file board/audiotron/audiotron.c
patching file board/audiotron/config.mk
patching file board/audiotron/flash.c
patching file board/audiotron/memsetup.S
patching file board/audiotron/u-boot.lds
patching file include/configs/audiotron.h
ckoester@ckoester-nb2:~/tmp/u-boot$ make audiotron_config
rm -f include/config.h include/config.mk
Configuring for audiotron board...
ckoester@ckoester-nb2:~/tmp/u-boot$ make
[...]
arm-linux-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
ckoester@ckoester-nb2:~/tmp/u-boot$ ls -l u-boot.bin
-rwxr-xr-x    1 ckoester ckoester   103092 Jan 13 01:11 u-boot.bin

4.) Use shoehorn to upload u-boot to the audiotron

Ping your running AudioTron and do an ARP lookup, or get the AT's MAC address via some other way. You will need it later!

Power off your AT, connect the serial port, set JP7, power on the AT (at the back).

Then, start atron-dl as shown below, and press the "power" button in the front. This will copy the u-boot binary to the AT flash.

BE AWARE: This erases your AT's flash. After this point, you will need either u-boot or shoehorn working if you want to recover your original TB firmware!


ckoester@ckoester-nb2:~/src/shoehorn-3.4$ ./atron-dl
--image=../../tmp/u-boot/u-boot.bin
loader.bin: 1344 bytes (2048 bytes buffer)
../../tmp/u-boot/u-boot.bin: 103092 bytes
Waiting for target - press Wakeup now.
Writing SRAM loader...
Pinging loader
Initialising Audiotron hardware:
- flushing cache/TLB
- 73MHz core clock
- 64kHz DRAM refresh
- enabling UART2
- Activate LED flasher
- Setting up flash at CS0 and CS1, 32 Bit, 3 Waitstates
Switching to 115200 baud
Pinging loader
Flash ID: 278200bf
Writing 103092 bytes (26 sector(s)) at starting address 70000000
Erasing...
26 sectors erased...
Writing...
102400 bytes written...
Switching back to 9600 baud
Pinging loader
ckoester@ckoester-nb2:~/src/shoehorn-3.4$

5.) Power off the AT, remove JP7, start your favorite terminal client (minicom or whatever), configure 9600bps 8N1, power on the AT, and press the front power button.

If you're lucky, you get to talk to u-Boot. Interrupt the start sequence by pressing any key.


U-Boot 1.0.2 (Jan 13 2004 - 01:11:15)

U-Boot code: C0F00000 -> C0F192B4  BSS: -> C0F1CBD8
RAM Configuration:
Bank #0: c0000000  8 MB
Bank #1: c0800000  8 MB
Flash:  2 MB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
AT #

6.) At this point, during development phase, I set up a TFTP server on my machine so I could tftpboot kernels while I go along, instead of having to update flash over and over again. You can do this by setting a number of environment variables (which u-Boot conveniently allows to store in flash).


AT # setenv ethaddr 11:22:33:44:55:66
AT # setenv ipaddr 10.61.224.172
AT # setenv netmask 255.255.255.248
AT # setenv serverip 10.61.97.156
AT # setenv gatewayip 10.61.224.170
AT # setenv bootfile uImage
AT # setenv bootcmd 'mw 50000000 00020000 ; tftp ; bootm'
AT # setenv bootargs 'console=ttyCL0 mem=16M'
AT # printenv
bootargs=devfs=mount root=ramfs console=ttyS0,9600
bootcmd=bootp;bootm
bootdelay=3
baudrate=9600
stdin=serial
stdout=serial
stderr=serial
ipaddr=10.61.224.172
netmask=255.255.255.248
serverip=10.61.97.156
gatewayip=10.61.224.170
bootfile=uImage
bootcmd=mw 50000000 00020000 ; tftp ; bootm
bootargs=console=ttyCL0 mem=16M
ethaddr=11:22:33:44:55:66

Environment size: 300/131068 bytes
AT # saveenv
Saving Environment to Flash...
Un-Protected 2 sectors
Erasing Flash...
Erasing sector 00020000
Erasing sector 00030000
 done
Erased 2 sectors
Writing to Flash... done
Protected 2 sectors
AT #

NOTE1: Obviously, the IP addresses etc. will need to change depending on
your setup. Use the MAC address you wrote down in step 4.) above.

NOTE2: The "mw 50000000 00020000" writes to the front panel LEDs and illuminates the "Stop" button. This has no practical use at this moment; prior to the LCD display and serial console working in the kernel, I am just using these LEDs as a method to "checkpoint" certain steps in the boot process to figure out where it's hanging

7.) Compile a linux kernel

This is the next big task... Today, I have just compiled a kernel for the EP7312 platform just to make sure the bootloader stuff is working (it gets as far as de-compressing the zImage but then hangs because none of the memory configuration is right). I have used kernel 2.6.0 with the arm-linux patches from www.arm.linux.org.uk and a plain configuration...
but again, this is worth nothing at this point.

NOTE: You will proably need a newer/different tool chain (compiler and binutils) than the previously mentioned ones to compile a 2.5.x or 2.6.x kernel...

Once compiled, copy the uImage to the /tftp directory and see what happens:

NOTE2: You can run "make uImage" to build an image suitable for u-Boot. For this to work, you need to copy the "mkimage" tool which got created in the tools/ directory when you compiled u-boot into a directory in $PATH so make can find it:


ckoester@ckoester-nb2:~$ cp ~/tmp/u-boot/tools/mkimage /usr/local/bin/
ckoester@ckoester-nb2:~/src/linux/linux-2.6.0$ make uImage
  CC      arch/arm/kernel/asm-offsets.s
  CHK     include/asm-arm/constants.h
[...]
  CHK     include/linux/compile.h
  Kernel: arch/arm/boot/zImage is ready
Image Name:   Linux-2.6.0-rmk2
Created:      Tue Jan 13 01:39:09 2004
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    705632 Bytes = 689.09 kB = 0.67 MB
Load Address: 0xC0028000
Entry Point:  0xC0028000
  Image arch/arm/boot/uImage is ready
ckoester@ckoester-nb2:~/src/linux/linux-2.6.0$
ckoester@ckoester-nb2:~/src/linux/linux-2.6.0$ cp arch/arm/boot/uImage /tftpboot/
ckoester@ckoester-nb2:~/src/linux/linux-2.6.0$ ls -l /tftpboot/uImage
-rw-r--r--    1 ckoester ckoester   705696 Jan 13 01:42 /tftpboot/uImage

(Back in the terminal client.. do not press any key and let the autoboot run

AT # reset


U-Boot 1.0.2 (Jan 13 2004 - 01:11:15)

U-Boot code: C0F00000 -> C0F192B4  BSS: -> C0F1CBD8
RAM Configuration:
Bank #0: c0000000  8 MB
Bank #1: c0800000  8 MB
Flash:  2 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
TFTP from server 10.61.97.156; our IP address is 10.61.224.172; sending through gateway 10.61.224.170
Filename 'uImage'.
Load address: 0xc0500000
Loading: #################################################################
         #################################################################
         ########
done
Bytes transferred = 705696 (ac4a0 hex)
## Booting image at c0500000 ...
   Image Name:   Linux-2.6.0-rmk2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    705632 Bytes = 689.1 kB
   Load Address: c0028000
   Entry Point:  c0028000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux................................................. done, booting the kernel.

This is as far as I got tonight. Unless somebody else is quicker, I will try to get a basic kernel running during the next few days/weeks, more to follow....

8.) Restoring the original AT firmware:

If u-boot is working, *theoretically* it should work like this: (Note... I haven't extensively tested this...)

8.1) Restoring the original AT firmware via u-Boot:


AT # tftp c0028000 atron30101.nb0
TFTP from server 10.61.97.156; our IP address is 10.61.224.172; sending
through
gateway 10.61.224.170
Filename 'atron30101.nb0'.
Load address: 0xc0028000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #######
done
Bytes transferred = 2031616 (1f0000 hex)
AT # protect off all
Un-Protect Flash Bank # 1
AT # erase all
Erase Flash Bank # 1
Erasing sector 00000000
[...]
Erasing sector 001f0000
 done
AT #
AT # cp c0028000 00000000 3e000
Copy to Flash... done
AT #

-> and power-cycle. You probably still need to set the MAC address as
below.

8.2) Restore the original AT firmware via shoehorn

This needs to be done if your u-Boot isn't working or the flash is completely empty. However, shoehorn and the quick loader.bin hack I've done are much too slow to upload the full image... so you want to upload the first 64kB, which are the BSQUARE loader, and then let them do the rest.

Set JP7...


ckoester@ckoester-nb2:~$ cat /tftpboot/atron30101.nb0 | head -c64k > /tmp/bsquare
ckoester@ckoester-nb2:~$ ls -l /tmp/bsquare
-rw-r--r--    1 ckoester ckoester    65536 Jan 13 02:06 /tmp/bsquare
ckoester@ckoester-nb2:~/src/shoehorn-3.4$ ./atron-dl --image=/tmp/bsquare
loader.bin: 1344 bytes (2048 bytes buffer)
/tmp/bsquare: 65536 bytes
Waiting for target - press Wakeup now.
[...]

and follow the procedure earlier.

Then remove JP7, but set the CTS jumper on your serial port card. Configure your terminal client to 115200bps, 8n1. Power-cycle and hit the front power button.

(In the terminal client):

+Processor Initialization Table read.
Copy  to RAM.
Copied to RAM.
+Processor Initialization Table read.
Costello is awake.

** BSQUATING Loader initializing. **

** LCD Init Complete. **
 *********************************************************************
 * 16MB       ATRON  V3.1 HW:v2  BSQUARE Loader for Costello         *
 * CE3.0 Enabled                                                     *
 *********************************************************************


 1]   Full Audiotron Test
 2]   Download Audiotron Firmware
 7]   Boot from Flash
 0]   Download over Serial (XModem)
 B]   Start Windows CE @ c0000000
 D]   Reset CE Registry
 E]   Set up Audiotron MAC address(s)
 N]   Full Menu
 Q]   Download over Ethernet

>> 2
>> Select Download Method
    1] Serial
    2] Ethernet
 ==>1
 REMEMBER: This only works with relocated images built with buildupdate v3.0

 Normal Boot; Saving Firmware to 0

 Select firmware file on PC
 Starting Xmodem Init
>>

then start the x-modem transfer....

When done, the loader will prompt you for the AT MAC address, and for a "Permissions" value.  So far I always just entered dummy values ("1" in both cases) here as I haven't figured out which format the tool likes the MAC address in and what the permissions are good for.

9.) REMARKS

Especially for the u-Boot part, I'd like to ask you all to intensively test this. My spontaneous impression was that the flash driver is still a little unstable, sometimes not correctly erasing sectors or sometimes writing corrupted data... This might be a timing condition that could possibly resolved by specifying larger values for

 #define CFG_FLASH_ERASE_TOUT
 #define CFG_FLASH_WRITE_TOUT

in include/configs/audiotron.h, but I haven't gotten around to testing this yet. Please let me know; once this thing is working stable, I'd like to submit the diffs back into the u-Boot release

Cheers,

-Carsten