Gareth McMullin
12 years ago
committed by
Piotr Esden-Tempski
24 changed files with 295 additions and 36 deletions
@ -0,0 +1,36 @@ |
|||
includeguard: LIBOPENCM3_SAM3N_NVIC_H |
|||
partname_humanreadable: Atmel SAM3N series |
|||
partname_doxygen: SAM3N |
|||
irqs: |
|||
- supc |
|||
- rstc |
|||
- rtc |
|||
- rtt |
|||
- wdg |
|||
- pmc |
|||
- eefc0 |
|||
- reserved0 |
|||
- uart0 |
|||
- uart1 |
|||
- reserved1 |
|||
- pioa |
|||
- piob |
|||
- pioc |
|||
- usart0 |
|||
- usart1 |
|||
- reserved2 |
|||
- reserved3 |
|||
- reserved4 |
|||
- twi0 |
|||
- twi1 |
|||
- spi |
|||
- reserved5 |
|||
- tc0 |
|||
- tc1 |
|||
- tc2 |
|||
- tc3 |
|||
- tc4 |
|||
- tc5 |
|||
- adc |
|||
- dacc |
|||
- pwm |
@ -0,0 +1,60 @@ |
|||
/*
|
|||
* This file is part of the libopencm3 project. |
|||
* |
|||
* Copyright (C) 2012 Gareth McMullin <gareth@blacksphere.co.nz> |
|||
* |
|||
* This library is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Lesser General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This library is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public License |
|||
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#ifndef SAM3N_MEMORYMAP_H |
|||
#define SAM3N_MEMORYMAP_H |
|||
|
|||
#include <libopencm3/cm3/common.h> |
|||
|
|||
/* --- SAM3N peripheral space -------------------------------------------- */ |
|||
|
|||
#define SPI_BASE (0x40008000) |
|||
#define TC0_BASE (0x40010000) |
|||
#define TC1_BASE (0x40010040) |
|||
#define TC2_BASE (0x40010080) |
|||
#define TC3_BASE (0x40014000) |
|||
#define TC4_BASE (0x40014040) |
|||
#define TC5_BASE (0x40014080) |
|||
#define TWI0_BASE (0x40018000) |
|||
#define TWI1_BASE (0x4001C000) |
|||
#define PWM_BASE (0x40020000) |
|||
#define USART0_BASE (0x40024000) |
|||
#define USART1_BASE (0x40028000) |
|||
#define ADC_BASE (0x40038000) |
|||
#define DACC_BASE (0x4003C000) |
|||
|
|||
/* --- SAM3N system controller space ------------------------------------- */ |
|||
#define SMC_BASE (0x400E0000) |
|||
#define MATRIX_BASE (0x400E0200) |
|||
#define PMC_BASE (0x400E0400) |
|||
#define UART0_BASE (0x400E0600) |
|||
#define CHIPID_BASE (0x400E0740) |
|||
#define UART1_BASE (0x400E0800) |
|||
#define EEFC_BASE (0x400E0A00) |
|||
#define PIOA_BASE (0x400E0E00) |
|||
#define PIOB_BASE (0x400E1000) |
|||
#define PIOC_BASE (0x400E1200) |
|||
#define RSTC_BASE (0x400E1400) |
|||
#define SUPC_BASE (0x400E1410) |
|||
#define RTT_BASE (0x400E1430) |
|||
#define WDT_BASE (0x400E1450) |
|||
#define RTC_BASE (0x400E1460) |
|||
#define GPBR_BASE (0x400E1490) |
|||
|
|||
#endif |
@ -0,0 +1,36 @@ |
|||
##
|
|||
## This file is part of the libopencm3 project.
|
|||
##
|
|||
## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
|
|||
##
|
|||
## This library is free software: you can redistribute it and/or modify
|
|||
## it under the terms of the GNU Lesser General Public License as published by
|
|||
## the Free Software Foundation, either version 3 of the License, or
|
|||
## (at your option) any later version.
|
|||
##
|
|||
## This library is distributed in the hope that it will be useful,
|
|||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
## GNU Lesser General Public License for more details.
|
|||
##
|
|||
## You should have received a copy of the GNU Lesser General Public License
|
|||
## along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
##
|
|||
|
|||
LIBNAME = libopencm3_sam3n |
|||
|
|||
PREFIX ?= arm-none-eabi |
|||
#PREFIX ?= arm-elf
|
|||
CC = $(PREFIX)-gcc |
|||
AR = $(PREFIX)-ar |
|||
CFLAGS = -Os -g -Wall -Wextra -I../../../include -fno-common \
|
|||
-mcpu=cortex-m3 -mthumb -Wstrict-prototypes \
|
|||
-ffunction-sections -fdata-sections -MD -DSAM3N |
|||
# ARFLAGS = rcsv
|
|||
ARFLAGS = rcs |
|||
OBJS = gpio.o pmc.o usart.o |
|||
|
|||
VPATH += ../../cm3:../common |
|||
|
|||
include ../../Makefile.include |
|||
|
@ -0,0 +1,106 @@ |
|||
/* |
|||
* This file is part of the libopencm3 project. |
|||
* |
|||
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de> |
|||
* |
|||
* This library is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Lesser General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This library is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public License |
|||
* along with this library. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
/* Generic linker script for STM32 targets using libopencm3. */ |
|||
|
|||
/* Memory regions must be defined in the ld script which includes this one. */ |
|||
|
|||
/* Enforce emmition of the vector table. */ |
|||
EXTERN (vector_table) |
|||
|
|||
/* Define the entry point of the output file. */ |
|||
ENTRY(reset_handler) |
|||
|
|||
/* Define sections. */ |
|||
SECTIONS |
|||
{ |
|||
.text : { |
|||
*(.vectors) /* Vector table */ |
|||
*(.text*) /* Program code */ |
|||
. = ALIGN(4); |
|||
*(.rodata*) /* Read-only data */ |
|||
. = ALIGN(4); |
|||
} >rom |
|||
|
|||
/* C++ Static constructors/destructors, also used for __attribute__ |
|||
* ((constructor)) and the likes */ |
|||
.preinit_array : { |
|||
. = ALIGN(4); |
|||
__preinit_array_start = .; |
|||
KEEP (*(.preinit_array)) |
|||
__preinit_array_end = .; |
|||
} >rom |
|||
.init_array : { |
|||
. = ALIGN(4); |
|||
__init_array_start = .; |
|||
KEEP (*(SORT(.init_array.*))) |
|||
KEEP (*(.init_array)) |
|||
__init_array_end = .; |
|||
} >rom |
|||
.fini_array : { |
|||
. = ALIGN(4); |
|||
__fini_array_start = .; |
|||
KEEP (*(.fini_array)) |
|||
KEEP (*(SORT(.fini_array.*))) |
|||
__fini_array_end = .; |
|||
} >rom |
|||
|
|||
/* |
|||
* Another section used by C++ stuff, appears when using newlib with |
|||
* 64bit (long long) printf support |
|||
*/ |
|||
.ARM.extab : { |
|||
*(.ARM.extab*) |
|||
} >rom |
|||
.ARM.exidx : { |
|||
__exidx_start = .; |
|||
*(.ARM.exidx*) |
|||
__exidx_end = .; |
|||
} >rom |
|||
|
|||
. = ALIGN(4); |
|||
_etext = .; |
|||
|
|||
.data : { |
|||
_data = .; |
|||
*(.data*) /* Read-write initialized data */ |
|||
. = ALIGN(4); |
|||
_edata = .; |
|||
} >ram AT >rom |
|||
_data_loadaddr = LOADADDR(.data); |
|||
|
|||
.bss : { |
|||
*(.bss*) /* Read-write zero initialized data */ |
|||
*(COMMON) |
|||
. = ALIGN(4); |
|||
_ebss = .; |
|||
} >ram |
|||
|
|||
/* |
|||
* The .eh_frame section appears to be used for C++ exception handling. |
|||
* You may need to fix this if you're using C++. |
|||
*/ |
|||
/DISCARD/ : { *(.eh_frame) } |
|||
|
|||
. = ALIGN(4); |
|||
end = .; |
|||
} |
|||
|
|||
PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram)); |
|||
|
Loading…
Reference in new issue