Skip to content

Added support for SAMG55 #1627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Apr 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e996116
* Base Commit for SAMG55J19. No errors and no implementations.
akhilpanayamparambil Nov 18, 2015
15e82f9
* Added gpio files.
akhilpanayamparambil Nov 18, 2015
34073fc
* Added pinmap files.
akhilpanayamparambil Nov 18, 2015
612bdf8
* Base commit for usticker implementation.
akhilpanayamparambil Nov 19, 2015
1685bdf
* Added gcc_arm export functionality
akhilpanayamparambil Nov 20, 2015
8eff960
* added files for usticker.
akhilpanayamparambil Nov 23, 2015
04a21b7
* GPIO IRQ base commit.
akhilpanayamparambil Nov 23, 2015
2bfeb00
* updated with changes in gpio irq driver.
akhilpanayamparambil Nov 24, 2015
41e40b0
* Reverted back unexpected commit in SAM0 gpio driver.
akhilpanayamparambil Nov 24, 2015
31a06fb
* updated gpio_irq driver.
akhilpanayamparambil Nov 25, 2015
7ac1cd2
* correction in gpio and gpio_irq drivers.
akhilpanayamparambil Nov 25, 2015
655bc33
* base commit for peripheralpins for usart.
akhilpanayamparambil Nov 26, 2015
6fd30f9
* updated serial apis.
akhilpanayamparambil Nov 27, 2015
74d0b86
* updated serial apis and test.
akhilpanayamparambil Nov 28, 2015
86e8121
* update serial apis for asynch apis.
akhilpanayamparambil Nov 28, 2015
dbaacd5
* updated peripheral pins for i2c and spi.
akhilpanayamparambil Nov 30, 2015
31c37b3
* Base commit for low power ticker implementation.
akhilpanayamparambil Nov 30, 2015
9c74fa6
* base commit for port apis.
akhilpanayamparambil Dec 1, 2015
30d121f
* Added test support for port.
akhilpanayamparambil Dec 1, 2015
77164df
* base commit for sleep apis.
akhilpanayamparambil Dec 2, 2015
1385e6b
* Base commit for spi.
akhilpanayamparambil Dec 3, 2015
05e0874
* updated with corrections in gpio irq.
akhilpanayamparambil Dec 10, 2015
2fae768
* updated with corrections for unexpected board reset.
akhilpanayamparambil Dec 10, 2015
d48a57c
* updated sleep api for deepsleep.
akhilpanayamparambil Dec 11, 2015
ea892d8
* updated serial apis.
akhilpanayamparambil Dec 15, 2015
e16c8d3
Added uc_ticker and SPI api implementations
Dec 18, 2015
75a8b2b
Removed unused SPI pin map
Dec 18, 2015
ac1c22c
Updated review feedback
Dec 21, 2015
2c80d96
* implemented lpticker with TC module.
akhilpanayamparambil Dec 21, 2015
39c5b7b
* Base commit for AnalogueIn apis.
akhilpanayamparambil Dec 23, 2015
ac6a8a8
* RTC apis base commit without implementation.
akhilpanayamparambil Dec 23, 2015
9723401
* Updated with corrections in lpticker implementations.
akhilpanayamparambil Dec 23, 2015
67dcdf1
* Added implementation for rtc apis.
akhilpanayamparambil Jan 5, 2016
4d9449d
* updated with implementations for pwm.
akhilpanayamparambil Jan 12, 2016
8ae8af2
Added I2C support
Jan 13, 2016
a4213ae
* removed setvector usage from usticker and lpticker implementations
akhilpanayamparambil Jan 13, 2016
7e3b2a9
* Removed unwanted .o and .d files.
akhilpanayamparambil Jan 19, 2016
80410e2
* Removed unwanted headers file inclusion.
akhilpanayamparambil Jan 20, 2016
ab6a36f
* Updated ADC with 16 bit mode initialization and code refinements.
akhilpanayamparambil Jan 27, 2016
a4cf931
Updated I2C review feedback and fixed style
Feb 16, 2016
5384a12
Updated target name for SAMG55
Feb 16, 2016
7c78ac0
* Added Test Support for I2C with AT30TSE75X and Added Support for SA…
akhilpanayamparambil Mar 4, 2016
0da5f32
* Added Test Support for I2C with AT30TSE75X and Added Support for SA…
akhilpanayamparambil Mar 4, 2016
d32cd81
Used NVIC_SetVector for interrupt callback
Mar 4, 2016
5d3a786
Removed Target macro define in test
Mar 4, 2016
dfc7f98
Updated test cases to have SAMG55 support
Mar 4, 2016
cc90eb9
* Updated with corrections in Serial and SPI asynchronous implementat…
akhilpanayamparambil Mar 21, 2016
75eb5e4
* updated with corrections in I2C Asynch implementation.
akhilpanayamparambil Mar 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libraries/mbed/hal/i2c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "device.h"
#include "buffer.h"
#include "dma_api.h"

