- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, sorry for the late response
We are trying to debug your issue but we need some files.
Can you share with us your Sopcinfo and your Qsys? To do more debug on this.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello RSher11,
I'm looking into your issue.
You can try these next steps and tell me what's happen?
1) add a new region called .video_buffer and assign it to the emif linker region / memory device name (they have already done this)
2) in the lower section of the window: Linker Memory Regions, click Add and give the name of the new region video_buffer with a memory device name set to emif
3) adjust the size of the original emif (I reduced it in half) and set the video buffer depth to half of what I had available
4) after building the bsp, and writing a simple hello_world program to intialize the video buffer and print it out, my elf size is approx 6KB
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Isaac_V_Intel,
Sorry for the late response. I tried to create small test project on your recommendation. It worked. But when I tried to use your solution in my working project I got that issue again.
I attached some additional information about program size for my test and working project respectively.
Info: (my_project.elf) 3548 KBytes program size (code + initialized data).
Info: 65436 KBytes free for stack + heap.
Info: (my_project.elf) 13386 KBytes program size (code + initialized data).
Info: 63801 KBytes free for stack + heap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
One question how did you declare your video buffer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I described video buffer creation process in my first post in this thread.
And I still have the issue and I try to solve it. I have one decision to allocate video buffer in the heap using malloc() without any additional sections.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, did you find the solution or you still have the issue?
Regards.
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page