Code for programming Flash memory

L

lyndonamsdon

Hi there,

I've got a Xilinx Spartan dev board, that has an onboard Atmel Flash
memory chip (AT49BV040A). It can't be removed from the board, and is
programmed in a parrallel, byte by byte (ie not a seriel protocol).

Are there any existing chunks of VHDL for programming the Flash chip
via something like an RS232 interface? Does anyone have one for some
other development board that I could hack to work?

I'd like to program all of the chip in one go, from a bin file. I've
been searching the groups/web for some time now, and not much is
showing up.

Any ideas would be much appreciated. Thanks
 
G

ghelbig

Hi there,

I've got a Xilinx Spartan dev board, that has an onboard Atmel Flash
memory chip (AT49BV040A). It can't be removed from the board, and is
programmed in a parrallel, byte by byte (ie not a seriel protocol).

Are there any existing chunks of VHDL for programming the Flash chip
via something like an RS232 interface? Does anyone have one for some
other development board that I could hack to work?

I'd like to program all of the chip in one go, from a bin file. I've
been searching the groups/web for some time now, and not much is
showing up.

Any ideas would be much appreciated. Thanks

Your best bet would be to program it in 'C', not VHDL.

Build a PicoBlaze (or PacoBlaze) system, and port "just about any"
flash writing program.

G.
 
S

Shannon

Your best bet would be to program it in 'C', not VHDL.

Build a PicoBlaze (or PacoBlaze) system, and port "just about any"
flash writing program.

G.

Huh? If I understand the OP he wants to program the Flash part
through the Spartan chip. He's (I think) looking for some VHDL code
that would take in RS232 and spit out the right protocol to stuff the
flash part. How in the world is a 'C' program going to help? Is
there a 'C' compliler out there for logic code???? Good gawd why am I
wasting my time with VHDL!

Shannon
 
M

Mike Treseler

Shannon said:
Huh? If I understand the OP he wants to program the Flash part
through the Spartan chip. He's (I think) looking for some VHDL code
that would take in RS232 and spit out the right protocol to stuff the
flash part. How in the world is a 'C' program going to help?

If the flash is not used to store the fpga image,
it is plausible that a soft core processor entity
could run a C program to bit-bang a flash programming
routine. Depends how the board is wired up.

-- Mike Treseler
 
S

Shannon

If the flash is not used to store the fpga image,
it is plausible that a soft core processor entity
could run a C program to bit-bang a flash programming
routine. Depends how the board is wired up.

-- Mike Treseler

Wacky!
 
G

ghelbig


Definitely not wacky. That's how all of the NIOS (I & II) boards made
by Altera program their flash. I would be surprised if Xilinx boards
were different.

Note to Mike: If the flash -was- used to store the FPGA image, then
the RTL to program the flash would be much harder, eh?

G.
 
M

Mike Treseler

Definitely not wacky. That's how all of the NIOS (I & II) boards made
by Altera program their flash. I would be surprised if Xilinx boards
were different.

Note to Mike: If the flash -was- used to store the FPGA image, then
the RTL to program the flash would be much harder, eh?

Yes, each chicken needs an egg.
Some flash or cpld has to be either
preprogrammed or programmable by
an external host.

-- Mike Treseler
 
P

Patrick Dubois

Hi there,

I've got a Xilinx Spartan dev board, that has an onboard Atmel Flash
memory chip (AT49BV040A). It can't be removed from the board, and is
programmed in a parrallel, byte by byte (ie not a seriel protocol).

Are there any existing chunks of VHDL for programming the Flash chip
via something like an RS232 interface? Does anyone have one for some
other development board that I could hack to work?

I'd like to program all of the chip in one go, from a bin file. I've
been searching the groups/web for some time now, and not much is
showing up.

Any ideas would be much appreciated. Thanks

I think that the easiest way would be to use EDK with Microblaze to
program the flash. If you're lucky your board will come with a bsb
file (www.xilinx.com/ise/embedded/edk_bsb.htm), which can be used by
the EDK wizard to create a design without you having to write a single
line of code (VHDL or C).

Basically you use the wizard to build a system with Microblaze and the
flash interface. Then you use the menu item "Device Configuration/
Program Flash Memory". You will be asked for a bin file to load in
flash. The data will be transfered through the jtag interface and
programmed on the flash (with the application "flashwriter" running on
the Microblaze, which will all be done automatically for you).

To verify that the data was written properly, you can use the command
mrd in the debugger (XMD).

I did this recently to show a coworker this way to program a flash and
we were done in about 30 minutes (the board was from Avnet and had a
bsb file available).


Cheers,
Patrick
 
L

lyndonamsdon

I think that the easiest way would be to use EDK with Microblaze to
program the flash. If you're lucky your board will come with a bsb
file (www.xilinx.com/ise/embedded/edk_bsb.htm), which can be used by
the EDK wizard to create a design without you having to write a single
line of code (VHDL or C).

Basically you use the wizard to build a system with Microblaze and the
flash interface. Then you use the menu item "Device Configuration/
Program Flash Memory". You will be asked for a bin file to load in
flash. The data will be transfered through the jtag interface and
programmed on the flash (with the application "flashwriter" running on
the Microblaze, which will all be done automatically for you).

To verify that the data was written properly, you can use the command
mrd in the debugger (XMD).

I did this recently to show a coworker this way to program a flash and
we were done in about 30 minutes (the board was from Avnet and had a
bsb file available).

Cheers,
Patrick


Thanks for the responses. I should have been a bit clearer about the
use of Flash, it is just for storing data, not to use for programming
the Xilinx configuration on power up.

I will have a look into Patricks idea, but it seems my board vendor
(Enterpoint) doesn't have a BSB. I'm quite new to this kind of area,
so will read up about EDK.

The other possibility I found, also from Xilinx is this
http://www.xilinx.com/products/boards/s3astarter/files/s3ask_parallel_flash_programmer.pdf
Its a Flash programmer in VHDL with communications via RS232, which
seems ideal! That based on a picoblaze core and tiny uart.

Thanks for the help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top