From 0a0ca9fa81cd4f9597866178051283beb792737e Mon Sep 17 00:00:00 2001 From: Christina Quast Date: Fri, 13 Mar 2015 12:35:12 +0100 Subject: [PATCH] Add resources for gdb and gcc --- .../resources/ewarm/sam3s-ek-flash.mac | 42 ++++++ .../resources/ewarm/sam3s-ek-sram.mac | 42 ++++++ .../resources/ewarm/sam3s1/flash.icf | 28 ++++ .../resources/ewarm/sam3s1/sram.icf | 25 ++++ .../ewarm/sam3s1/sram_flashloader.icf | 33 +++++ .../resources/ewarm/sam3s2/flash.icf | 28 ++++ .../resources/ewarm/sam3s2/sram.icf | 25 ++++ .../ewarm/sam3s2/sram_flashloader.icf | 33 +++++ .../resources/ewarm/sam3s4/flash.icf | 28 ++++ .../resources/ewarm/sam3s4/sram.icf | 25 ++++ .../ewarm/sam3s4/sram_flashloader.icf | 33 +++++ .../resources/gcc/sam3s1/flash.ld | 140 ++++++++++++++++++ .../resources/gcc/sam3s1/sram.ld | 140 ++++++++++++++++++ .../resources/gcc/sam3s1/sram_samba.lds | 91 ++++++++++++ .../resources/gcc/sam3s2/flash.ld | 140 ++++++++++++++++++ .../resources/gcc/sam3s2/sram.ld | 140 ++++++++++++++++++ .../resources/gcc/sam3s2/sram_samba.lds | 91 ++++++++++++ .../resources/gcc/sam3s4/flash.ld | 140 ++++++++++++++++++ .../resources/gcc/sam3s4/sram.ld | 140 ++++++++++++++++++ .../resources/gcc/sam3s4/sram_samba.lds | 91 ++++++++++++ .../resources/gcc/sam3s_ek_flash.gdb | 31 ++++ .../resources/gcc/sam3s_ek_sram.gdb | 27 ++++ .../resources/gcc/sam3s_vb_sram.gdb | 27 ++++ 23 files changed, 1540 insertions(+) create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-flash.mac create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-sram.mac create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/flash.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram_flashloader.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/flash.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram_flashloader.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/flash.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram_flashloader.icf create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/flash.ld create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram.ld create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram_samba.lds create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/flash.ld create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram.ld create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram_samba.lds create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/flash.ld create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram.ld create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram_samba.lds create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_flash.gdb create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_sram.gdb create mode 100644 sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_vb_sram.gdb diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-flash.mac b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-flash.mac new file mode 100644 index 00000000..1b0c13d8 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-flash.mac @@ -0,0 +1,42 @@ +// --------------------------------------------------------- +// ATMEL Microcontroller Software Support - ROUSSET - +// --------------------------------------------------------- +// The software is delivered "AS IS" without warranty or +// condition of any kind, either express, implied or +// statutory. This includes without limitation any warranty +// or condition with respect to merchantability or fitness +// for any particular purpose, or against the infringements of +// intellectual property rights of others. +// --------------------------------------------------------- +// File: at91sam3s-ek-flash.mac +// User setup file for CSPY debugger. +// --------------------------------------------------------- + +/********************************************************************* +* +* execUserReset() +*/ +execUserReset() +{ + __message "------------------------------ execUserReset ---------------------------------"; + __message "-------------------------------Set PC Reset ----------------------------------"; + + __hwReset(0); + + // perpheral reset RSTC_CR + __writeMemory32(0xA5000004,0x400e1400,"Memory"); +} + +/********************************************************************* +* +* execUserPreload() +*/ +execUserPreload() +{ + __message "------------------------------ execUserPreload ---------------------------------"; + + __hwReset(0); //* Hardware Reset: CPU is automatically halted after the reset + + // perpheral reset RSTC_CR + __writeMemory32(0xA5000004,0x400e1400,"Memory"); +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-sram.mac b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-sram.mac new file mode 100644 index 00000000..d303e27c --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s-ek-sram.mac @@ -0,0 +1,42 @@ +// --------------------------------------------------------- +// ATMEL Microcontroller Software Support - ROUSSET - +// --------------------------------------------------------- +// The software is delivered "AS IS" without warranty or +// condition of any kind, either express, implied or +// statutory. This includes without limitation any warranty +// or condition with respect to merchantability or fitness +// for any particular purpose, or against the infringements of +// intellectual property rights of others. +// --------------------------------------------------------- +// File: at91sam3s-ek-sram.mac +// User setup file for CSPY debugger. +// --------------------------------------------------------- + +/********************************************************************* +* +* execUserReset() +*/ +execUserReset() +{ + __message "------------------------------ execUserReset ---------------------------------"; + __message "-------------------------------Set PC Reset ----------------------------------"; + + __hwReset(0); + + // peripheral reset RSTC_CR + __writeMemory32(0xA5000004,0x400e1400,"Memory"); +} + +/********************************************************************* +* +* execUserPreload() +*/ +execUserPreload() +{ + __message "------------------------------ execUserPreload ---------------------------------"; + + __hwReset(0); //* Hardware Reset: CPU is automatically halted after the reset + + // peripheral reset RSTC_CR + __writeMemory32(0xA5000004,0x400e1400,"Memory"); +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/flash.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/flash.icf new file mode 100644 index 00000000..53c8247e --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/flash.icf @@ -0,0 +1,28 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Vector table start*/ +define symbol __ICFEDIT_vector_start__ = 0x00400000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; +define symbol __ICFEDIT_region_ROM_start__ = 0x00400000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0040FFFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x2000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; +place in ROM_region { readonly }; +place in RAM_region { readwrite,,block CSTACK, block HEAP }; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram.icf new file mode 100644 index 00000000..183b0348 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram.icf @@ -0,0 +1,25 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Vector table start*/ +define symbol __ICFEDIT_vector_start__ = 0x20000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x2000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +/* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy with packing=none { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; +place in RAM_region { readonly, readwrite, block CSTACK, block HEAP }; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram_flashloader.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram_flashloader.icf new file mode 100644 index 00000000..8dbd4b93 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s1/sram_flashloader.icf @@ -0,0 +1,33 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x20000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x0; +define symbol __ICFEDIT_region_ROM_end__ = 0x0; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000040; +define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; + +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x0200; +define symbol __ICFEDIT_size_heap__ = 0x000; +/**** End of ICF editor section. ###ICF###*/ + + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +//initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { section .intvec }; + +place at start of RAM_region { block RamTop with fixed order {readonly, section LOWEND}}; +place at end of RAM_region { block RamBottom with fixed order {section HIGHSTART, readwrite, section .init, + block CSTACK, block HEAP}}; + + diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/flash.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/flash.icf new file mode 100644 index 00000000..d171373d --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/flash.icf @@ -0,0 +1,28 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Vector table start*/ +define symbol __ICFEDIT_vector_start__ = 0x00400000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; +define symbol __ICFEDIT_region_ROM_start__ = 0x00400000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0041FFFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x2000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; +place in ROM_region { readonly }; +place in RAM_region { readwrite,,block CSTACK, block HEAP }; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram.icf new file mode 100644 index 00000000..d9fa075a --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram.icf @@ -0,0 +1,25 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Vector table start*/ +define symbol __ICFEDIT_vector_start__ = 0x20000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x2000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +/* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; +place in RAM_region { readonly, readwrite, block CSTACK, block HEAP }; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram_flashloader.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram_flashloader.icf new file mode 100644 index 00000000..a1f566ab --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s2/sram_flashloader.icf @@ -0,0 +1,33 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x20000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x0; +define symbol __ICFEDIT_region_ROM_end__ = 0x0; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000040; +define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; + +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x0200; +define symbol __ICFEDIT_size_heap__ = 0x000; +/**** End of ICF editor section. ###ICF###*/ + + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +//initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { section .intvec }; + +place at start of RAM_region { block RamTop with fixed order {readonly, section LOWEND}}; +place at end of RAM_region { block RamBottom with fixed order {section HIGHSTART, readwrite, section .init, + block CSTACK, block HEAP}}; + + diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/flash.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/flash.icf new file mode 100644 index 00000000..2e240a6d --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/flash.icf @@ -0,0 +1,28 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Vector table start*/ +define symbol __ICFEDIT_vector_start__ = 0x00400000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; +define symbol __ICFEDIT_region_ROM_start__ = 0x00400000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0043FFFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x3000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; +place in ROM_region { readonly }; +place in RAM_region { readwrite, block CSTACK, block HEAP }; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram.icf new file mode 100644 index 00000000..e51690f2 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram.icf @@ -0,0 +1,25 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Vector table start*/ +define symbol __ICFEDIT_vector_start__ = 0x20000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x2000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +/* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy with packing=none { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; +place in RAM_region { readonly, readwrite, block CSTACK, block HEAP }; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram_flashloader.icf b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram_flashloader.icf new file mode 100644 index 00000000..a954d2cb --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/ewarm/sam3s4/sram_flashloader.icf @@ -0,0 +1,33 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x20000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x0; +define symbol __ICFEDIT_region_ROM_end__ = 0x0; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000040; +define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; + +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x0200; +define symbol __ICFEDIT_size_heap__ = 0x000; +/**** End of ICF editor section. ###ICF###*/ + + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +//initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { section .intvec }; + +place at start of RAM_region { block RamTop with fixed order {readonly, section LOWEND}}; +place at end of RAM_region { block RamBottom with fixed order {section HIGHSTART, readwrite, section .init, + block CSTACK, block HEAP}}; + + diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/flash.ld b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/flash.ld new file mode 100644 index 00000000..b6c5428f --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/flash.ld @@ -0,0 +1,140 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal FLASH on the ATSAM3S1 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00010000 /* Flash, 64K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00004000 /* sram, 16K */ +} + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > rom + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + *(.stack .stack.*) + } > ram + + . = ALIGN(4); + _end = . ; +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram.ld b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram.ld new file mode 100644 index 00000000..22b170a1 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram.ld @@ -0,0 +1,140 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the ATSAM3S1 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00010000 /* Flash, 64K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00004000 /* sram, 16K */ +} + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > ram + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + *(.stack .stack.*) + } > ram + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > ram + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _end = . ; +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram_samba.lds b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram_samba.lds new file mode 100644 index 00000000..0f87ad34 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s1/sram_samba.lds @@ -0,0 +1,91 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the AT91SAM3S1 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(entry) + +/* Memory Spaces Definitions */ +MEMORY +{ + romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0800 + sram (W!RX) : ORIGIN = 0x20000800, LENGTH = 0x00003800 /* sram, 16K - sizeof(romcodesram) */ +} + +/* Entry point */ +/*ENTRY (ResetException)*/ + +SECTIONS +{ + /* startup code in the .isr_vector */ + .text : + { + . = ALIGN(4); + _stext = .; + KEEP(*(.isr_vector .isr_vector.*)) + *(.mailbox) + *(.text .text.*) + *(.rodata .rodata.*) + *(.glue_7) + *(.glue_7t) + *(.gcc_except_table) + *(.rodata .rodata*) + *(.gnu.linkonce.r.*) + . = ALIGN(4); + _etext = .; + } > sram + + /* data */ + .data : + { + . = ALIGN(4); + _sidata = .; + _sdata = .; + + *(.data) + *(.data.*) + . = ALIGN(4); + _edata = .; + } > sram + + .bss (NOLOAD) : { + _szero = .; + *(.bss) + . = ALIGN(4); + _ezero = .; + } >sram + + /* Stack in SRAM */ + _sstack = 0x20003FFC; +} +end = .; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/flash.ld b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/flash.ld new file mode 100644 index 00000000..22cfe59d --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/flash.ld @@ -0,0 +1,140 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal FLASH on the ATSAM3S2 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00020000 /* flash, 128K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* sram, 32K */ +} + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > rom + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + *(.stack .stack.*) + } > ram + + . = ALIGN(4); + _end = . ; +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram.ld b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram.ld new file mode 100644 index 00000000..8c14ac65 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram.ld @@ -0,0 +1,140 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the ATSAM3S2 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT ("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00020000 /* flash, 128K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* sram, 32K */ +} + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > ram + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + *(.stack .stack.*) + } > ram + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > ram + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _end = . ; +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram_samba.lds b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram_samba.lds new file mode 100644 index 00000000..00040c85 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s2/sram_samba.lds @@ -0,0 +1,91 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the AT91SAM3S2 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(entry) + +/* Memory Spaces Definitions */ +MEMORY +{ + romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0800 + sram (W!RX) : ORIGIN = 0x20000800, LENGTH = 0x00007800 /* sram, 32K - sizeof(romcodesram) */ +} + +/* Entry point */ +/*ENTRY (ResetException)*/ + +SECTIONS +{ + /* startup code in the .isr_vector */ + .text : + { + . = ALIGN(4); + _stext = .; + KEEP(*(.isr_vector .isr_vector.*)) + *(.mailbox) + *(.text .text.*) + *(.rodata .rodata.*) + *(.glue_7) + *(.glue_7t) + *(.gcc_except_table) + *(.rodata .rodata*) + *(.gnu.linkonce.r.*) + . = ALIGN(4); + _etext = .; + } > sram + + /* data */ + .data : + { + . = ALIGN(4); + _sidata = .; + _sdata = .; + + *(.data) + *(.data.*) + . = ALIGN(4); + _edata = .; + } > sram + + .bss (NOLOAD) : { + _szero = .; + *(.bss) + . = ALIGN(4); + _ezero = .; + } >sram + + /* Stack in SRAM */ + _sstack = 0x20007FFC; +} +end = .; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/flash.ld b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/flash.ld new file mode 100644 index 00000000..c47a2c50 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/flash.ld @@ -0,0 +1,140 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal FLASH on the ATSAM3S4 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00040000 /* flash, 256K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x0000c000 /* sram, 48K */ +} + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > rom + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + *(.stack .stack.*) + } > ram + + . = ALIGN(4); + _end = . ; +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram.ld b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram.ld new file mode 100644 index 00000000..9c687555 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram.ld @@ -0,0 +1,140 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the ATSAM3S4 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00040000 /* flash, 256K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x0000c000 /* sram, 48K */ +} + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > ram + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + *(.stack .stack.*) + } > ram + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > ram + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _end = . ; +} diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram_samba.lds b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram_samba.lds new file mode 100644 index 00000000..16b1dc96 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s4/sram_samba.lds @@ -0,0 +1,91 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the AT91SAM3S4 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(entry) + +/* Memory Spaces Definitions */ +MEMORY +{ + romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x01000 + sram (W!RX) : ORIGIN = 0x20001000, LENGTH = 0x0000B000 /* sram, 48K - sizeof(romcodesram) */ +} + +/* Entry point */ +/*ENTRY (ResetException)*/ + +SECTIONS +{ + /* startup code in the .isr_vector */ + .text : + { + . = ALIGN(4); + _stext = .; + KEEP(*(.isr_vector .isr_vector.*)) + *(.mailbox) + *(.text .text.*) + *(.rodata .rodata.*) + *(.glue_7) + *(.glue_7t) + *(.gcc_except_table) + *(.rodata .rodata*) + *(.gnu.linkonce.r.*) + . = ALIGN(4); + _etext = .; + } > sram + + /* data */ + .data : + { + . = ALIGN(4); + _sidata = .; + _sdata = .; + + *(.data) + *(.data.*) + . = ALIGN(4); + _edata = .; + } > sram + + .bss (NOLOAD) : { + _szero = .; + *(.bss) + . = ALIGN(4); + _ezero = .; + } >sram + + /* Stack in SRAM */ + _sstack = 0x2000BFFC; +} +end = .; diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_flash.gdb b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_flash.gdb new file mode 100644 index 00000000..7d796157 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_flash.gdb @@ -0,0 +1,31 @@ +#******************************************************* +# +# Connect to J-Link and debug application in flash. +# + +# define 'reset' command +define reset + +# Connect to the J-Link gdb server +target remote localhost:2331 +# Reset the chip to get to a known state +monitor reset + +# Select flash device +monitor flash device = AT91SAM3S4C +# Enable flash download and flash breakpoints +monitor flash download = 1 +# Load the program +load + +# Reset peripheral (RSTC_CR) +set *0x400e1400 = 0xA5000004 + +# Initializing PC and stack pointer +mon reg sp=(0x400000) +set *0x400004 = *0x400004 & 0xFFFFFFFE +mon reg pc=(0x400004) +info reg + +# end of 'reset' command +end diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_sram.gdb b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_sram.gdb new file mode 100644 index 00000000..019bd0a9 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_ek_sram.gdb @@ -0,0 +1,27 @@ +#************************************************* +# +# Connect to J-Link and debug application in sram on SAM3S +# +# Note: +# First, users should modify Step1 and Step2 according to their project, +# then do Step3. + +# Step1: Connect to the J-Link gdb server +define reset +target remote localhost:2331 +monitor reset + +# Step2: Load file(eg. getting-started project) +load + +# Step3: Reset peripheral (RSTC_CR) +set *0x400e1400 = 0xA5000004 + +# Step4: Initializing PC and stack pointer +# Modify pc value to even before writing pc register +mon reg sp=(0x20000000) +set *0x20000004 = *0x20000004 & 0xFFFFFFFE +mon reg pc=(0x20000004) +info reg + +end diff --git a/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_vb_sram.gdb b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_vb_sram.gdb new file mode 100644 index 00000000..019bd0a9 --- /dev/null +++ b/sam3s_example/atmel_softpack_libraries/libboard_sam3s-ek/resources/gcc/sam3s_vb_sram.gdb @@ -0,0 +1,27 @@ +#************************************************* +# +# Connect to J-Link and debug application in sram on SAM3S +# +# Note: +# First, users should modify Step1 and Step2 according to their project, +# then do Step3. + +# Step1: Connect to the J-Link gdb server +define reset +target remote localhost:2331 +monitor reset + +# Step2: Load file(eg. getting-started project) +load + +# Step3: Reset peripheral (RSTC_CR) +set *0x400e1400 = 0xA5000004 + +# Step4: Initializing PC and stack pointer +# Modify pc value to even before writing pc register +mon reg sp=(0x20000000) +set *0x20000004 = *0x20000004 & 0xFFFFFFFE +mon reg pc=(0x20000004) +info reg + +end