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++
12589 Discussions

A problem of programming flash...

Altera_Forum
Honored Contributor II
1,240 Views

Hi all, 

 

I meet a new problem when programming flash  

 

in NiosII IDE. 

 

Just because the err popped during regeneration, 

 

I removed the epcs_controller from the components  

 

list of my design in the SOPCBuilder.Then I regenerated 

 

the actual design,it proved successful.After this, 

 

I updated the symbol in the .bdf and recompiled.After 

 

the compilation,I builded a new project "hello_led" from 

 

the template projects list in the NiosII IDE. 

 

It seemed that building and later running as NiosII Hardware 

 

either was OK. 

 

However,when I tried to program this project into the  

 

flash on the dev board,some err message came out, 

 

-----------------------# ! /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 E:/EDA/UP3/design/The_Last_One/software/hello_led_1/Debug 

# Creating .flash file for the FPGA configuration 

$SOPC_KIT_NIOS2/bin/sof2flash --flash=U8 --offset=0x700000 --input=E:/EDA/UP3/de 

sign/The_Last_One/For_UP3.sof --output=For_UP3.flash 

Info: ******************************************************************* 

Info: Running Quartus II Convert_programming_file 

Info: Command: quartus_cpf --no_banner --convert E:/EDA/UP3/design/The_Last_One/ 

For_UP3.sof For_UP3.rbf 

Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings 

Info: Processing ended: Wed Jul 27 18:11:52 2005 

Info: Elapsed time: 00:00:01 

WARNING: Default charset GBK not supported, using ISO-8859-1 instead 

# Programming flash with the FPGA configuration 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=For_UP3.flash --sof=E:/EDA/UP 

3/design/The_Last_One/my_new_board/system/my_new_board.sof --base=0x00200000 

Jul 27, 2005 6:11:53 PM - (??) nios2-flash-programmer: Launching Quartus Program 

mer to download: 

E:/EDA/UP3/design/The_Last_One/my_new_board/system/my_new_board.sof 

Unable to synchronize with target. 

Jul 27, 2005 6:13:01 PM - (??) nios2-flash-programmer: Error opening target hard 

ware 

Jul 27, 2005 6:13:01 PM - (??) nios2-flash-programmer:  

In order to program flash, you must first create a purpose-built 

flash-programming design (i.e. FPGA configuration) and associate it with 

your particular board. The Nios development kit is delivered with purpose-bui 

lt 

flash-programming designs pre-built for several development boards. If you wi 

sh 

to program flash on your own board, you must first create a flash-programming 

design. 

 

The process of creating a flash-programming design for your board is mostly 

automated. From a bash-shell, execute this script: 

 

mk_target_board --help 

 

The help-message includes references to other documentation on programming 

flash and targeting Nios systems to custom board designs. 

- exiting. 

WARNING: Default charset GBK not supported, using ISO-8859-1 instead 

# Creating .flash file for the project 

$SOPC_KIT_NIOS2/bin/elf2flash --flash=U8 --base=0x00800000 --end=0x8fffff --rese 

t=0xa00000 --input=hello_led_1.elf --output=flash.flash --boot=$SOPC_KIT_NIOS2/c 

omponents/altera_nios2/boot_loader_cfi.srec 

WARNING: Default charset GBK not supported, using ISO-8859-1 instead 

# Programming flash with the project 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=flash.flash --sof=__NO_SOF_PL 

EASE__ --base=0x00200000 

Jul 27, 2005 6:13:03 PM - (??) nios2-flash-programmer: Input file empty--no data 

to program into flash. Exiting. 

WARNING: Default charset GBK not supported, using ISO-8859-1 instead 

 

------------------ 

I notice "nios2-flash-programmer: Input file empty--no data 

 

to program into flash. Exiting" in the message above. 

 

But I cannot figure out why,because I successflly  

 

made my target board and builded the "hello_led" 

 

project.So I wonder whether this problem might be has 

 

somthing with my removing of the epcs_controller. 

 

Could you please give some suggestions about that? 

 

Thank you in advance! 

 

 

Regards, 

 

Don 

 

 

ps.I use the mux module provided by SLS to the NiosII 

 

module running on the board.So I only make 

 

a LCD_RW _N signal as hign level to disable its  

 

