Problem with converting files
Hi! I need to create double buffer in my NIOS II project. I did it as follow:
static const uint32_t image_width = 768; static const uint32_t image_height = 576; typedef uint32_t gui_frame_t[image_width * image_height]; gui_frame_t __attribute__ ((section (".video_buffer"))) gui_frames[2];
This buffer have to locate in the DDR memory. I created a new linker section for that with following settings:
Also I added NOLOAD directive for this section to the linker.x file.
.video_buffer (NOLOAD) : { PROVIDE (_alt_partition_video_buffer_start = ABSOLUTE(.)); *(.video_buffer .video_buffer.*) . = ALIGN(4); PROVIDE (_alt_partition_video_buffer_end = ABSOLUTE(.)); } > ddr2_controller_top
After compiling the project I got an elf file of a fairly large size.
I got more detailed information about elf file section using readelf utility.
I was planning to use memcpy-based boot copier to load NIOS II application to DDR memory. I tried to convert elf file to ihex file using following bash script.
#! /bin/sh # $1 - Path to *.sof # $2 - Path to *.elf sof2flash --input $1 --output hw.flash --epcq128 --verbose elf2flash --input $2 --output sw.flash --epcs -A hw.flash --verbose nios2-elf-objcopy -I srec -O ihex sw.flash sw.hex
I was confused by the size of hex file.
Then I tried to convert my .sof and .hex file to .jic, I got a problem. The problem was that size of files in EPCQ128A exeeded memory capacity.
The image below describes settings for files conversion
How to avoid space allocation in hex file for .video_buffer section? Why for the section .bss is not allocated additional space in the hex file?