FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5941 Discussions

Problems uploading flash memory -- part 2

Altera_Forum
Honored Contributor II
3,725 Views

Hi, 

 

I used the Nios II EDS sof2flash program in the Quartus II 9.1 License Edition to convert a sof file to flash format.  

 

I attempted to use the Board Update Portal and the Nios II EDS to program the flash memory with the flash file on my Stratix IV GX FPGA development board (device EP4SGX230KF40C2N). 

 

After the file loads 100% successfully into the flash memory, I turn the rotary switch (SW2) on the board from position 0 to 1, then power cycle the board, but an error occurs and red LED D27 comes on. I tried again to program the flash memory and when complete, I pressed the CONFIGN button (S1), but I still get the same error. 

 

By the way, the sof file is targeted to my specific device and the Mega Cores used in this sof file are all fully licensed. 

 

But we noticed that the size of the flash file created by Nios II EDS is 28 MB and the User Hardware portion of the flash memory is only 12MB. Looks like we're getting this error because I'm trying to make fit a flash file that's too large for the allotted memory space? 

 

How do I reduce the size flash file created by Nios II? 

 

Thanks, 

 

Eric 

 

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

Electronics Engineer 

Microwave and Communication Systems Branch  

NASA Goddard Space Flight Center, Code 567 

8800 Greenbelt Road, Greenbelt, Maryland 20771, USA 

Building 25, Room S054, Mail Code 567.3 

Phone: (301)-286-3439 Email: eric.j.harris@nasa.gov 

-------------------------------------------------------
0 Kudos
29 Replies
Altera_Forum
Honored Contributor II
271 Views

So your problem is obviously vastly different than what everybody else was experiencing. May I ask what Operating System you are using and whether it is 32-bit or 64-bit. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

Hi Jake, 

Since it was brought up in this thread.... 

I'm also getting the sof2flash java problems on 64b SUSE linux (& 10.1). I'm probably just missing a doc on how to setup my env, but I've been hacking at it & would appreciate any pointers. 

 

Here's my env setup: 

setenv ALTERA_ROOT /home/altera/10.1 

setenv SOPC_KIT_NIOS2 ${ALTERA_ROOT}/nios2eds 

setenv _QUARTUS_ROOT ${ALTERA_ROOT}/nios2eds/../quartus 

setenv QUARTUS_ROOTDIR ${ALTERA_ROOT}/quartus 

setenv _NIOS2EDS_ROOT ${ALTERA_ROOT}/nios2eds/ 

setenv PATH ${PATH}:${ALTERA_ROOT}/nios2eds/bin/gnu/H-i686-mingw32/bin:${ALTERA_ROOT}/nios2eds/sdk2/bin:${ALTERA_ROOT}/nios2eds/bin:${ALTERA_ROOT}/quartus/bin:${ALTERA_ROOT}/quartus/sopc_builder/bin 

 

And that seems good enough for nios2-configure-sof and nios2-flash-programmer to run. 

 

Unfortunately, I get this for sof2flash: 

>sof2flash --pfl --optionbit=0x18000 --programmingmode=FPP --input=tpe.sof --output=tpe_hw.flash --offset=0x640000 ; 

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

Info: Running Quartus II Convert_programming_file 

Info: Version 10.1 Build 153 11/29/2010 SJ Full Version 

Info: Copyright (C) 1991-2010 Altera Corporation. All rights reserved. 

Info: Your use of Altera Corporation's design tools, logic functions 

Info: and other software and tools, and its AMPP partner logic 

Info: functions, and any output files from any of the foregoing 

Info: (including device programming or simulation files), and any 

Info: associated documentation or information are expressly subject 

Info: to the terms and conditions of the Altera Program License 

Info: Subscription Agreement, Altera MegaCore Function License 

Info: Agreement, or other applicable license agreement, including, 

Info: without limitation, that your use is for the sole purpose of 

Info: programming logic devices manufactured by Altera and sold by 

Info: Altera or its authorized distributors. Please refer to the 

Info: applicable agreement for further details. 

Info: Processing started: Fri Mar 18 09:27:35 2011 

Info: Command: quartus_cpf -c tpe_hw.cof 

Info: Memory Map File tpe_hw.map contains memory usage information for file tpe_hw.pof 

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

Info: Peak virtual memory: 327 megabytes 

Info: Processing ended: Fri Mar 18 09:27:50 2011 

Info: Elapsed time: 00:00:15 

Info: Total CPU time (on all processors): 00:00:10 

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

Info: Running Quartus II Convert_programming_file 

Info: Version 10.1 Build 153 11/29/2010 SJ Full Version 

Info: Copyright (C) 1991-2010 Altera Corporation. All rights reserved. 

Info: Your use of Altera Corporation's design tools, logic functions 

Info: and other software and tools, and its AMPP partner logic 

Info: functions, and any output files from any of the foregoing 

Info: (including device programming or simulation files), and any 

Info: associated documentation or information are expressly subject 

Info: to the terms and conditions of the Altera Program License 

Info: Subscription Agreement, Altera MegaCore Function License 

Info: Agreement, or other applicable license agreement, including, 

Info: without limitation, that your use is for the sole purpose of 

Info: programming logic devices manufactured by Altera and sold by 

Info: Altera or its authorized distributors. Please refer to the 

Info: applicable agreement for further details. 

Info: Processing started: Fri Mar 18 09:27:50 2011 

Info: Command: quartus_cpf -c tpe_hw.pof tpe_hw.hexout 

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

Info: Peak virtual memory: 339 megabytes 

Info: Processing ended: Fri Mar 18 09:28:22 2011 

