KurtE
Senior Member+
Note this is sort-of nothing new, in that DMA access really prefers things to be at least 32 byte aligned. Which is for example why manySDRAM_EXTMEM/examples/elcdif_vga/elcdif_vga.ino at master · A-Dunstan/SDRAM_EXTMEM
Generic EXTMEM support for IMXRT1062. Contribute to A-Dunstan/SDRAM_EXTMEM development by creating an account on GitHub.github.com
LCDIF requires 64-byte aligned buffers, the extmem_malloc interface doesn't have a way to request aligned allocations... should probably fix that.
of our display drivers have something in them like:
Code:
uint8_t ILI9341_t3n::useFrameBuffer(
boolean b) // use the frame buffer? First call will allocate
{
#ifdef ENABLE_ILI9341_FRAMEBUFFER
if (b) {
// First see if we need to allocate buffer
if (_pfbtft == NULL) {
// Hack to start frame buffer on 32 byte boundary
_we_allocated_buffer = (uint16_t *)malloc(CBALLOC + 32);
if (_we_allocated_buffer == NULL)
return 0; // failed
_pfbtft = (uint16_t *)(((uintptr_t)_we_allocated_buffer + 32) &
~((uintptr_t)(31)));
memset(_pfbtft, 0, CBALLOC);
}
...