Altera_Forum
Honored Contributor
12 years agoUnable to boot from on-chip RAM
Hi,
I am using QuartusII version 11.1. I have designed a custom board with Cyclone IV E FPGA, EPCS16 configuration device, character LCD and some other ICs. I could successfully build a Qsys system, develop a code for displaying to LCD in NiosII SBT for Eclipse, and see the output after downloading the elf through JTAG interface. The Qsys system consists of bare minimum - NiosII /e core, on-chip RAM, LCD controller, JTAG UART, etc. There is no external memory. Now I want to initialize the on-chip RAM with the hex software image, and program the pof file into EPCS device, so that on power-up the FPGA gets configured and starts running the code from on-chip RAM. I am not able to achieve this simple goal in spite of so much effort. I have ensured the following: 1. I had followed the steps provided in the Embedded Design Handbook, namely the HAL BSP settings for booting and running from FPGA memory, ie, Table 2-6. I have set hal.linker.allow_code_at_reset to 1, and others to 0. 2. I have also set all the linker sections pointing to onchip_mem. reset, .text, .bss, etc all are pointing to onchip_mem. 3. I used the make for mem_init_generate to generate the hex file. It had used the correct base address, ie the base address of onchip_mem in Qsys. Here is the command run by SBT for generating the hex file: elf2hex cnb1.elf 0x00010000 0x0001f9ff --width=32 --little-endian-mem --create-lanes=0 mem_init/first_nios2_system_onchip_mem.hex 4. mem_init_generate had generated the hex file and even a qip file, in addition to some other files. I copied the hex and qip files to QuartusII project directory, and added the qip file to my project. I performed a full compilation. The map report where the hex file was picked up is as follows: +-------------------------------------------------------------------------------------------------------------+ ; Parameter Settings for User Entity Instance: first_nios2_system:u0|first_nios2_system_onchip_mem:onchip_mem ; +----------------+--------------------------------------+-----------------------------------------------------+ ; Parameter Name ; Value ; Type ; +----------------+--------------------------------------+-----------------------------------------------------+ ; INIT_FILE ; ../first_nios2_system_onchip_mem.hex ; String ; +----------------+--------------------------------------+-----------------------------------------------------+ It seems that the hex file has been picked up, though the "../" makes me believe that it is going one hierarchy up. Anyway when I burn this pof to EPCS, and later power-on, I don't see anything happening. Some display is supposed to be printed in the LCD screen. 5. I even went back to Qsys and set the memory initialization hex file to the one generated by NiosII SBT. Then I generated the system, and came back to QuartusII and recompiled the whole design. I can see in the map report that the correct hex file was picked up. Here is the information. +------------------------------------------------------------------------------------------------------------------+ ; Parameter Settings for User Entity Instance: first_nios2_system:u0|first_nios2_system_onchip_mem:onchip_mem ; +----------------+----------------------------------------------------------------------------------------+--------+ ; Parameter Name ; Value ; Type ; +----------------+----------------------------------------------------------------------------------------+--------+ ; INIT_FILE ; D:/Nios_designs/nios2_sys/software/cnb1/mem_init/first_nios2_system_onchip_mem.hex.hex ; String ; +----------------+----------------------------------------------------------------------------------------+--------+ Even this pof file seems to have no effect on the boot process. I don't see anything at all :-( 6. To make sure that JTAG UART was not creating any issue, I even removed it from Qsys, and performed the whole procedure again. This too had no effect on the LCD display. It just doesn't seem to work :-( 7. I even programmed the sof file (containing the hex software image as well) directly to FPGA. This also was fruitless :-( Can someone please help me out with this simple problem. thanks and regards, rajesh