-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCUM-30. add scum into scons build system.
- Loading branch information
1 parent
64b673b
commit 23c3c49
Showing
7 changed files
with
331 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
|
||
Import('env') | ||
|
||
localEnv = env.Clone() | ||
|
||
# scons doesn't let us look to parent directories for source, so the | ||
# bsp/chips/at86rf231/radio.c is off limits from this file. To keep things | ||
# simple, each SConscript file in bsp/chips/* will return a list of objects | ||
# which can be appended to the source list. Don't forget to specify a variant_dir, | ||
# or else the build will occur directly in the chips directory. | ||
|
||
source = [ | ||
'board.c', | ||
'scum_startup.s', | ||
'cryptoengine.c', | ||
'debugpins.c', | ||
'eui64.c', | ||
'leds.c', | ||
'radio.c', | ||
'scm3_hardware_interface.c', | ||
'sctimer.c', | ||
'uart.c', | ||
'interrupts.c' | ||
] | ||
|
||
board = localEnv.Object(source=source) | ||
|
||
Return('board') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "uart.h" | ||
#include "sctimer.h" | ||
#include "radio.h" | ||
|
||
void UART_Handler(void){ | ||
uart_rx_isr(); | ||
} | ||
|
||
void RF_Handler(void){ | ||
radio_isr(); | ||
} | ||
|
||
void RFTIMER_Handler(void){ | ||
sctimer_isr(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
void UART_Handler(void); | ||
void RF_Handler(void); | ||
void RFTIMER_Handler(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
|
||
ENTRY(Reset_Handler) | ||
|
||
MEMORY | ||
{ | ||
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 64K | ||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K | ||
} | ||
|
||
stack_size = 2048; | ||
heap_size = 1024; | ||
|
||
_stack_start = ORIGIN(RAM)+LENGTH(RAM); | ||
_stack_end = _stack_start - stack_size; | ||
|
||
SECTIONS | ||
{ | ||
/* The startup code goes first into ROM */ | ||
.isr_vector : | ||
{ | ||
. = ALIGN(4); | ||
KEEP(*(.isr_vector)) /* Startup code */ | ||
. = ALIGN(4); | ||
} >ROM | ||
|
||
/* The program code and other data goes into ROM */ | ||
.text : | ||
{ | ||
. = ALIGN(4); | ||
*(.text) /* .text sections (code) */ | ||
*(.text*) /* .text* sections (code) */ | ||
*(.rodata) /* .rodata sections (constants, strings, etc.) */ | ||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */ | ||
*(.glue_7) /* glue arm to thumb code */ | ||
*(.glue_7t) /* glue thumb to arm code */ | ||
. = ALIGN(4); | ||
_etext = .; /* define a global symbols at end of code */ | ||
} >ROM | ||
|
||
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >ROM | ||
.ARM : { | ||
__exidx_start = .; | ||
*(.ARM.exidx*) | ||
__exidx_end = .; | ||
} >ROM | ||
|
||
/* used by the startup to initialize data */ | ||
_sidata = .; | ||
|
||
/* Initialized data sections goes into RAM, load LMA copy after code */ | ||
.data : AT ( _sidata ) | ||
{ | ||
. = ALIGN(4); | ||
_sdata = .; /* create a global symbol at data start */ | ||
*(.data) /* .data sections */ | ||
*(.data*) /* .data* sections */ | ||
|
||
. = ALIGN(4); | ||
_edata = .; /* define a global symbol at data end */ | ||
} >RAM | ||
|
||
/* Uninitialized data section */ | ||
. = ALIGN(4); | ||
.bss : | ||
{ | ||
/* Used by the startup in order to initialize the .bss secion */ | ||
_sbss = .; /* define a global symbol at bss start */ | ||
__bss_start__ = _sbss; | ||
*(.bss) | ||
*(.bss*) | ||
*(COMMON) | ||
|
||
. = ALIGN(4); | ||
_ebss = .; /* define a global symbol at bss end */ | ||
__bss_end__ = _ebss; | ||
} >RAM | ||
|
||
. = ALIGN(4); | ||
.heap : | ||
{ | ||
_heap_start = .; | ||
. = . + heap_size; | ||
_heap_end = .; | ||
end = _heap_start; | ||
_end = end; | ||
} > RAM | ||
|
||
.ARM.attributes 0 : { *(.ARM.attributes) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
/* File: startup_ARMCM0.S | ||
* Purpose: startup file for Cortex-M0 devices. Should use with | ||
* GCC for ARM Embedded Processors | ||
* Version: V2.01 | ||
* Date: 12 June 2014 | ||
* | ||
*/ | ||
/* Copyright (c) 2011 - 2014 ARM LIMITED | ||
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 following disclaimer. | ||
- 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. | ||
- Neither the name of ARM nor the names of its contributors may be used | ||
to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
* | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS 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. | ||
---------------------------------------------------------------------------*/ | ||
|
||
|
||
.syntax unified | ||
.arch armv6-m | ||
|
||
.section .stack | ||
.align 4 | ||
#ifdef __STACK_SIZE | ||
.equ Stack_Size, __STACK_SIZE | ||
#else | ||
.equ Stack_Size, 0x00000800 | ||
#endif | ||
.globl __StackTop | ||
.globl __StackLimit | ||
__StackLimit: | ||
.space Stack_Size | ||
.size __StackLimit, . - __StackLimit | ||
__StackTop: | ||
.size __StackTop, . - __StackTop | ||
|
||
.section .heap | ||
.align 4 | ||
#ifdef __HEAP_SIZE | ||
.equ Heap_Size, __HEAP_SIZE | ||
#else | ||
.equ Heap_Size, 0x00000400 | ||
#endif | ||
.globl __HeapBase | ||
.globl __HeapLimit | ||
__HeapBase: | ||
.if Heap_Size | ||
.space Heap_Size | ||
.endif | ||
.size __HeapBase, . - __HeapBase | ||
__HeapLimit: | ||
.size __HeapLimit, . - __HeapLimit | ||
|
||
.section .vectors | ||
.align 2 | ||
.globl __Vectors | ||
__Vectors: | ||
.long __StackTop /* Top of Stack */ | ||
.long Reset_Handler /* Reset Handler */ | ||
.long 0 /* Reserved*/ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved*/ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved */ | ||
.long 0 /* Reserved*/ | ||
.long 0 /* Reserved */ | ||
|
||
/* External interrupts */ | ||
.long UART_Handler /* 0: UART_ */ | ||
.long 0 /* 1: Reserved */ | ||
.long 0 /* 2: Reserved */ | ||
.long 0 /* 3: Reserved */ | ||
.long 0 /* 4: Reserved */ | ||
.long 0 /* 5: Reserved */ | ||
.long RF_Handler /* 6: RF */ | ||
.long RFTIMER_Handler /* 7: RFTimer */ | ||
.long 0 /* 8: Reserved */ | ||
.long 0 /* 9: Reserved */ | ||
.long 0 /* 10: Reserved */ | ||
.long 0 /* 11: Reserved */ | ||
.long 0 /* 12: Reserved */ | ||
.long 0 /* 13: Reserved */ | ||
.long 0 /* 14: Reserved */ | ||
.long 0 /* 15: Reserved */ | ||
|
||
.size __Vectors, . - __Vectors | ||
|
||
.text | ||
.thumb | ||
.thumb_func | ||
.align 1 | ||
.globl Reset_Handler | ||
.type Reset_Handler, %function | ||
Reset_Handler: | ||
|
||
#Interrupt Set Enable Register | ||
ldr r1, =0xe000e100 | ||
#<- REMEMBER TO ENABLE THE INTERRUPTS!! | ||
ldr r0, =0xc1 | ||
str r0, [r1] | ||
|
||
.global main | ||
b main | ||
|
||
.pool | ||
.size Reset_Handler, . - Reset_Handler | ||
|
||
.align 1 | ||
.thumb_func | ||
.weak Default_Handler | ||
.type Default_Handler, %function | ||
Default_Handler: | ||
b . | ||
.size Default_Handler, . - Default_Handler | ||
|
||
/* Macro to define default handlers. Default handler | ||
* will be weak symbol and just dead loops. They can be | ||
* overwritten by other handlers */ | ||
.macro def_irq_handler handler_name | ||
.weak \handler_name | ||
.set \handler_name, Default_Handler | ||
.endm | ||
|
||
def_irq_handler UART_Handler | ||
def_irq_handler RF_Handler | ||
def_irq_handler RFTIMER_Handler | ||
|
||
.end |