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

Problem of Porting Flash Programmer.

Altera_Forum
Honored Contributor II
1,463 Views

Hello Everyone, 

 

I use Microtronix Cyclone Development Board(I think it is a bad dev board, so many important part generated by SOPC Builder Core can not work with Nios II)  

and it is just a custom board, so I must porting Flash Programmer to Mtx.Cyclne.Board. In order to that, I creat a project to test EPCS first.  

Nios II/s + OnChipRam + jtag-uart + led_pio + epcs_controller. Just can run hello_led. It runs ok under Nios II IDE.  

 

Then, I followed the ug_nios2_flash_programmer.pdf. 

 

1. Under Nios II SDK Shell,  

/cygdrive/d/My_Test 

[SOPC Builder] mk_target_board --name=Mtx_Flash_Porting --family=cyclone --clock=49.152 --index=1  

--buffer_size=16384 --epcs=U15 

Make Target Board version 1.01 

Board name: "Mtx_Flash_Porting" 

Board class: "Mtx_Flash_Porting" 

Device family: Cyclone 

Clock frequency: 49152000hz 

Payload buffer size: 16384 bytes 

EPCS flash enabled with reference designator: U15 

 

Finished making target board. 

 

2. Start Quartus II and do as Step4--13.  

My board flash(4MBytes) is AM29DL323GB-90EI. I set address width=21bits, data width=16bits, reference designator=U20, leave others as default value. Its base address=0x00400000. 

In More "Board_System" Settings, I only set one item. 

Hardware Image Name Module Offset Address 

user asmi 0x00000000 0x00060000 

 

3. Generate System Block and update Symbol or Block. 

 

4. Do as Step25--31. 

Mtx Product Data Sheet gives the Pin Name and Assignment. So I assign the pins to the DataSheet defined FPGA-Pins. (But Leave the clk and reset_n Pins unnamed and unassigned) 

 

5. Compile it under Quartus II. 

 

6. Reopen my project, open SOPC Builder, at the Board Target drop-down list select "Mtx_Flash_Porting". 

 

7. Regenerate the system.bsf, and recompile the project. "epcs_controller base=0x00000000" 

 

Finally, I open Nios II IDE, creat Hello_Led Project, build project sucessfully. 

I open Tool-->Flash Programmer and do the Flash Programmer Settings, below is my option: 

In main Tab Window: 

¡ô Target board: Mtx_Porting_Flash 

¡ô Uncheck: Program software project into flash memory 

¡ô Check: Program FPGA configuration data into hardware-image region of flash memory 

FPGA Configuration(sof) D:\My_Test\EPCS\EPCS.sof 

Hardware Image user: U15 + 0x00000000 

¡ô Uncheck: Program a file into flash memory 

In target connection Tab Window: 

¡ô JTAG Cable: 

automatic <currently: ByteBlasterII [LPT1]> 

¡ô JTAG Device: 

automatic <the device which has the processor> 

 

Click Apply, and run Program Flash. In the Console, display 

<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 D:/My_Test/EPCS/software/epcsdown_led/Debug 

# Creating .flash file for the FPGA configuration 

$SOPC_KIT_NIOS2/bin/sof2flash --flash=U15 --offset=0x00000000 --epcs --input=D:/ 

My_Test/EPCS/EPCS.sof --output=EPCS.flash 

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

Info: Running Quartus II Convert_programming_file 

Info: Command: quartus_cpf --no_banner --convert --device=EPCS16 --option=EPCS.o 

pt D:/My_Test/EPCS/EPCS.sof EPCS.pof 

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

Info: Processing ended: Fri Mar 25 16:43:04 2005 

Info: Elapsed time: 00:00:02 

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

Info: Running Quartus II Convert_programming_file 

Info: Command: quartus_cpf --no_banner --convert EPCS.pof EPCS.rpd 

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

Info: Processing ended: Fri Mar 25 16:43:05 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=EPCS.flash --sof=d:/My_Test/E 

