• AVR Freaks

Helpful ReplyHot!Link error when modifying graphics example

Author
regh
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/11/26 01:37:13
  • Location: 0
  • Status: offline
2021/01/15 09:33:32 (permalink)
0

Link error when modifying graphics example

Hi
 
I'm trying to modify the legato_adventure from the gfx_apps_pic32mz_ef examples. I'm starting with the lcc_rgb_565_mxt_mzef_cu project to get an lcc display set up. The original example is set for a 480x270 RGB565 display, I want to set it up for a 800x480 RGB332 display (I've been told through a separate support ticket that pic32mz2048XXXXXX should support this).
When I change the display settings in GFX Core Settings to 800x480 size and data width to 8 I get the following build error (after generating the new harmony files):
 
build/lcc_rgb565_mxt_mzef_cu/production/_ext/163229894/legato_renderer.o: Link Error: Could not allocate section .bss._dataBuffers._dataBuffers, size = 49152 bytes, attributes = bss coherent
build/lcc_rgb565_mxt_mzef_cu/production/_ext/163229894/legato_renderer.o: Link Error: Could not allocate section .bss._dataBuffers._dataBuffers, size = 49152 bytes, attributes = bss coherent
Link Error: Could not allocate data memory
 
Note that the rbg565 is there because I haven't changed the project name.
 
I know this is to do with memory allocation but can't find the correct settings in either harmony, graphics composer, or project settings to fix this. The original example file builds fine.
 
I'm using MPLAB X v5.45, Harmony v3.62 and trying to build for Pic32MZ Curiosity 2.0 dev board.
Any advice on how to fix this is appreciated
Thanks. 
#1
MHGC
Super Member
  • Total Posts : 259
  • Reward points : 0
  • Status: offline
Re: Link error when modifying graphics example 2021/01/15 09:41:03 (permalink)
4 (1)
Hi,
 
RGB565 is 2 bytes per pixel.
 
LCC requires a full internal frame buffer.  The frame buffer for 800x480 display is 800 x 480 x 2 bytes per pixel =  768000 bytes.  That is greater than the 512k bytes of available internal SRAM on the pic32mz2048XXXXXX series. 
 
The error is the compiler's way of saying it.
 
On top of frame buffer memory, Legato requires memory for a scratch buffer, image decoders and a fixed pool for managing widgets and screen properties. 
#2
regh
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/11/26 01:37:13
  • Location: 0
  • Status: offline
Re: Link error when modifying graphics example 2021/01/15 09:47:48 (permalink)
0
Thanks for your quick response.
I know that running 800x480 at RGB565 is not possible which is why I was trying to set it up with RGB 332 (375 KB). The lower colour width was recommended by the support team at microchip so that I didn't need to use an external buffer, are you saying that it is not possible to run LCC in RGB332?
#3
MHGC
Super Member
  • Total Posts : 259
  • Reward points : 0
  • Status: offline
Re: Link error when modifying graphics example 2021/01/15 11:04:21 (permalink) ☄ Helpfulby regh 2021/01/18 04:08:35
0
The LCC driver is written to support 16-bit DMA output.  It does not support RGB332.
 
The PIC32MZ EF Curiosity 2.0 board and the driver interface board are mapped for 16-bit output to the display interface. 

To support RGB332, you will need to do the following:
1) Configure the DMA for 8-bit transfer
2) Modify the LCC driver with 8-bit frame buffer instead of 16-bit
3) Swizzle the 8-bit RGB332 output to the 16-bit RGB565 output on the board-to-display interface
 
It sounds to me what you are really looking at is frame buffer size reduction.  I think the feature you really need is 8-bit LUT support on LCC.  8-bit LUT would allow a frame buffer to fit without the need to modify wiring on the output interface.  Despite only having 256 colors, it will support the full RGB565 color gamut.

Does that sound right?
#4
regh
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/11/26 01:37:13
  • Location: 0
  • Status: offline
Re: Link error when modifying graphics example 2021/01/18 04:08:26 (permalink)
0
I'm not entirely sure I follow what you're suggesting.
 
For DMA, from what I can see Harmony doesn't offer any options to configure this for the pic32mz. To set it to 8bit, is it a case of setting the size registers DCH0SSIZ = 1, DCH0DSIZ = 1, and DCH0CSIZ = 1 in an initialisation function, or is there more to it than that?
 
Modifying LCC driver - I think I understand what you are saying here, create a new driver based on the existing Harmony LCC code but for 8-bit buffers (I'm sure there is more to it than that but won't find out till I actually try it).
 
I don't mind having to do some rewiring to get the display working - we are only testing the display on the curiosity dev board and will make our own custom board for the product soon so have more control on pin connections.
 
After modifying the LCC driver, is there a way to make this as a harmony driver? If not, what will be the impact with the other components involved in the graphics generation (EBI, legato etc)? Will they all still be connected appropriately or do those components then have to be taken out of harmony and moved into my main project source code (i.e. the code that isn't automatically generated by Harmony)?
#5
Jump to:
© 2021 APG vNext Commercial Version 4.5