1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

[sam] daily commit: EWARM project working, GCC compiling but fail due to missing match for Reset_Handler

This commit is contained in:
Thibaut VIARD
2011-09-09 19:15:21 +02:00
parent 3916472a36
commit 79ee7a1f6a
61 changed files with 4493 additions and 857 deletions

View File

@ -2,7 +2,7 @@
.SUFFIXES: .o .a .c .s
SUB_MAKEFILES=debug.mk gcc.mk release.mk win.mk sam3s.mk
LIBNAME=libchip
LIBNAME=libsam
TOOLCHAIN=gcc
ifeq ($(CHIP),)
@ -39,7 +39,7 @@ CHIP_SERIE=sam3xa
else
endif
CMSIS_CHIP_PATH=$(PROJECT_BASE_PATH)/../cmsis/$(CHIP_SERIE)
CMSIS_CHIP_PATH=$(PROJECT_BASE_PATH)/cmsis/$(CHIP_SERIE)
#-------------------------------------------------------------------------------
# Files
@ -88,8 +88,8 @@ OUTPUT_PATH=$(OUTPUT_OBJ)_$(CHIP_NAME)
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/source/*.c)
C_SRC+=$(wildcard $(CMSIS_CHIP_PATH)/*.c)
C_SRC+=$(wildcard $(CMSIS_CHIP_PATH)/gcc*.c)
C_SRC+=$(wildcard $(CMSIS_CHIP_PATH)/source/templates/*.c)
C_SRC+=$(wildcard $(CMSIS_CHIP_PATH)/source/templates/gcc/*.c)
C_OBJ_TEMP=$(patsubst %.c, %.o, $(notdir $(C_SRC)))
@ -102,7 +102,6 @@ C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
# Assembler source files and objects
#-------------------------------------------------------------------------------
A_SRC=$(wildcard $(PROJECT_BASE_PATH)/source/*.s)
A_SRC+=$(wildcard $(CMSIS_BASE_PATH)/*.s)
A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
@ -121,7 +120,7 @@ $(CHIP): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo --- Preparing $(CHIP) files $(OUTPUT_PATH) $(OUTPUT_BIN)
# @echo -------------------------
@echo -------------------------
# @echo *$(C_SRC)
# @echo -------------------------
# @echo *$(C_OBJ)

View File

@ -888,7 +888,7 @@
</option>
<option>
<name>IarchiveOutput</name>
<state>S:\projets\Arduino_project\github\arduino_arm_git\hardware\sam\system\libsam\build_iar\Debug\Exe\libsam_sam3s4c_ewarm_dbg.a</state>
<state>$PROJ_DIR$\..\..\..\cores\sam\libsam_sam3s4c_ewarm_dbg.a</state>
</option>
</data>
</settings>

View File

@ -7,6 +7,9 @@
<project>
<path>$WS_DIR$\libsam.ewp</path>
</project>
<project>
<path>$WS_DIR$\..\..\..\variants\sam3s_ek\build_iar\libvariant_sam3s_ek.ewp</path>
</project>
<project>
<path>$WS_DIR$\..\..\..\cores\sam\validation\build_iar\test.ewp</path>
</project>
@ -21,6 +24,10 @@
<project>libarduino</project>
<configuration>Debug</configuration>
</member>
<member>
<project>libsam3s_ek</project>
<configuration>Debug</configuration>
</member>
<member>
<project>test</project>
<configuration>Debug</configuration>

View File

@ -1,95 +0,0 @@
/*
%atmel_license%
*/
/** \file cmsis example */
#include <stdlib.h>
#include <compiler.h>
#include <board.h>
#include "conf_board.h"
//! counts 1ms timeTicks
volatile uint32_t dw_ms_ticks = 0;
/**
* \brief SysTick_Handler.
*/
void SysTick_Handler(void)
{
// increment counter necessary in delay()
dw_ms_ticks++;
}
/**
* \brief delays number of tick Systicks (happens every 1 ms)
*/
__INLINE static void delay_ms(uint32_t dw_dly_ticks)
{
uint32_t dw_cur_ticks;
dw_cur_ticks = dw_ms_ticks;
while ((dw_ms_ticks - dw_cur_ticks) < dw_dly_ticks);
}
/**
* \brief configer LED pins
*/
__INLINE static void led_config(void)
{
// Setup LED Pin
LED0_PIO->PIO_PER = LED0_MASK;
LED0_PIO->PIO_OER = LED0_MASK;
LED0_PIO->PIO_PUDR = LED0_MASK;
}
/**
* \brief Switch on LED
*/
__INLINE static void led_on(uint32_t dw_led)
{
// Turn On LED
LED0_PIO->PIO_CODR = dw_led;
}
/**
* \brief Switch off LED
*/
__INLINE static void led_off(uint32_t dw_led)
{
// Turn Off LED
LED0_PIO->PIO_SODR = dw_led;
}
/**
* \brief Application entry point.
*
* \return Unused (ANSI-C compatibility).
*/
int main(void)
{
SystemInit();
WDT->WDT_MR = WDT_MR_WDDIS;
// Setup SysTick Timer for 1 msec interrupts
if (SysTick_Config(SystemCoreClock / 1000)) {
// Capture error
while (1);
}
led_config();
// Flash the LED
while(1) {
// Turn on the LED.
led_on (LED0_MASK);
// delay 1000 Msec.
delay_ms (1000);
// Turn off the LED.
led_off(LED0_MASK);
// delay 1000 Msec.
delay_ms (1000);
}
}

