Skip to content

Statically allocate frame buffers.#17

Draft
cmair wants to merge 1 commit into
JuPfu:mainfrom
cmair:cm/static_buffers
Draft

Statically allocate frame buffers.#17
cmair wants to merge 1 commit into
JuPfu:mainfrom
cmair:cm/static_buffers

Conversation

@cmair
Copy link
Copy Markdown
Contributor

@cmair cmair commented May 31, 2026

Static allocations allow the linker to check for possible memory overruns on big displays.

Note: this does not guarantee there's enough memory for the application, other parts could still try to allocate dynamic memory and fail.

Static allocations allow the linker to check for possible memory overruns
on big  displays.

Note: this does not guarantee there's enough memory for the application,
other parts could still try to allocate dynamic memory and fail.
@JuPfu
Copy link
Copy Markdown
Owner

JuPfu commented Jun 1, 2026

Hi Cristoph,

when using DMA, it is advisable to ensure 4-byte alignment (word alignment). I just looked it up—this can be achieved by adding the aligned attribute to the modified instructions (see example).

static uint8_t frame_buffer1[(TOTAL_PIXELS >> 1) * bcm_sequence_length] __attribute__((aligned(4)));

Kind regards,
Jürgen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants