AnsweredAssumed Answered

How to Store Font Table in Flash with GCC?

Question asked by zhao.frank on Jul 16, 2012
Latest reply on Sep 10, 2013 by Clive One
I have a large 5x7 pixel font table that I want to store in flash memory instead of RAM memory. I am using Eclipse with the ARM GCC plugin.

I am hoping there is something similar to avr/pgmspace.h but obviously for STM32, or ARM Cortex in general.

How do I store the table in flash memory without having it reside in RAM at all?

To get started, I declared it like so

static unsigned char oled_font[] __attribute__ ((section(".text"),used)) = {
...
};

but now the challenge is, how do I access this table? do I just access it "normally" or do I need some specific flash reading functions? is "__LDREXB" what I am looking for?

Outcomes