View File

@ -1,44 +0,0 @@
/**
* \file
*
* \brief Board configuration for clock example 1
*
* Copyright (C) 2010 Atmel Corporation. All rights reserved.
*
* \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 AVR 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.
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#define LED0_PIO PIOA
#define LED0_MASK (0x01 << 23)
#endif /* CONF_BOARD_H_INCLUDED */

View File

@ -1,44 +0,0 @@
/**
* \file
*
* \brief Board configuration for clock example 1
*
* Copyright (C) 2010 Atmel Corporation. All rights reserved.
*
* \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 AVR 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.
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#define LED0_PIO PIOA
#define LED0_MASK (0x01 << 19)
#endif /* CONF_BOARD_H_INCLUDED */

View File

@ -1,44 +0,0 @@
/**
* \file
*
* \brief Board configuration for clock example 1
*
* Copyright (C) 2010 Atmel Corporation. All rights reserved.
*
* \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 AVR 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.
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#define LED0_PIO PIOA
#define LED0_MASK (0x01 << 19)
#endif /* CONF_BOARD_H_INCLUDED */

View File

@ -1,44 +0,0 @@
/**
* \file
*
* \brief Board configuration for clock example 1
*
* Copyright (C) 2010 Atmel Corporation. All rights reserved.
*
* \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 AVR 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.
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#define LED0_PIO PIOB
#define LED0_MASK (0x01 << 0)
#endif /* CONF_BOARD_H_INCLUDED */

View File

@ -1,44 +0,0 @@
/**
* \file
*
* \brief Board configuration for clock example 1
*
* Copyright (C) 2010 Atmel Corporation. All rights reserved.
*
* \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 AVR 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.
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#define LED0_PIO PIOB
#define LED0_MASK (0x01 << 12)
#endif /* CONF_BOARD_H_INCLUDED */

View File

