Skip to main content.

STX/Freescale ADS5121 Board

Incorrect ALE timings

Problem:
[CPU Rev. 2: PVR 0x80862010, SVR 0x80180020] Attempts to program the flash memory (including for example using the "saveenv" command) fail silently: the code that gets written to flash is corrupted.
This also applies for attempts to program the flash memory using a JTAG debugger like the Abatron BDI3000.
Solution:
The problem is caused by incorrect (for this CPU revision) ALE timing for the CS0 and CS2 chip selects. The problem is fixed by U-Boot version v1.3.4-254-g8a49042 (git commit ID 8a490422bed6, released Thu Aug 28 13:17:07 2008) or later.
Workaround:
To fix the problem temporarily (i. e. until the next reset of the board) you can use the following command in U-Boot:
ALERT! Make sure to type the commands exactly as listed here!
=> mw 0x80010034 5
For a permanent fix, run the following commands in U-Boot:
=> mw 0x80010034 5
=> setenv preboot 'mw 0x80010034 5;echo;echo Type \\"run flash_nfs\\" to mount root filesystem over NFS;echo'
=> saveenv
=> saveenv

To enable flash programming with the BDI2000/3000 JTAG debuggers, please make sure that the "[INIT]" section of your BDI config file contains the line
WM32    0x80010034      0x0000005       ;ALE Timing for CS0 and CS2
Fixed:
on all boards shipping 03 Sep 2008 or later

Update U-Boot Image in Backup Flash

ALERT! Note: The following actions are dangerous. You might brick your board if you make mistakes. Please do not continue unless you know exactly what you are doing.
Problem:
You want to install a more recent version of U-Boot in the backup flash which shall be loaded to the main flash when you run the automatic recovery procedure.
Solution:
power off the board, install (close) the backup jumper at P4, then power on again; interrupt the autoboot sequence by hitting a key while the count-down is running. Then enter the following commands:
=> tftp 200000 ads5121/u-boot.bin
=> erase ${u-boot_mn_addr} +${filesize}
=> cp.b 200000 ${u-boot_mn_addr} ${filesize}
Then power off the board, remove (open) the backup jumper at P4, then power on again.
Problem:
You want to install a more recent version of U-Boot in the backup flash which shall be run when you boot from the backup flash.
ALERT! Note: this is a critical operation. Think twice if you really know what you are doing.
Solution:
power off the board, install (close) the backup jumper at P4, then power on again; interrupt the autoboot sequence by hitting a key while the count-down is running. Then enter the following commands:
=> tftp 200000 ads5121/u-boot.bin
=> protect off FFF00000 +${filesize}
=> erase FFF00000 +${filesize}
=> cp.b 200000 FFF00000 ${filesize}
Then power off the board, remove (open) the backup jumper at P4, then power on again.

Update CPLD Code

Problem:
In some rare cases it may be necessary or advisable to update the CPLD code on the board. New versions of the CPLD code are available from the STX download page.
ALERT! WARNING: this is a critical operation; you may damage your hardware!
Think twice if you really know what you are doing.
Requirements:
You need a JTAG programmer like the ByteBlaster II or ByteBlaster MV to program the CPLD. Please contact DENX Computer Systems GmbH if you need one.
Preparations:
We need software to control the JTAG programmer, a BSDL description file for the CPLD used on the ADS5121 board, and the CPLD code (in Serial Vector Format).
  1. Download and install the UrJTAG Universal JTAG Library, Server and Tools package:
    $ cd /usr/local/src
    $ wget http://ovh.dl.sourceforge.net/sourceforge/urjtag/urjtag-0.9.tar.gz
    $ tar -zxf urjtag-0.9.tar.gz
    $ cd urjtag-0.9
    $ ./configure
    $ make
    $ sudo make install
    
  2. Download the BSDL description file for the Altera EPM570F256 CPLD:
    $ cd /tmp
    $ wget ftp://ftp.altera.com/outgoing/download/bsdl/EPM570F256.BSD
    $ sudo mkdir -p /usr/local/share/urjtag/altera/epm570f256
    $ sudo mv EPM570F256.BSD /usr/local/share/urjtag/altera/epm570f256/
    
  3. Download the CPLD code from the STX download page. Note that this file comes in POF ( Programmer Object Format), but for the UrJTAG tool we need it in SVF (Serial Vector Format). You can convert POF into SVF if you have access to the Altera tools. Alternatively, you can download the SVF-file from the DENX web page:
    $ cd /tmp
    $ wget http://www.denx.de/wiki/pub/DULG/FaqADS5121/ADS5121e_05_cpld_p1.svf
    
  4. Plug the connector of the ByteBlaster on connector P5 of your ADS5121 like this:
    How to connect the Byteblaster
Solution:
Now we can program the CPLD with the new code:
$ sudo jtag
jtag> cable ByteBlaster parallel 0x378
jtag> bsdl path /usr/local/share/urjtag/altera/epm570f256
jtag> detect
jtag> print
jtag> part 0
jtag> svf /tmp/ADS5121e_05_cpld_p1.svf progress
jtag> quit
Programming will take about 2 minutes. You can safely ignore the ``unimplemented mode 'ABSENT' for TRST'' message.