Saturday, November 19, 2011

Production Programming of Flash for FPGAs and MCUs...

This's from comp.arch.fpga-Google group ...
Experience/thoughts or answers of the members of the group  ..... 
1.
Someone on Linkedin asked about a stand alone device for programming 
the flash for FPGAs in the field or in a production environment. 
There doesn't seem to be anything currently available like this. 
Looking at the big three manufacturers I see at least two formats for 
the files that might be used.  Xilinx and Lattice use SVF with Xilins 
offering support for a compressed version called... XSVF of course. 
Altera uses JAM.  JAM seems to be a JEDEC standard while SVF appears 
to be a defacto industry standard developed by a company. 
I'm curious why two standards came about.  Was there a problem with 
using the version the company developed?  I'm assuming the industry 
version came first and the JEDEC version came later.  Or is that 
wrong?  It won't be too much trouble to support both, but I don't get 
why both standards exist. 
How do you program production devices?  I know in large facilities 
they pay big bucks for JTAG hardware and software that will work 
across the spectrum including test and diagnosis.  I'm thinking there 
is a market for a more limited device that is just used to program the 
non-volatile memory in embedded systems in an efficient manner for 
production and field upgrades.  Any thoughts? 



2.
Programming procedure for programming a bare at91sam9 board. 
1. Insert SD-Card 
2. Press reset 
3. Wait until LED blinks 
4. Remove SD-Card 
5. Press Reset 
    Application boots... 
Procedure for updating the linux kernel in a preprogrammed board. 
1. Connect board to host PC using USB. 
2. Reset the board in the USB Mass Storage mode. 
3. Wait until FAT partition window appears on the host PC. 
4. Clíck on the new kernel version, drag and drop it on the FAT window 
5. Reset the PC into normal linux boot sequence. 
 
3.
I know where I've been we always ended up building our own board with 
MCU on 
it for the production testing. Usually involving bit- 
banging(everything from JTAG to PCI) 
a bootloader or test program into the dut and programming a flash via 
uart/spi or 
something like that 
the code to be programmed was usually store on flash on the board, so 
unless you 
needed to add serial numbers and such it could be used standalone, 
just plug it into 
the dut and push the program button and done 
We did at one point try some jtag hw, but it could never really do 
what we wanted 

4.
IEEE 1532 is something that is a bit newer, I believe both xilinx and 
altera 
support it, not sure 'bout the others. http://grouper.ieee.org/groups/1532/ 
(we are primarily Xilinx users...) 
As for programming, it depends on the system.  These days we usually 
have a PC in the test fixture for all but the simplest of boards, so 
we use 
a Xilinx cable for the initial load.  We usually have the Xilinx part 
as a coprocessor 
with other devices, so even if the xilinx boots first, we have other 
devices that 
can do updates to the memory already on-board. 
Even if you don't have a CPU, it's not hard to put in a picoblaze core 
and do a 
loader to update a SPI flash via bit-banging.  You could probably do 
one with 
access to raw SD/MMC cards without too much trouble. 

5.
It depends on the devices in question. 
Many larger microcontrollers have a bootloader in ROM that you can use 
to program them over a serial link or perhaps USB.  Smaller 
microcontrollers can often be programmed easily using a JTAG or other 
debugging port, or an SPI-like interface (such as AVR devices). 
Typically that means using the manufacturer's own JTAG debuggers and 
software, but these are always far cheaper than the JTAG test equipment 
and software you describe. 
I have also used the JTAG or BDM port of bigger microcontrollers, 
combined with a cheap hardware interface and gdb, to script programming 
and testing setups.  For ARM devices you can use OpenOCD or Urjtag in a 
similar fashion. 
For devices that can boot from a serial flash, the easiest method is 
often to make these pins available on a header, along with the "boot 
mode" control pins for the device.  Then you can make a little card with 
a serial flash device that you plug into the board for initial bootup - 
this software can then test the board and program the real code into the 
main memory. 
If you have a serial flash on the board as the main memory, then you can 
have a similar header that lets an off-board device hold the processor 
or FPGA in reset while it programs the serial flash.  You can make such 
a device using an FTDI 2232H module and a few wires. 

6.
I try to stick with devices which can be programmed over a standard 
serial port. A programmer is nothing more than a USB to serial 
converter. Very convenient. 
If I need in system programming I use a standard programmer with a 
cable. IC socket to put in the programmer at one end, a special 
connector on the other end. 
In order to program large numbers of devices I once build a special 
rig with 8 Jtag and 8 serial ports. The devices to be programmed where 
designed to be plugged into this programmer. There is a lot you can do 
at the design stage to make programming easier & faster. A cheap 
device may cost more in the end if the programming takes more time & 
effort. Time is expensive in many places. 

No comments:

Post a Comment