Forum Discussion

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

Debugging the „Flash Programmer“ of 5.1?

Hello community,

There have been a lot of topics about the flash programmer. Every time I wondered why so many people have problems with their flash device. Now I have some problems too. I’m using a flash from ST which isn’t compatible with the Altera HAL drivers. After debugging and adding some flash reset functions it is possible to program the flash with the normal HAL commands like “alt_write_flash_block”. But the flash programme doesn’t work. Now I would like to debug the flash programmer. Is this possible? Where are the sources of the flash programmer? I think that the flash programmer is using the HAL driver too. So I think that if the standard functions are working the flash programmer should work too.

Regards,

niosIIuser

4 Replies

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

    The flash programmer does not use the HAL functions. Getting things to work in the HAL and in the flash programmer are separate steps.

    In general, more devices should be supported, using the flash programmer. Have you tried any of the override functionality provided by the Nios II Flash Programmer (detailed in the user's guide)?

    Best Regards,

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

    Ya, look at the spec for your chip, and the spec for one of the AMD CHips it supports - if the programming algorithm is the same, you can setup an override so that the nios2-flash-programmer ignores the device code and tries to program it anyway. IF the algorithms aren&#39;t compatible, you will have to write your own code - I tried to get the sources for the flash programmer, and they aren&#39;t readily available http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif

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

    Hello slacker and jdhar,

    Thank you for your replies. I feared about the fact that the flash programmer isn’t using HAL. Until now I didn’t tested the override functionality. I will do this as soon as possible. The program-, erase-, … algorithms of the used flash are identical with the specification of an AMD flash. After debugging I figured out that the HAL doesn’t identify the correct width of the device. So first I changed the code for the identification. After that there was another problem with the flash. After the identification process the flash isn’t in the normal read mode. To bring the device in this mode a reset command is necessary. I hope these changes can be done with the override functions.

    Regards,

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

    Hello,

    Using the width mode override parameter was successful. It is now possible to program the flash. Unfortunately the width mode parameter can only be used in the command line. I hope Altera will include this function in the GUI version of the flash programmer.

    Thank you for the support,

    niosIIuser