Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

How to program a flash using a normal programmer

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

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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

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

    --Scott