#if DEVICE_I2C

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
SEARCH_DIR(.)

/* Memory Spaces Definitions */
MEMORY {
rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00080000
ram (rwx) : ORIGIN = 0x20000000 + 0x108, LENGTH = 0x00028000 - 0x108
}

/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x3000;

/* 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(4);
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

.heap (NOLOAD) :
{
. = ALIGN(4);
__end__ = . ;
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
} > ram

/* stack section */
.stack (NOLOAD):
{
. = ALIGN(8);
_sstack = .;
. = . + STACK_SIZE;
. = ALIGN(8);
_estack = .;
} > ram

. = ALIGN(4);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
/**
* \file
*
* \brief Startup file for SAMG55.
*
* Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* 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
* EXPRESSLY AND SPECIFICALLY 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.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/

#include "samg55.h"

#if __FPU_USED /* CMSIS defined value to indicate usage of FPU */
#include "fpu.h"
#endif

/* Initialize segments */
extern uint32_t _sfixed;
extern uint32_t _efixed;
extern uint32_t _etext;
extern uint32_t _srelocate;
extern uint32_t _erelocate;
extern uint32_t _szero;
extern uint32_t _ezero;
extern uint32_t _sstack;
extern uint32_t _estack;

/** \cond DOXYGEN_SHOULD_SKIP_THIS */
int main(void);
/** \endcond */

void __libc_init_array(void);

/* Default empty handler */
void Dummy_Handler(void);

/* Cortex-M4 core handlers */
void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void MemManage_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void DebugMon_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));

/* Peripherals handlers */
void SUPC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void RSTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void RTT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PMC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void EFC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
#ifdef _SAMG55_FLEXCOM7_INSTANCE_
void FLEXCOM7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
#endif /* _SAMG55_FLEXCOM7_INSTANCE_*/
void FLEXCOM0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void FLEXCOM1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PIOA_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PIOB_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PDMIC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void FLEXCOM2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void MEM2MEM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void I2SC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void I2SC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PDMIC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void FLEXCOM3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void FLEXCOM4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void FLEXCOM5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void FLEXCOM6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void TC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void TC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void TC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void ADC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void ARM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void UHP_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void UDP_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void CRCCU_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));