sharing of the tri-state bus.(Because the SRAM shares 

 

the same Read signal as the flash on the board,and the 

 

SDRAM has not a read signal. )
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
369 Views

After these days&#39; work,I still cannot resolve this problem, http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

could anyone give me some suggestions? 

 

Many thanks to you!
0 Kudos
Altera_Forum
Honored Contributor II
369 Views

Hi Don, 

 

Is For_UP3.sof your flash programming design, or your normal system design? 

 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
369 Views

Thanks Scott! 

 

That&#39;s right,For_UP3 is the top entity of my design,and the .sof 

 

file is For_UP3.sof,could you give me some suggestions please?
0 Kudos
Altera_Forum
Honored Contributor II
369 Views

I wonder is there something with the EPCS controller?

0 Kudos
Altera_Forum
Honored Contributor II
369 Views

Hi Don, 

 

I don&#39;t have a UP3 board ... but as I recall, it only has 2MB of flash. Soooo ... 

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

--- Quote Start ---  

$SOPC_KIT_NIOS2/bin/sof2flash --flash=U8 --offset=0x700000 --input=E:/EDA/UP3/de 

sign/The_Last_One/For_UP3.sof --output=For_UP3.flash[/b] 

--- Quote End ---  

 

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

--- Quote Start ---  

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=For_UP3.flash --sof=E:/EDA/UP 

3/design/The_Last_One/my_new_board/system/my_new_board.sof --base=0x00200000[/b] 

--- Quote End ---  

 

doesn&#39;t appear correct -- specifically the offset. 

 

Did you use mk_target_board to create the flash programmer design my_new_board.sof? 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
369 Views

Now I could see the flash programmer in the NiosII IDE 

 

indeed work,because I see something like this while programming: 

 

-------------------------------------------------------------------- 

Pre-Reading 85KBytes of data from U15: 

|----.----+----.----| 

********************* (31.454 sec). 

Aug 2, 2005 6:51:09 PM - (??) nios2-flash-programmer: Success. Zero  

 

bytes writt 

en to U15- 

(because device matched contents of For_UP3.flash) 

Aug 2, 2005 6:51:09 PM - (??) nios2-flash-programmer: Flash  

 

programming complete 

--------------------------------------------------------------------- 

 

However,there comes out some new message  

after above like this:: 

----------------------------------- 

Aug 2, 2005 6:51:10 PM - (??) nios2-flash-programmer:  

Input file empty--no data  

to program into flash. Exiting. 

 

Aug 2, 2005 6:51:11 PM - (??) nios2-flash-programmer 

: SOF-download skipped. 

Aug 2, 2005 6:51:14 PM - (??) nios2-flash-programmer 

: Flash file is too large to 

fit in flash memory 

----------------------------------- 

But at then what the design I wanted to program into 

the Flash is a "Hello_World" project template,perhaps 

the smallest design of all. 

 

So how could this file be so large that cannot be  

programmed into the Flash chip,whose size is 2M ? 

 

Besides,I tried to program some other template  

projects into the Flash chip,but the message 

were all the same as above indicating they were 

too large to program. 

 

Could anyone tell me why this happen? 

 

Thanks in advance! 

 

 

 

Regards, 

 

Don
0 Kudos
Altera_Forum
Honored Contributor II
369 Views

Hi Don, 

 

> So how could this file be so large that cannot be 

> programmed into the Flash chip,whose size is 2M ? 

 

> Could anyone tell me why this happen? 

 

Because _now_ you&#39;re writing into U15, which is an EPCS1 device which has a 

128 KB capacity (split between the configuration data and your app) -- not U8 

which is the parallel flash device (2 MB). 

 

Don, if want to find a solution, you shouldn&#39;t keep changing the problem ;-) 

 

Good Luck, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
369 Views

Thanks Scott! 

 

Sorry, I really didnot mean to keep changing my problem . http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif  

 

I got the solution of the first post from Altera&#39;s mysupport, 

 

and then I made a new target board aimed at programming 

 

the epcs_controller.But as you see,the new problem I met 

 

is due to the limited size of the EPCS chip. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

From your suggestions, I &#39;m gonna make another target board 

 

aimed at programming the flash instead of the epcs_controller, 

 

and I think I should set the reset address of the system to Flash(0x0000), 

 

do you think would that work?  

 

 

Many thanks:) 

 

 

Best Regards, 

 

Don
0 Kudos
Reply