Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

NIOS II hex-File for On-Chip_Mem

Hello,

i am using an NIOS II /e Core with a On-Chip Memory.

The .hex-File is generated using the Make_mem_init_install of the Eclipse IDE.

After creating the hex-File i select "Update mif-Files" in the Quartus II IDE. Quartus reports, that the file addesses are not correct:

"Critical Warning: Memory contents are already initialized at the specified addresses. Overwriting data."

When i look at the hex-File the addresses in every line are incremented by 8, but there are 32Byte of Data in every line !?!

Do i need to change my conversion settings or something?

Thanks in advance,

Paddy

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    how you creating HEX file? manually? I do no use Eclipse mode, but using NIOS IDE onchip_mem.hex file is created automatically in the same work directory where other project files are placed.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    i am creating the hex-File by clicking right on my Eclipse-project, selecting "make target" and using the "make_mem_init_install" target. The hex-File is then generated in gthe Project directory.

    I attached the hex-File to this post.

    Thanks Paddy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yeah that's definitely not correct.

    Inside your BSP directory there should be a mem_init.mk file. Can you attach that? Also, you may want to look at the console in the IDE when you run the make mem_init_install and see what is actually being executed.

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    i attached the file you requested. Currently i am not able to look at the console, because the program is not ready to compile. I will look at the console output when my programm is compileable again.

    Thanks Paddy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    here are teh lines which the console puts out when creating the files:

    Post-processing to create mem_init/NIOSCoreMem.hex...

    elf2hex NIOSCoreProcessor.elf 0x00008000 0x0000ffff --width=32

    --little-endian-mem --create-lanes=0 mem_init/NIOSCoreMem.hex

    Post-processing to create mem_init/hdl_sim/NIOSCoreMem.dat...

    elf2dat --infile=NIOSCoreProcessor.elf --outfile=mem_init/hdl_sim/NIOSCoreMem.dat

    --base=0x00008000 --end=0x0000ffff --width=32

    --little-endian-mem --create-lanes=0

    Post-processing to create mem_init/hdl_sim/NIOSCoreMem.sym...

    nios2-elf-nm -n NIOSCoreProcessor.elf > mem_init/hdl_sim/NIOSCoreMem.sym

    Paddy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'd try to find out what the --width and --create-lanes options mean.

    It might be that you are generating a file for 32bit word addressed memory.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    now I found out the reason why the problem occurs: The .hex-File is a Intel32 hex-file, so 4 Data Bytes are located at one address. I dont know why Quartus gives out a warning, but the file is correct. The Word-Size can be set in the width Parameter. If width = 8 then one Data Byte is located at one address. If i set the record Parameter to 4 (always 4 Data Bytes per row) no warning occurs...

    Thanks to all,

    Paddy