Forum Discussion

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

alt_write_flash ERROR CODES

Trying to use alt_flash_open_dev() and alt_write_flash() and alt_read_flash().

alt_flash_open_dev() is successful but alt_write_flash returns

an ERROR CODE = ffffff8c. Anyone knows what this refers to?

Is there a list of error codes for these functions - I don't see in any documentation.

Or alternatively, what could be going wrong.

alt_read_flash() returns without error - have not analyzed the data thoroughly

but looks like some CFI table data like the NIOS programmer spat out.

I have used the NIOS flash programmer and it successfully programs and checks

an arbitrary binary file I have - no warnings or errors in the console(all looks good).

Call looks like this...

alt_write_flash(fd_ptr, 0, ptr_to_src_data, 4);

Vista, Quartus 9.1, Arria II GX.

Thoughts?

Thanks,

Cos

4 Replies

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

    Lotsa views but no replies. Hmmm.

    I have run the memtest project and it also fails at the alt_flash_write with the

    same error code but again it _seems_ that the NIOS programmer works but I do

    not know how it works so I cannot debug this way.

    I presume the programmer would write/read/verify so I expect unless this outright

    fails that somehow the writes were successful.

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

    alt_flash_write() is quite different from the Nios II Flash Programmer. The fact that the programmer works means that your flash _can_ function with a Nios II processor, but it doesn't necessarily mean that the HAL driver/API will work perfectly...or at all.

    It could be that your flash requires more "work" to work. Not sure about the error code either, but it might not be something that's defined in the driver itself. It might be more about what the flash device, itself, is returning.

    Welcome to the wonderful world of the CFI standard :-)

    Cheers and Good Luck!

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

    Thanks, Slack.

    Will take it up with Altera support.

    I would expect the NIOS programmer code to not reinvent the HAL driver/API

    so I would expect it to use _some_ form of the driver/API that is either a version

    ahead(maybe I need to upgrade my tools from 9.1) or some cheeky little bug

    fix or workaround that did not make it into the main code stream.

    So, just got to find out what is different but I don't have the code so...

    We'll see.

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

    Altera support no help.

    Faster to just write my own driver - no bloatware either.

    Done and tested.

    Ciao.

    Cos.