Anybody else have problems with MAX 10 internal flash and Nios flash programmer? - Page 1
Forum section: electronics / general

author: blueduck577
author_rank: Newbie
timestamp: October 15, 2014, 12:24:18 am
content: Hey guys, I've been playing with the MAX 10 FPGA and have a pretty good prototype design. I'd like to write my design to the internal flash but the Nios flash programmer just isn't having it.The problem arises with sof2flash. When I run it, I get error code 3 - Unrecognized device family in SOF. This happens with the both the Nios flash programmer tool and sof2flash from the command line. Everything else seems to be working fine. I can convert just the SOF to a POF and program the flash using Quartus programmer.A friend of a friend is a local representative for Altera and I've talked with him a bit, but he didn't seem to have a solution for me. Some questions I've already answered for him that you'll probably ask:Quartus Version: 14.0.2 Build 209 (freshly downloaded and installed yesterday)Nios II EDS Version: 14.0.0.200 Build id: 201406181529SBT4E Core Version: 14.0.0.209I am using the Nios II Gen2JTAG debug worksI have an instance of the On-Chip Flash IP in my design in QsysI can successfully download the design to RAMI can successfully convert the SOF to a POF and program the flash using Quartus programmerIt just seems like the Nios tools aren't ready, and there isn't a way to convert and join my programming files so I can just use the Quartus programmer. Has anybody else run into this issue? I'm sure I can't be the first.Has anybody else even successfully programmed the flash with a complete Nios II system (hardware and software)?Thanks!

author: miguelvp
author_rank: Super Contributor
timestamp: October 15, 2014, 01:48:44 am
content: I'm waiting for Arrow to carry theirs:http://www.mouser.com/ProductDetail/Altera/EK-10M08E144ES-P/?qs=%2fha2pyFadug5SGINdZNV3MsMlTgI0l7zEuXLhyljE15EaIvj3kP77Q%3d%3dBut maybe you can find something in the full docs.http://www.altera.com/literature/lit-max-10.jspI'm downloading the update 2 but since I don't have the device I won't be able to reproduce it.

author: marshallh
author_rank: Unknown
timestamp: October 15, 2014, 04:18:33 am
content: Friend on the inside says 14.0 support for Max10 is very buggy, and to wait for 14.1 which is forthcoming.

author: Rigby
author_rank: Super Contributor
timestamp: October 16, 2014, 09:06:06 pm
content: if you could find out when windows 10 will be supported in quartus ii, that'd be excellent. it crashes for me every time as it's assembling the file to sent to the fpga. i haven't tried it with a max10 yet, so it's probably gonna happen for any device.

author: blueduck577
author_rank: Newbie
timestamp: October 26, 2014, 07:31:18 pm
content: Got some more information from a separate contact on the inside. Turns out there is no MAX 10 support in the latest release of sof2flash. Also, the up and coming release doesn't seem to have support either (well, not yet at least). At least we've now got a bug in Altera's ear and hopefully it will make it into the next release.

author: miguelvp
author_rank: Super Contributor
timestamp: October 26, 2014, 07:51:44 pm
content: I got my Max10 so I can try it now, I know I can flash it within Quartus II.I haven't tried yet the NiosII lab, but I will.Embedded Systems Lab @http://www.alterawiki.com/wiki/BeMicro_MAX_10#Empty_Baseline_Project_.28starting_point_for_your_own_design.29Do you think you can still program a Nios II soft core without using sof2flash?I have not done much with NiosII in the past but I'll follow the lab and report if it works or not.

author: blueduck577
author_rank: Newbie
timestamp: October 27, 2014, 09:09:20 pm
content: Just took a quick look at the tutorial. It goes as far as running the software application on the target (volatile), but never gets around to actually writing the software to the flash memory.

author: miguelvp
author_rank: Super Contributor
timestamp: October 28, 2014, 01:34:22 am
content: Sorry I never had a chance on the past two days to do it. Kind of have been busy whit the Seek thermal camera

author: Rigby
author_rank: Super Contributor
timestamp: October 28, 2014, 12:31:55 pm
content: If you're familiar with using Quartus to save to flash on other devices, I'm sure it's a very similar process. It would be a matter of looking up the MAX10 datasheet and finding the encoding and that stuff.I think. Not sure. I'm still pretty new at this kind of thing.

author: miguelvp
author_rank: Super Contributor
timestamp: October 28, 2014, 03:18:04 pm
content: He is talking about what this part of a tutorial does to use the soft core untethered, program and all:https://sites.google.com/site/fpgaandco/NiosII-standalone#TOC-Making-it-stick-Maybe I get some time this coming weekend

