- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
how do I convert a Nios1 software file (.srec or .flash) to a .rbf file (raw binary file) that I can use to program directly a flash via that Nios? Thanks for your help, damcLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nios2-elf-objcopy is quite good for converting files between different formats. You probably need to convert your file to "raw" format using the switch `-O raw`.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks wombat
for the idea! It seems that nobody has done it until now. I am just wondering how customers can program Nios software updates into their products ... Regards, damc- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by damc@Feb 10 2005, 03:29 AM thanks wombat
for the idea!
it seems that nobody has done it until now.
i am just wondering how customers can program nios software updates into their products ...
regards,
damc --- Quote End --- How about the NIOS II flash program tool ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by kwokwong+feb 10 2005, 10:26 am--><div class='quotetop'>quote (kwokwong @ feb 10 2005, 10:26 am)</div>
--- quote start ---
<!--quotebegin-damc@Feb 10 2005, 03:29 AM thanks wombat
for the idea!
it seems that nobody has done it until now.
i am just wondering how customers can program nios software updates into their products ...
regards,
damc --- Quote End --- How about the NIOS II flash program tool .. [/b] --- Quote End --- Not possible. The FPGA-hardware is only accessible via a serial line. So the new flash contents (the new Nios software) must be downloaded first into SDRAM and then programmed via the Nios itself into flash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use HAL flash api to program.
Other threads in this forum discussed about the image fomats (FPGA and application). Do a search on key words: boot, epcs_controller and/or flash.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by kwokwong@Feb 10 2005, 01:00 PM use hal flash api to program.
other threads in this forum discussed about the image fomats (fpga and application).
do a search on key words: boot, epcs_controller and/or flash. --- Quote End --- It's an old Nios1 design, so I have no HAL. But that's also not the problem. Functions (nr_flash_erase_sector, nr_flash_write_buffer, ...) for programming the flash are avilable and working, but I didn't found any convinient file format (or converter) for the software that I could use. For firmware Quartus offers the .rbf (raw binary format) or the .rpd (raw programming data) format, but for software I couldn't find any conversion tool or utility. So at the moment I guess I have to write one by myself ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any objcopy will convert any SREC file for any processor to binary. Where objcopy starts being processor specific is when its dealing with ELF files.
So for a conversion from SREC to binary you can use any objcopy: the nios2 one, the x86 one (I can't remember if the nios1 kit had one). I misspoke earlier, the option you need is -O binary. Of course if you want to convert an ELF file to binary then you must use the correct objcopy.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The file format sent to your application over the serial can be anything you want: raw binary, s-record, etc. You'll just need code in you Nios application to parse whatever format you use and construct an image in RAM that you can then program into flash.
I would also add some sanity checks to the image you download. First, add a unique hardware specific signature string at a known offset (I put one just after the "Nios" string that the GERMs boot loader looks for) so your code can verify that that the downloaded image is indeed a code image intended for your particular hardware. This will prevent problems if your users accidently try and download the wrong file. Second, add some sort of self-consistency check in the image itself to ensure that the image in RAM is complete and uncorrupted before programming the flash. I embedd the size of the downloaded image near the start (again, at a known offset), and append a 16-bit CRC check code to the end of the image. The code recalculates the CRC of the downloaded image (using the length) and ignores the image if the CRCs don't match.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
scs: Thanks for your hints. The data transmission is done in a save way, so I can be sure to have only correct data for programming.
wombat: Instead of objcopy, what has a lot of parameters to play with, I downloaded from the web a simple srec2bin tool. With this tool I am able now to make out of a .flash file a .rbf file what I can download and program directly into flash. Thanks again for your ideas and hints!!! damc- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have access to Nios II (and the Nios II IDE), you could use this command line tool "nios2-srec2flash" then use "nios2-flash-programmer" to flash the design over (after doing all that I'd probably end up upgrading).
Sorry for not being more help (never used flash with Nios I, just GERMS and mif files). Good-luck- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page