- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
Can I ask if it is supposed to be possible to run from an internal ROM? This means not using a bootloader at all. setting reset to an internal on chip ROM. In this case, does the startup code before alt_main is reached take care of any RAM setup? (the typical copy to RAM and execute approach performs RAM initialisation during the copy process) Thanks, http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gifLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have your Nios reset to that memory location, and regenerate the system.
Then in the IDE compile the code with the system library targetting the text portion (or rodata if you want it there too) to that onchip memory. Go back to Quartus and compile your hardware (that onchip memory has a hex file associated to it, and by compiling in the IDE you created the contents for it). I recommend you use the onchip ROM instead of onchip RAM (more memory selection, and you don't have to worry about your memory getting wiped out accidentally by your code).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok, but any data sections that would normally be initialised by a bootcopier will be incorrect?
I don't have anything in my code like static variables initialised, but if the library has or the irq_handlers or other altera bits then they'll not be happy! I will use an internal ROM, but I'd really like to be able to use a RAM and be able to use it for scratchpad memory after bootup! But, in order to acheive that I'd need to be able to get the reset input not to just reset the nios,etc but to actually reset the FPGA and force a boot/bitstream download - something which I'm not sure can be done internally? Externally I guess its only a matter of pulling nCONFIG low - but it would be great to be able to do that internally with no re-spin of PCB!!! Thanks for the help!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are there some linker switches to reduce the ROM size? I don't see how code+initialised data comes to 8694, certainly not from the map file? Are those other sections being lumped into the ROM in error?
Compiling alt_main.c... Linking ems_boot.elf... Info: (ems_boot.elf) 8694 Bytes program size (code + initialized data). Info: 16382 KBytes free for stack + heap. Hardware simulation is not enabled for the target SOPC Builder system. Skipping creation of hardware simulation model contents and simulation symbol files. (Note: This does not affect the instruction set simulator.) Post-processing to create ems_boot_rom.hex Build completed [SOPC Builder]$ nios2-elf-objdump -h ems_boot.elf ems_boot.elf: file format elf32-littlenios2 Sections: Idx Name Size VMA LMA File off Algn 0 .entry 00000020 01000000 01000000 00000094 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .exceptions 000000d8 01000020 01000020 000000b4 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .text 000018c8 010000f8 010000f8 0000018c 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 3 .rodata 000001d2 010019c0 010019c0 00001a54 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .rwdata 00000020 00000000 00000000 00000074 2**2 CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA 5 .bss 00000644 00000020 00000020 00000094 2**2 ALLOC, SMALL_DATA 6 .sdram 00000000 00000664 00000664 00001c26 2**0 CONTENTS 7 .epcs_controller 00000000 01004800 01004800 00001c26 2**0 CONTENTS 8 .ems_boot_rom 00000002 01001b92 01001b92 00001c26 2**0 CONTENTS 9 .comment 000002ec 00000000 00000000 00001c28 2**0 CONTENTS, READONLY 10 .debug_aranges 00000108 00000000 00000000 00001f18 2**3 CONTENTS, READONLY, DEBUGGING 11 .debug_pubnames 0000010b 00000000 00000000 00002020 2**0 CONTENTS, READONLY, DEBUGGING 12 .debug_info 00003266 00000000 00000000 0000212b 2**0 CONTENTS, READONLY, DEBUGGING 13 .debug_abbrev 00000821 00000000 00000000 00005391 2**0 CONTENTS, READONLY, DEBUGGING 14 .debug_line 00000b84 00000000 00000000 00005bb2 2**0 CONTENTS, READONLY, DEBUGGING 15 .debug_frame 00000198 00000000 00000000 00006738 2**2 CONTENTS, READONLY, DEBUGGING 16 .debug_str 00000977 00000000 00000000 000068d0 2**0 CONTENTS, READONLY, DEBUGGING /cygdrive/f/projects/emshw/full_featured/software/ems_boot/release [SOPC Builder]$- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
booting from internal ROM now (the flash programmer does not work with Nios2 - sorry Altera).....
so thats 10KBytes of my blockram used up un-necessarily. even so, not quite out of the woods yet - because while I can see I've booting into code, timer interrupts do not seem to behave. this is a heck of a time-waster getting the nios stand-alone booting. my application software development is suffering because of this nonsense.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page