Question
Definition of array in flash CoIDE (arm-none-eabi-gcc)
Posted on December 02, 2013 at 16:00
Hi there! I need to define array of fonts in flash.
I'm using STM32F417VG MCU I define it asconst u8 font1[] But compiler places it in RAM
I've found a linker file that Coocox uses to link my project.
OUTPUT_FORMAT (''elf32-littlearm'', ''elf32-bigarm'', ''elf32-littlearm'')
/* Internal Memory Map*/
MEMORY
{
rom (rx) : ORIGIN = 0x08000000, LENGTH = 0x00080000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000
ram1 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x00010000
}
_eram = 0x20000000 + 0x00020000;
/* Section Definitions */
SECTIONS
{
.text :
{
KEEP(*(.isr_vector .isr_vector.*))
*(.text .text.* .gnu.linkonce.t.*)
*(.glue_7t) *(.glue_7)
*(.rodata .rodata* .gnu.linkonce.r.*)
} > rom
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > rom
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > rom
__exidx_end = .;
. = ALIGN(4);
_etext = .;
_sidata = .;
.data : AT (_etext)
{
_sdata = .;
*(.data .data.*)
. = ALIGN(4);
_edata = . ;
} > ram
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
{
_sbss = . ;
*(.bss .bss.*)
*(COMMON)
. = ALIGN(4);
_ebss = . ;
} > ram
/* stack section */
.co_stack (NOLOAD):
{
. = ALIGN(8);
*(.co_stack .co_stack.*)
} > ram
. = ALIGN(4);
_end = . ;
}
What shoul I paste to make compiler place it in FLASH?
Directive
__attribute__ ((section(''.text''),used)) causes an ignoring warning
I tried to google all day long but found no simple answer how to do it.
Thanks
#flash-array-coide-coocox