Info: Elapsed time: 00:00:32 

Info: Total CPU time (on all processors): 00:00:28 

java.lang.NullPointerException 

at com.altera.utilities.Launcher.read(Launcher.java:307) 

at com.altera.utilities.Launcher.read(Launcher.java:362) 

at com.altera.sof2flash.PFLFlashGenerator.convertHexToSREC(PFLFlashGenerator.java:239) 

at com.altera.sof2flash.PFLFlashGenerator.pflgen(PFLFlashGenerator.java:37) 

at com.altera.sof2flash.Sof2flash.<init>(Sof2flash.java:122) 

at com.altera.sof2flash.Sof2flash.main(Sof2flash.java:77) 

Mar 18, 2011 9:28:22 AM - (SEVERE) sof2flash: Error creating intermediate files, exiting 

-------- 

Some additional info in case it helps: 

> uname -a 

Linux sprite 2.6.32.12-0.7-default# 1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux 

 

> java -version 

java version "1.6.0" 

Java(TM) SE Runtime Environment (build pxa6460sr7-20091215_02(SR7)) 

IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr7-20091214_49398 (JIT enabled, AOT enabled) 

J9VM - 20091214_049398 

JIT - r9_20091123_13891 

GC - 20091111_AA) 

JCL - 20091202_01 

 

So, it made .pof, .map, and .hexout files before it died. 

 

-Brian
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

PS: Tried these java's by adding them to head of PATH & still get java errors from sof2flash: 

altera/10.1/quartus/linux64/jre64/bin/java 

altera/10.1/quartus/linux64/jre/bin/java 

altera/10.1/quartus/linux/jre/bin/java 

 

>java -version 

java version "1.6.0_14" 

Java(TM) SE Runtime Environment (build 1.6.0_14-b08) 

Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode) 

 

>java -version 

java version "1.6.0_14" 

Java(TM) SE Runtime Environment (build 1.6.0_14-b08) 

Java HotSpot(TM) 64-Bit Server VM (build 14.0-b16, mixed mode)
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

 

--- Quote Start ---  

So your problem is obviously vastly different than what everybody else was experiencing. May I ask what Operating System you are using and whether it is 32-bit or 64-bit. 

 

Jake 

--- Quote End ---  

 

Sorry for the multi-month delay in responding. I am now able to get back to trying to get this to work. My OSes are Linux Mint 10.0 and CentOS 5.5. They are both 32-bit, and I get the same result on both. This is with Quartus 10.1.
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

 

--- Quote Start ---  

Sorry for the multi-month delay in responding. I am now able to get back to trying to get this to work. My OSes are Linux Mint 10.0 and CentOS 5.5. They are both 32-bit, and I get the same result on both. This is with Quartus 10.1. 

--- Quote End ---  

 

 

The error comes from "nios2-elf-objcopy" not being found in your PATH. You'll 

need to add nios2-elf-objcopy's directory to your PATH. sof2flash uses 

nios2-elf-objcopy -O srec a.hexout a.flash 

to convert to flash. 

-- Konrad
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

 

--- Quote Start ---  

The error comes from "nios2-elf-objcopy" not being found in your PATH. You'll 

need to add nios2-elf-objcopy's directory to your PATH. sof2flash uses 

nios2-elf-objcopy -O srec a.hexout a.flash 

to convert to flash. 

-- Konrad 

--- Quote End ---  

 

 

Hi Korand, 

I'm also facing same issue..Could you please tell me where i have to add the path of this nios2-elf-obj .. 

I'm getting error when i type the following command in nios2eds shell 

 

sof2flash --input= filename.sof --outpu=filename_hw.flash --offset=0x00020000 --pfl --optionbit=0x18000 --programmingmode=FPP  

 

and the error i'm getting is  

Jun 6, 2013 5:33:33 PM - (SEVERE) sof2flash: Error creating intermediate files, 

exiting 

 

..i understud from your replies that i have to add path of nios2-elf ..but i didnt get where i have to add this path 

suppose i have nios-elf-objcopy in " D:\altera\nios2eds\bin\gnu\H-i686-mingw32\bin " in this direc..where i have to add the path?? 

Pls help me friends
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

 

--- Quote Start ---  

Hi Korand, 

I'm also facing same issue..Could you please tell me where i have to add the path of this nios2-elf-obj .. 

I'm getting error when i type the following command in nios2eds shell 

 

sof2flash --input= filename.sof --outpu=filename_hw.flash --offset=0x00020000 --pfl --optionbit=0x18000 --programmingmode=FPP  

 

and the error i'm getting is  

Jun 6, 2013 5:33:33 PM - (SEVERE) sof2flash: Error creating intermediate files, 

exiting 

 

..i understud from your replies that i have to add path of nios2-elf ..but i didnt get where i have to add this path 

suppose i have nios-elf-objcopy in " D:\altera\nios2eds\bin\gnu\H-i686-mingw32\bin " in this direc..where i have to add the path?? 

Pls help me friends 

--- Quote End ---  

 

 

 

Pls help me out friends.. 

 

 

Best Regards, 

Rohit KVSS
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

Hi, I am facing similar problems to MSHATZ. I am attempting to flash the CIFlash with my bit stream. I have genrated the pof with configuration for 1-bit passive serial mode and also changed the start address to 0x20000.My one question would be ,as referred in the above comments contrary to 478, where can we change the address of the option bit to 0x18000 when generating the pof.

0 Kudos
Altera_Forum
Honored Contributor II
271 Views

Has anyone come across memory malformed error while using sof2flash?

0 Kudos
Reply