PCS/Mtx_Flash_Porting/system/Mtx_Flash_Porting.sof --epcs --relocateMar 25, 2005 4:43:07 PM - (??) nios2-flash-programmer: Launching Quartus Program 

mer to download: 

  d:/My_Test/EPCS/Mtx_Flash_Porting/system/Mtx_Flash_Porting.sof 

Unable to synchronize with target. 

Mar 25, 2005 4:44:19 PM - (??) nios2-flash-programmer: Error opening target hard 

ware 

Mar 25, 2005 4:44:19 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[/b] 

--- Quote End ---  

 

 

I do not know what is wrong, it makes me very depressed. 

 

Can someone help me? Give me some index. 

 

Thank you very much.
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
742 Views

I use Quartus II 4.2 SP1 and Nios II 1.1 Eval. 

 

The error in the console is 

 

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

--- Quote Start ---  

Unable to synchronize with target.[/b] 

--- Quote End ---  

 

 

What on earth it refer? But in the Flash Programming Design, it do not use clk pin.
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

What do you mean by you "leave the clock and reset pins unassigned"? I&#39;m not familiar with the Microtronix Dev. Kit, but your Flash Programmer design (created by mk_target_board) doesn&#39;t have any chance of working without a clock and reset. You need to hook it up, just like you would for any other NiosII-based design. In fact, depending on your board, you may even need to add a simple delay reset circuit (like in the majority of the example designs), as well. 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hello, 

 

In addition to what slacker says: "Unable to synchronize with target" means that the flash programmer (on host PC) cannot communicate with the Nios II software in the flash target design. This software is simple firmware that communicates with the PC via JTAG UART peripheral. When the flash programmer starts, it tries to send and receive a reply back from the Nios II firmware; the error message you describe means that this operation timed out. 

 

Anyways, I agree wtih slacker. All pins to the flash programmer target design should be assigned.. without clock and reset Nios II in the flash programmer design will never wake up!
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Thank you Jesse & Slacker, 

 

I add the Pll, assign the Pin and rebuild My Flash Programming Design. It successfully downloaded the .sof to the epcs. 

 

In addtion, I find there has a boot_loader_epcs.srec file in the ...\altera_nios2 directory and when build the software project(if reset address is set to epcs_controller), will creat epcs_controller_boot_rom.flash file. 

I want to know that  

if epcs_controller_boot_rom.flash is generated from boot_loader_epcs.srec and  

if I want to down app and boot from epcs,  

In Flash Programmer Menu, I 

 

Check Program software Project to flash memory. 

Check Program FPGA configuration data into hardware-image region of flash memory. 

Uncheck Program a file into flash memory. 

Is it enough boot from epcs and epcs_controller_boot_rom.flash can be programmed to epcs automatically? 

Or I need to program it to the epcs by myself. 

 

Thank you again.
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hi LiYangYi, 

 

The file "boot_loader_epcs.srec" is executed if the Nios II cpu is set to reset (boot) from the EPCS controller. This software is *not* programmed into EPCS flash; it lives in a small ROM inside the FPGA, in the epcs controller peripheral. This loader will load your .elf, if programmed into EPCS, and then transfer execution to that program.
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

How long ago did you receive your Microtronix Cyclone Development Board? Any boards that were shipped after Nios II was released already have a board component that works with the Nios II flash programmer. You can look in your component directory for a component called "mtx_nios_dev_board_cyclone_1c20". If you do not have this component, contact support@microtronix.com

 

Dennis Scott 

Microtronix Datacom Ltd.
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hi Dennis, 

 

Thank you. 

 

My Mtx Dev Board is the first release support for Nios I and Embedded Linux Developer V1.0. 

I remember I got it in the Nov.2003. 

 

I now use Quartus II 4.2 and Nios II 1.1, I have port Flash Programming Design and it works well. 

But the Igor-MAC can not run with uClinux V1.3. What is wrong?
0 Kudos
Reply