Showing results for 
Search instead for 
Did you mean: 
Valued Contributor III

Flash Programmer ERROR!



I've been experiencing problems with the Flash Programmer. At the beginning, it only happened once a day, but now I can't write a program to flash. 


the fact is that when I try to write the program to flash, the IDE does the pre-reading, erase, and when it has to write, the size is not correct. In my case, it should write 252KB (the same as the pre-reading), but it writes 32KB, 10KB, ...  


"Sometimes" it succeeds, with 352KB written, and the program works, but the almost every time now, it doesn't. 


I thought it could be some IDE error, and I have installed all the patches I've found, but the problem remains... 


Has someone been experiencing this? any idea? 


The IDE window shows: 


<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

#! /bin/sh# # This file was automatically generated by the Nios II IDE Flash Programmer.# # It will be overwritten when the flash programmer options change.#  


cd Z:/tpu/EctProjects/Nios/ourprg 

# Creating .flash file for the project 

$SOPC_KIT_NIOS2/bin/elf2flash --flash=CI25 --base=0x00000000 --end=0x7fffff --re 

set=0x0 --input=mptu02.35_tpu_lib.elf --output=cfi_flash_0.flash --boot=$SOPC_KI 


# Programming flash with the project 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=cfi_flash_0.flash --sof=C:/al 


ASH.sof --base=0x00800000 

09-mar-2006 13:09:57 - (INFO) nios2-flash-programmer: Launching Quartus Programm 

er to download: 



Pre-Reading 352KBytes of data from CI25: 


    ********************* (21.516 sec). 

Erasing 4 Sectors: 


    ********************* (3.531 sec). 

Writing 32KBytes : 


    ********************* (3.438 sec). 

Verifying 32KBytes of data: 


    ********************* (1.937 sec). 

09-mar-2006 13:10:56 - (INFO) nios2-flash-programmer: Success. Verified 32Kbytes 

written to CI25. 

09-mar-2006 13:10:56 - (INFO) nios2-flash-programmer: Flash programming complete[/b] 

--- Quote End ---  



Alex Bueno
0 Kudos
2 Replies
Valued Contributor III

Which version of NIOS are you using? From the screen dump it looks like you&#39;re using the older flash programmer which had infinite ways of mysteriously failing. It got much better in 5.1 so I would recommend upgrading to 5.1. 


If you can&#39;t easily upgrade you might want to check your flash programmer design (the one in the "system" directory) to see if the timing of the flash interface is good and whether the clock frequency is fast enough. It&#39;s supposed to be faster than 50MHz, if I remember correctly. 


Also, I don&#39;t know if the old programmer did some optimization where only the sectors that actually changed get programmed. Can you erase all your flash and see if it works after that? 


0 Kudos
Valued Contributor III



I&#39;ve checked the flash programmer design, and it seems to be OK. 


Now I can&#39;t install the version 5.1, so any suggestions would be apreciated. 


It could be that only the changed sectors would be programmed, but anyway, it doesn&#39;t work. And as I know, the flash programmer doesn&#39;t have any way to erase the flash... has it? 


0 Kudos