/* Exception Table */
__attribute__ ((section(".vectors")))
const DeviceVectors exception_table = {

/* Configure Initial Stack Pointer, using linker-generated symbols */
.pvStack = (void*) (&_estack),

.pfnReset_Handler = (void*) Reset_Handler,
.pfnNMI_Handler = (void*) NMI_Handler,
.pfnHardFault_Handler = (void*) HardFault_Handler,
.pfnMemManage_Handler = (void*) MemManage_Handler,
.pfnBusFault_Handler = (void*) BusFault_Handler,
.pfnUsageFault_Handler = (void*) UsageFault_Handler,
.pfnReserved1_Handler = (void*) (0UL), /* Reserved */
.pfnReserved2_Handler = (void*) (0UL), /* Reserved */
.pfnReserved3_Handler = (void*) (0UL), /* Reserved */
.pfnReserved4_Handler = (void*) (0UL), /* Reserved */
.pfnSVC_Handler = (void*) SVC_Handler,
.pfnDebugMon_Handler = (void*) DebugMon_Handler,
.pfnReserved5_Handler = (void*) (0UL), /* Reserved */
.pfnPendSV_Handler = (void*) PendSV_Handler,
.pfnSysTick_Handler = (void*) SysTick_Handler,

/* Configurable interrupts */
.pfnSUPC_Handler = (void*) SUPC_Handler, /* 0 Supply Controller */
.pfnRSTC_Handler = (void*) RSTC_Handler, /* 1 Reset Controller */
.pfnRTC_Handler = (void*) RTC_Handler, /* 2 Real Time Clock */
.pfnRTT_Handler = (void*) RTT_Handler, /* 3 Real Time Timer */
.pfnWDT_Handler = (void*) WDT_Handler, /* 4 Watchdog Timer */
.pfnPMC_Handler = (void*) PMC_Handler, /* 5 Power Management Controller */
.pfnEFC_Handler = (void*) EFC_Handler, /* 6 Enhanced Flash Controller */
#ifdef _SAMG55_FLEXCOM7_INSTANCE_
.pfnFLEXCOM7_Handler = (void*) FLEXCOM7_Handler, /* 7 FLEXCOM 7 */
#else
.pvReserved7 = (void*) (0UL), /* 7 Reserved */
#endif /* _SAMG55_FLEXCOM7_INSTANCE_ */
.pfnFLEXCOM0_Handler = (void*) FLEXCOM0_Handler, /* 8 FLEXCOM 0 */
.pfnFLEXCOM1_Handler = (void*) FLEXCOM1_Handler, /* 9 FLEXCOM 1 */
.pvReserved10 = (void*) (0UL), /* 10 Reserved */
.pfnPIOA_Handler = (void*) PIOA_Handler, /* 11 Parallel I/O Controller A */
.pfnPIOB_Handler = (void*) PIOB_Handler, /* 12 Parallel I/O Controller B */
.pfnPDMIC0_Handler = (void*) PDMIC0_Handler, /* 13 PDM 0 */
.pfnFLEXCOM2_Handler = (void*) FLEXCOM2_Handler, /* 14 FLEXCOM2 */
.pfnMEM2MEM_Handler = (void*) MEM2MEM_Handler, /* 15 MEM2MEM */
.pfnI2SC0_Handler = (void*) I2SC0_Handler, /* 16 I2SC0 */
.pfnI2SC1_Handler = (void*) I2SC1_Handler, /* 17 I2SC1 */
.pfnPDMIC1_Handler = (void*) PDMIC1_Handler, /* 18 PDM 1 */
.pfnFLEXCOM3_Handler = (void*) FLEXCOM3_Handler, /* 19 FLEXCOM3 */
.pfnFLEXCOM4_Handler = (void*) FLEXCOM4_Handler, /* 20 FLEXCOM4 */
.pfnFLEXCOM5_Handler = (void*) FLEXCOM5_Handler, /* 21 FLEXCOM5 */
.pfnFLEXCOM6_Handler = (void*) FLEXCOM6_Handler, /* 22 FLEXCOM6 */
.pfnTC0_Handler = (void*) TC0_Handler, /* 23 Timer/Counter 0 */
.pfnTC1_Handler = (void*) TC1_Handler, /* 24 Timer/Counter 1 */
.pfnTC2_Handler = (void*) TC2_Handler, /* 25 Timer/Counter 2 */
.pfnTC3_Handler = (void*) TC3_Handler, /* 26 Timer/Counter 3 */
.pfnTC4_Handler = (void*) TC4_Handler, /* 27 Timer/Counter 4 */
.pfnTC5_Handler = (void*) TC5_Handler, /* 28 Timer/Counter 5 */
.pfnADC_Handler = (void*) ADC_Handler, /* 29 Analog To Digital Converter */
.pfnARM_Handler = (void*) ARM_Handler, /* 30 FPU */
.pvReserved31 = (void*) (0UL), /* 31 Reserved */
.pvReserved32 = (void*) (0UL), /* 32 Reserved */
.pvReserved33 = (void*) (0UL), /* 33 Reserved */
.pvReserved34 = (void*) (0UL), /* 34 Reserved */
.pvReserved35 = (void*) (0UL), /* 35 Reserved */
.pvReserved36 = (void*) (0UL), /* 36 Reserved */
.pvReserved37 = (void*) (0UL), /* 37 Reserved */
.pvReserved38 = (void*) (0UL), /* 38 Reserved */
.pvReserved39 = (void*) (0UL), /* 39 Reserved */
.pvReserved40 = (void*) (0UL), /* 40 Reserved */
.pvReserved41 = (void*) (0UL), /* 41 Reserved */
.pvReserved42 = (void*) (0UL), /* 42 Reserved */
.pvReserved43 = (void*) (0UL), /* 43 Reserved */
.pvReserved44 = (void*) (0UL), /* 44 Reserved */
.pvReserved45 = (void*) (0UL), /* 45 Reserved */
.pvReserved46 = (void*) (0UL), /* 46 Reserved */
.pfnUHP_Handler = (void*) UHP_Handler, /* 47 USB OHCI */
.pfnUDP_Handler = (void*) UDP_Handler, /* 48 USB Device FS */
.pfnCRCCU_Handler = (void*) CRCCU_Handler /* 49 CRCCU */
};

/* TEMPORARY PATCH FOR SCB */
#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */
#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */

/**
* \brief This is the code that gets called on processor reset.
* To initialize the device, and call the main() routine.
*/
void Reset_Handler(void)
{
uint32_t *pSrc, *pDest;

/* Initialize the relocate segment */
pSrc = &_etext;
pDest = &_srelocate;

if (pSrc != pDest) {
for (; pDest < &_erelocate;) {
*pDest++ = *pSrc++;
}
}

/* Clear the zero segment */
for (pDest = &_szero; pDest < &_ezero;) {
*pDest++ = 0;
}

/* Set the vector table base address */
pSrc = (uint32_t *) & _sfixed;
SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);

#if __FPU_USED
fpu_enable();
#endif

if (((uint32_t) pSrc >= IRAM_ADDR) && ((uint32_t) pSrc < IRAM_ADDR + IRAM_SIZE)) {
SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos;
}

/* Initialize the C library */
__libc_init_array();

/* Branch to main function */
main();

/* Infinite loop */
while (1);
}

/**
* \brief Default interrupt handler for unused IRQs.
*/
void Dummy_Handler(void)
{
while (1) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* mbed Microcontroller Library - CMSIS
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
*
* A generic CMSIS include header, pulling in samd21j18a specifics
*/

#ifndef MBED_CMSIS_H
#define MBED_CMSIS_H

#include "samg55.h"
#include "cmsis_nvic.h"

#endif
Loading