Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12604 Discussions

How to program a flash using a normal programmer

Altera_Forum
Honored Contributor II
1,556 Views

We have a project of Nios I, my question is when we produce this board, we should program the flash using a normal programmer before it is put on PCB.  

We use srec2flash and hex2flash to generate the .flash file, which contains boot_monitor commands, such as r0, e00xxx,.... 

How can we get the whole flash image file that we can program into flash directly? 

Thanks! 

hjia
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
344 Views

Since you your project is based on nios I, you can not use the flash programmer tool under nios II IDE where flash programming is much more easier. 

 

But even if you use nios I, you are not forced to program flash by using normal programmer. You can burn your hardware, software and other images to flash seperately by using RS232 UART. It's applicable in spite of slowness.  

 

Attention: You shall put the images to their appropriate locations.
0 Kudos
Altera_Forum
Honored Contributor II
344 Views

Yes, we are now using UART to program flash. 

But what I mean is to program the flash thru the Stand-alone Universal Device Programmer for mass production.  

This programmer is a hardware as Altera APU. 

.flash file is not a normal hexadecimal file which can be programmed by a programmer. 

Then how can I get a hex file from a .flash file for programming? 

Thanks! 

hjia
0 Kudos
Altera_Forum
Honored Contributor II
344 Views

Hi hjia, 

 

> We use srec2flash and hex2flash to generate the .flash file 

 

> But what I mean is to program the flash thru the Stand-alone Universal 

> Device Programmer for mass production. 

> This programmer is a hardware as Altera APU. 

> .flash file is not a normal hexadecimal file which can be programmed by 

> a programmer. 

 

What format do you require? Most programmers support SREC ... and 

you already have that format. 

 

> Then how can I get a hex file from a .flash file for programming? 

 

Are you referring to intel hex format? 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
344 Views

hjia, One idea, since you can program your plug-in flash using the uart, you could do that first and then remove the chip and read its contents in your universal programmer. You could then save the file in any format supported by the programmer.

0 Kudos
Altera_Forum
Honored Contributor II
344 Views

 

--- Quote Start ---  

originally posted by smcnutt@Jun 20 2005, 06:05 AM 

hi hjia, 

 

> we use srec2flash and hex2flash to generate the .flash file 

 

> but what i mean is to program the flash thru the stand-alone universal 

> device programmer for mass production. 

> this programmer is a hardware as altera apu. 

> .flash file is not a normal hexadecimal file which can be programmed by 

> a programmer. 

 

what format do you require? most programmers support srec ... and 

you already have that format. 

 

> then how can i get a hex file from a .flash file for programming? 

 

are you referring to intel hex format? 

 

regards, 

--scott 

--- Quote End ---  

 

Hi Scott, 

Can we only program the SREC to flash? I know that the .flash file has a boot command attached at the upside of .srec, which cannot be used by a programmer. 

If we only download .srec to flash, can Nios run at power up automatically? 

Also we have FPGA configure contents in this flash. SOF can be converted to HEX. 

 

Regards, 

Hjia
0 Kudos
Altera_Forum
Honored Contributor II
344 Views

Hi hjia, 

 

> the .flash file has a boot command attached at the upside of .srec 

> Also we have FPGA configure contents in this flash.  

 

Ok, I understand ... sounds like it's time to code up a utility ;-) 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
344 Views

> Ok, I understand ... sounds like it's time to code up a utility ;-) 

 

Duh, sorry ... the flash file is an srec. 

 

--Scott
0 Kudos
Reply