author: Rigby
author_rank: Super Contributor
timestamp: October 28, 2014, 03:20:20 pm
content: oh, you have to license the niosII core to run it untethered, I believe. that may be the root issue, I don't know. I'm jumping in to this conversation late and may not comprehend exactly what the problem is. take my words with a pinch of salt.

author: miguelvp
author_rank: Super Contributor
timestamp: October 28, 2014, 04:27:37 pm
content: You can run the basic NIOS II untethered as far as I know it's license free.

author: blueduck577
author_rank: Newbie
timestamp: October 28, 2014, 06:43:17 pm
content: Yes, you can run the Nios II/e untethered no problem. But that isn't the question - the Nios hardware is embedded in the .sof which can be written to flash using the Quartus programmer.The problem lies in the process of joining the .sof and .elf into one programming file to write to flash.Quote from: miguelvp on October 28, 2014, 03:18:04 pmThis is a similar process to what I've tried. This is for the DE0 nano board though (Cyclone series), not a MAX 10 device. I can successfully take Nios hardware and software, follow this procedure and successfully program the flash on a Cyclone IV dev board I have.Edit: to clarify, the Nios II flash programmer tool is a nice GUI for the command-line tools. It simply makes a script that calls the command-line tools. Using either approach results in the same thing: sof2flash complains that the MAX 10 isn't supported.