@ -4,7 +4,7 @@
*
* \par Purpose
*
* This file provides basic support for Cortex-M processor based
* This file provides basic support for Cortex-M processor based
* microcontrollers.
*
* \note
@ -81,7 +81,7 @@ extern void WDT_IrqHandler( void ) __attribute__ ((weak, alias ("Dummy_Handler")
/* Cortex-M3 core handlers */
#pragma weak Reset_Handler=Dummy_Handler
#pragma weak NMI_Handler=Dummy_Handler
#pragma weak HardFault_Handler=Dummy_Handler
//#pragma weak HardFault_Handler=Dummy_Handler
#pragma weak MemManage_Handler=Dummy_Handler
#pragma weak BusFault_Handler=Dummy_Handler
#pragma weak UsageFault_Handler=Dummy_Handler

View File

@ -4,7 +4,7 @@
*
* \par Purpose
*
* This file provides basic support for Cortex-M processor based
* This file provides basic support for Cortex-M processor based
* microcontrollers.
*
* \author Atmel Corporation: http://www.atmel.com \n

View File

@ -73,7 +73,7 @@ const intvec_elem __vector_table[] =
WDT_IrqHandler, /* 4 Watchdog Timer */
PMC_IrqHandler, /* 5 PMC */
EEFC_IrqHandler, /* 6 EEFC */
Dummy_Handler, /* 7 Reserved */
Dummy_Handler, /* 7 Reserved */
UART0_IrqHandler, /* 8 UART0 */
UART1_IrqHandler, /* 9 UART1 */
SMC_IrqHandler, /* 10 SMC */
@ -82,8 +82,8 @@ const intvec_elem __vector_table[] =
PIOC_IrqHandler, /* 13 Parallel IO Controller C */
USART0_IrqHandler, /* 14 USART 0 */
USART1_IrqHandler, /* 15 USART 1 */
Dummy_Handler, /* 16 Reserved */
Dummy_Handler, /* 17 Reserved */
Dummy_Handler, /* 16 Reserved */
Dummy_Handler, /* 17 Reserved */
MCI_IrqHandler, /* 18 MCI */
TWI0_IrqHandler, /* 19 TWI 0 */
TWI1_IrqHandler, /* 20 TWI 1 */
@ -101,7 +101,7 @@ const intvec_elem __vector_table[] =
CRCCU_IrqHandler, /* 32 CRC Calculation Unit */
ACC_IrqHandler, /* 33 Analog Comparator */
USBD_IrqHandler, /* 34 USB Device Port */
Dummy_Handler /* 35 not used */
Dummy_Handler /* 35 not used */
};
/* TEMPORARY PATCH FOR SCB */

View File

@ -31,9 +31,6 @@ extern void PIO_DisableInterrupt( Pio *pPio, const uint32_t dwMask )
*/
extern void PIO_PullUp( Pio *pPio, const uint32_t dwMask, const uint32_t dwPullUpEnable )
{
/* Disable interrupts on the pin(s) */
pPio->PIO_IDR = dwMask ;
/* Enable the pull-up(s) if necessary */
if ( dwPullUpEnable )
{
@ -271,7 +268,11 @@ extern uint32_t PIO_Configure( Pio* pPio, const EPioType dwType, const uint32_t
case PIO_PERIPH_B :
case PIO_PERIPH_C :
case PIO_PERIPH_D :
/* Put the pin under control of peripheral */
PIO_SetPeripheral( pPio, dwType, dwMask ) ;
/* Disable interrupts on the pin(s) */
PIO_DisableInterrupt( pPio, dwMask ) ;
/* Enable Pullup */
PIO_PullUp( pPio, dwMask, (dwAttribute & PIO_PULLUP) ) ;
break;
@ -305,13 +306,16 @@ extern uint32_t PIO_Configure( Pio* pPio, const EPioType dwType, const uint32_t
*/
extern uint32_t PIO_GetOutputDataStatus( const Pio* pPio, const uint32_t dwMask )
{
if ( (pPio->PIO_ODSR & dwMask) == 0 )
/* Test if pin is under control of PIO */
if ( (pPio->PIO_PSR & dwMask) != 0 )
{
/* Test if pin is configured as output */
if ( (pPio->PIO_OSR & dwMask) != 0 )
{
return 0 ;
}
else
{
return 1 ;
return 1 ;
}
}
return 0 ;
}