Zase arm cortex zahada
Jaroslav Buchta
jaroslav.buchta na hascomp.cz
Úterý Listopad 19 20:51:59 CET 2013
pouzivam u STM32F103 tools 4.7-2012-q4 z
https://launchpad.net/gcc-arm-embedded - pro M4 stm32F4 zda se funguje
OK ale u teto M3 jsem narazil na problem s funkci malloc, zda se, ze se
ten problem na internetu resi, ale reseni jsem nenasel - koukam, ze uz
je novejsi verze toolchainu, zkusim, ale zatim jsem zjistil, ze pomuze
vynulovani cele pameti, coz me samozrejme neuspokojuje (ne jen
inicializace dat a nulovani bss ale cele pameti, pokud ma nejake
promenne v asm mimo sekce v ld scriptu, tak by to byl problem).
Nevi nekdo pricinu? Vlastni fce malloc je evidentne psana v assembleru,
zdrojak jsem zatim nelokalizoval a pri krokovani jsem zjistil houby...
Skript pouzivam tento - predpokladam, ze chybi nejaka sekce pro knihovny
v asm...:
*/
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20004000; /* end of 16K RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 6000; /* required amount of heap */
_Min_Stack_Size = 0x200; /* required amount of stack */
ENTRY(Reset_Handler)
MEMORY
{
rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K
ram (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
}
SECTIONS
{
.text :
{
KEEP(*(.isr_vector))
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
_exit = .;
} >rom
/* .ARM.exidx is sorted, so has to go in its own output section.*/
.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} >rom
_sidata = .; /* global needed for startup_stm3210x_md_vl.S */
/*now start ram area with initialized data section */
.data :
{
_sdata = .; /* global needed for startup_stm3210x_md_vl.S */
*(.data)
*(.data*)
. = ALIGN(4);
_edata = .; /* global needed for startup_stm3210x_md_vl.S */
} >ram AT>rom
/* uninitialized data section bss*/
.bss :
{
. = ALIGN(4);
_sbss = .; /* global needed for startup_stm3210x_md_vl.S */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* global needed for startup_stm3210x_md_vl.S */
__bss_end__ = _ebss;
} >ram
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(4);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(4);
} >ram
.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
/* Remove debug information from the standard libraries */
/DISCARD/ : {
*(.note.GNU-stack)
libc.a ( * )
libgcc.a ( * )
libm.a ( * )
}
}
Další informace o konferenci Hw-list