author: miguelvp
author_rank: Super Contributor
timestamp: October 29, 2014, 08:14:09 am
content: So I did follow the sample (they have some mistakes in the doc that I had to overcome, not to mention that the first sample they posted half a month ago didn't work and the new one was using too many m9k blocks because they trying for 32KB on chip as well as other things, so I had to reduce the memory on-chip to 24K so the fitter would not complain)Anyways, because they use some opencores IPs and because the NiosII version is not licensed I had to run tethered.The sample code in eclipse is just a counter upper and down and up by three and the LEDs light up. The NiosII core has other things done including external memory accelerometer support, flash memory etc..The thing is that because I don't have a license I can't burn it into flash. I might try to do a simple NiosII/E or whichever is the one that doesn't need the license.Here is the led control program running, didn't try the rest of their labs programs.Code:bemicro_led_control program starting...CONGRATULATIONS! You have successfully compiled a Nios II project!Press 'u' to count upPress 'd' to count downPress '3' to count by threesuYou selected: 'u'- counting up by 10x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f0x80 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88d0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef0xf0 0xf1 0xf2 0xf3 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xffBeMicro LED control program completed its loop ...Press 'u' to count upPress 'd' to count downPress '3' to count by threesYou selected: 'd'- counting down by 10xff 0xfe 0xfd 0xfc 0xfb 0xfa 0xf9 0xf8 0xf7 0xf6 0xf5 0xf4 0xf3 0xf2 0xf1 0xf00xef 0xee 0xed 0xec 0xeb 0xea 0xe9 0xe8 0xe7 0xe6 0xe5 0xe4 0xe3 0xe2 0xe1 0xe00xdf 0xde 0xdd 0xdc 0xdb 0xda 0xd9 0xd8 0xd7 0xd6 0xd5 0xd4 0xd3 0xd2 0xd1 0xd00xcf 0xce 0xcd 0xcc 0xcb 0xca 0xc9 0xc8 0xc7 0xc6 0xc5 0xc4 0xc3 0xc2 0xc1 0xc00xbf 0xbe 0xbd 0xbc 0xbb 0xba 0xb9 0xb8 0xb7 0xb6 0xb5 0xb4 0xb3 0xb2 0xb1 0xb00xaf 0xae 0xad 0xac 0xab 0xaa 0xa9 0xa8 0xa7 0xa6 0xa5 0xa4 0xa3 0xa2 0xa1 0xa00x9f 0x9e 0x9d 0x9c 0x9b 0x9a 0x99 0x98 0x97 0x96 0x95 0x94 0x93 0x92 0x91 0x900x8f 0x8e 0x8d 0x8c 0x8b 0x8a 0x89 0x88 0x87 0x86 0x85 0x84 0x83 0x82 0x81 0x800x7f 0x7e 0x7d 0x7c 0x7b 0x7a 0x79 0x78 0x77 0x76 0x75 0x74 0x73 0x72 0x71 0x700x6f 0x6e 0x6d 0x6c 0x6b 0x6a 0x69 0x68 0x67 0x66 0x65 0x64 0x63 0x62 0x61 0x600x5f 0x5e 0x5d 0x5c 0x5b 0x5a 0x59 0x58 0x57 0x56 0x55 0x54 0x53 0x52 0x51 0x500x4f 0x4e 0x4d 0x4c 0x4b 0x4a 0x49 0x48 0x47 0x46 0x45 0x44 0x43 0x42 0x41 0x400x3f 0x3e 0x3d 0x3c 0x3b 0x3a 0x39 0x38 0x37 0x36 0x35 0x34 0x33 0x32 0x31 0x300x2f 0x2e 0x2d 0x2c 0x2b 0x2a 0x29 0x28 0x27 0x26 0x25 0x24 0x23 0x22 0x21 0x200x1f 0x1e 0x1d 0x1c 0x1b 0x1a 0x19 0x18 0x17 0x16 0x15 0x14 0x13 0x12 0x11 0x100xf 0xe 0xd 0xc 0xb 0xa 0x9 0x8 0x7 0x6 0x5 0x4 0x3 0x2 0x1 0x0BeMicro LED control program completed its loop ...Press 'u' to count upPress 'd' to count downPress '3' to count by threes3You selected: '3'- counting up by 30x0 0x3 0x6 0x9 0xc 0xf 0x12 0x15 0x18 0x1b 0x1e 0x21 0x24 0x27 0x2a 0x2d0x30 0x33 0x36 0x39 0x3c 0x3f 0x42 0x45 0x48 0x4b 0x4e 0x51 0x54 0x57 0x5a 0x5d0x60 0x63 0x66 0x69 0x6c 0x6f 0x72 0x75 0x78 0x7b 0x7e 0x81 0x84 0x87 0x8a 0x8d0x90 0x93 0x96 0x99 0x9c 0x9f 0xa2 0xa5 0xa8 0xab 0xae 0xb1 0xb4 0xb7 0xba 0xbd0xc0 0xc3 0xc6 0xc9 0xcc 0xcf 0xd2 0xd5 0xd8 0xdb 0xde 0xe1 0xe4 0xe7 0xea 0xed0xf0 0xf3 0xf6 0xf9 0xfc 0xffBeMicro LED control program completed its loop ...Press 'u' to count upPress 'd' to count downPress '3' to count by threes

author: miguelvp
author_rank: Super Contributor
timestamp: October 29, 2014, 08:21:47 am
content: That said if I try to use the Nios II Flash Programmer I do get your same errors, but then again my sof is a time limited one.Code:Info: Oct 29, 2014 3:19:15 AM - (FINE) sof2flash: StartingInfo: Oct 29, 2014 3:19:15 AM - (SEVERE) sof2flash: Unrecognized device family in SOF.Info: The sof2flash utility takes an FPGA configuration file in SOF format andInfo: translates it to a FLASH file that can be programmed into the flashInfo: memory connected to an Altera FPGA.Info:Info: usage: sof2flash [--programmingmode=programmingmode] [--log=file]Info: [--activeparallel] [--epcq] [--options=file] [--epcs] [--pfl] [--debug]Info: [--offset=addr] [--timestamp] [--optionbit=optionbitaddress] [--verbose]Info: [--output=file] [--epcq128] [--save] [--help] [--input=file] [--quiet]Info: [--compress]Info:Info: Options may be specified in any order.Info:Info: --activeparallel create parallel flash contentsInfo: for active parallel programmingInfo: --compress compress the SOFInfo: --debug debug modeInfo: --epcq EPCQ flash mode of sizeInfo: 256MbitsInfo: --epcq128 EPCQ flash mode of sizeInfo: 128Mbits or lessInfo: --epcs EPCS flash modeInfo: --help print this messageInfo: --input=<file> input SOF file to processInfo: --log=<file> file for logging progressInfo: --offset=<addr> design location within theInfo: flashInfo: --optionbit=<optionbitaddress> Option Bit AddressInfo: --options=<file> intermediate Options file (forInfo: EPCS only)Info: --output=<file> output flash fileInfo: --pfl Pfl modeInfo: --programmingmode=<programmingmode> Programming modeInfo: --quiet only print errorsInfo: --save save intermediate filesInfo: --timestamp produce a s0 record withInfo: timestamp of input fileInfo: --verbose lots of interestingInfo: informationError: Error code: 3 for command: sof2flash --input="D:/projects/FPGA/BeMicro/MAX10/bemicro_m10_embedded_lab_14_0/output_files/bemicro_m10_nios2_top_time_limited.sof" --output="D:/projects/FPGA/BeMicro/MAX10/bemicro_m10_embedded_lab_14_0/flash/bemicro_m10_nios2_top_time_limited_serial_flash_controller.flash" --offset=0x0 --verbose