mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-09-23 02:27:26 +00:00
* Added IAR Embedded Workbench project for loading demo application into AT91SAM7X-EK evaluation board
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@43 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
@@ -3,7 +3,7 @@ compiler:
|
||||
source_path: 'test/system/src/'
|
||||
unit_tests_path: &unit_tests_path 'test/system/test/'
|
||||
mocks_path: 'test/system/mocks/'
|
||||
build_path: &build_path 'test/system/build/'
|
||||
build_path: &build_path 'test/system/build/'
|
||||
options:
|
||||
- -c
|
||||
includes:
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// ATMEL Microcontroller Software Support - ROUSSET -
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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.
|
||||
// ----------------------------------------------------------------------------
|
||||
// File Name : AT91SAM7X-EK.h
|
||||
// Object : AT91SAM7X-EK Evaluation Board Features Definition File
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef AT91SAM7X_EK_H
|
||||
#define AT91SAM7X_EK_H
|
||||
|
||||
/*-----------------*/
|
||||
/* LEDs Definition */
|
||||
/*-----------------*/
|
||||
#define AT91B_LED1 (1<<19) // AT91C_PIO_PB19 AT91C_PB19_PWM0 AT91C_PB19_TCLK1
|
||||
#define AT91B_LED2 (1<<20) // AT91C_PIO_PB20 AT91C_PB20_PWM1 AT91C_PB20_PWM1
|
||||
#define AT91B_LED3 (AT91C_PIO_PB21) // AT91C_PIO_PB21 AT91C_PB21_PWM2 AT91C_PB21_PCK1
|
||||
#define AT91B_LED4 (AT91C_PIO_PB22) // AT91C_PIO_PB22 AT91C_PB22_PWM3 AT91C_PB22_PCK2
|
||||
#define AT91B_NB_LEB 4
|
||||
#define AT91B_LED_MASK (AT91B_LED1|AT91B_LED2|AT91B_LED3|AT91B_LED4)
|
||||
#define AT91D_BASE_PIO_LED (AT91C_BASE_PIOB)
|
||||
|
||||
#define AT91B_POWERLED (1<<25) // PB25
|
||||
|
||||
|
||||
/*-------------------------------*/
|
||||
/* JOYSTICK Position Definition */
|
||||
/*-------------------------------*/
|
||||
#define AT91B_SW1 (1<<21) // PA21 Up Button AT91C_PA21_TF AT91C_PA21_NPCS10
|
||||
#define AT91B_SW2 (1<<22) // PA22 Down Button AT91C_PA22_TK AT91C_PA22_SPCK1
|
||||
#define AT91B_SW3 (1<<23) // PA23 Left Button AT91C_PA23_TD AT91C_PA23_MOSI1
|
||||
#define AT91B_SW4 (1<<24) // PA24 Right Button AT91C_PA24_RD AT91C_PA24_MISO1
|
||||
#define AT91B_SW5 (1<<25) // PA25 Push Button AT91C_PA25_RK AT91C_PA25_NPCS11
|
||||
#define AT91B_SW_MASK (AT91B_SW1|AT91B_SW2|AT91B_SW3|AT91B_SW4|AT91B_SW5)
|
||||
|
||||
|
||||
#define AT91D_BASE_PIO_SW (AT91C_BASE_PIOA)
|
||||
|
||||
/*------------------*/
|
||||
/* CAN Definition */
|
||||
/*------------------*/
|
||||
#define AT91B_CAN_TRANSCEIVER_RS (1<<2) // PA2
|
||||
|
||||
/*--------------*/
|
||||
/* Clocks */
|
||||
/*--------------*/
|
||||
#define AT91B_MAIN_OSC 18432000 // Main Oscillator MAINCK
|
||||
#define AT91B_MCK ((18432000*73/14)/2) // Output PLL Clock
|
||||
|
||||
#endif /* AT91SAM7X-EK_H */
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><head>
|
||||
<meta charset="iso-8859-1" content="Arm / ATMEL/ AT91 library / AT91SAM7X256" http-equiv="Content-Type">
|
||||
<title>Hardware API Selector: AT91SAM7X256 Main Frame</title>
|
||||
</head>
|
||||
<frameset cols="20%, *"><frame name="Index" src="./HTML/AT91SAM7X256_idx.html">
|
||||
<frame name="Main" src="./HTML/AT91SAM7X256_DBGU.html"></frameset>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,266 @@
|
||||
;- ----------------------------------------------------------------------------
|
||||
;- ATMEL Microcontroller Software Support - ROUSSET -
|
||||
;- ----------------------------------------------------------------------------
|
||||
;- 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.
|
||||
;- ----------------------------------------------------------------------------
|
||||
;- File source : Cstartup.s79
|
||||
;- Object : Generic CStartup
|
||||
;- 1.0 01/Sep/05 FBr : Creation
|
||||
;- 1.1 09/Sep/05 JPP : Change Interrupt management
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Include your AT91 Library files
|
||||
;------------------------------------------------------------------------------
|
||||
#include "AT91SAM7X256_inc.h"
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ?RESET
|
||||
; Reset Vector.
|
||||
; Normally, segment INTVEC is linked at address 0.
|
||||
; For debugging purposes, INTVEC may be placed at other addresses.
|
||||
; A debugger that honors the entry point will start the
|
||||
; program in a normal way even if INTVEC is not at address 0.
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
PROGRAM ?RESET ;- Begins a program module
|
||||
RSEG INTRAMEND_REMAP ;- Begins a relocatable segment
|
||||
RSEG ICODE:CODE (2) ;- Begins a relocatable segment : corresponding address is 32-bit aligned
|
||||
CODE32 ;- Always ARM mode after reset
|
||||
ORG 0 ;- Sets the location counter: corresponds to the RESET vector address
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Exception vectors
|
||||
;------------------------------------------------------------------------------
|
||||
;- These vectors can be read at address 0 or at RAM address
|
||||
;- They ABSOLUTELY requires to be in relative addresssing mode in order to
|
||||
;- guarantee a valid jump. For the moment, all are just looping.
|
||||
;- If an exception occurs before remap, this would result in an infinite loop.
|
||||
;- To ensure if a exeption occurs before start application to infinite loop.
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
reset
|
||||
B InitReset ; 0x00 Reset handler
|
||||
undefvec:
|
||||
B undefvec ; 0x04 Undefined Instruction
|
||||
swivec:
|
||||
B swivec ; 0x08 Software Interrupt
|
||||
pabtvec:
|
||||
B pabtvec ; 0x0C Prefetch Abort
|
||||
dabtvec:
|
||||
B dabtvec ; 0x10 Data Abort
|
||||
rsvdvec:
|
||||
B rsvdvec ; 0x14 reserved
|
||||
irqvec:
|
||||
B IRQ_Handler_Entry ; 0x18 IRQ
|
||||
|
||||
fiqvec: ; 0x1c FIQ
|
||||
;------------------------------------------------------------------------------
|
||||
;- Function : FIQ_Handler_Entry
|
||||
;- Treatments : FIQ Controller Interrupt Handler.
|
||||
;- Called Functions : AIC_FVR[interrupt]
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
FIQ_Handler_Entry:
|
||||
|
||||
;- Switch in SVC/User Mode to allow User Stack access for C code
|
||||
; because the FIQ is not yet acknowledged
|
||||
|
||||
;- Save and r0 in FIQ_Register
|
||||
mov r9,r0
|
||||
ldr r0 , [r8, #AIC_FVR]
|
||||
msr CPSR_c,#I_BIT | F_BIT | ARM_MODE_SVC
|
||||
;- Save scratch/used registers and LR in User Stack
|
||||
stmfd sp!, { r1-r3, r12, lr}
|
||||
|
||||
;- Branch to the routine pointed by the AIC_FVR
|
||||
mov r14, pc
|
||||
bx r0
|
||||
|
||||
;- Restore scratch/used registers and LR from User Stack
|
||||
ldmia sp!, { r1-r3, r12, lr}
|
||||
|
||||
;- Leave Interrupts disabled and switch back in FIQ mode
|
||||
msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ
|
||||
|
||||
;- Restore the R0 ARM_MODE_SVC register
|
||||
mov r0,r9
|
||||
|
||||
;- Restore the Program Counter using the LR_fiq directly in the PC
|
||||
subs pc,lr,#4
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Manage exception: The exception must be ensure in ARM mode
|
||||
;------------------------------------------------------------------------------
|
||||
;------------------------------------------------------------------------------
|
||||
;- Function : IRQ_Handler_Entry
|
||||
;- Treatments : IRQ Controller Interrupt Handler.
|
||||
;- Called Functions : AIC_IVR[interrupt]
|
||||
;------------------------------------------------------------------------------
|
||||
IRQ_Handler_Entry:
|
||||
|
||||
;-------------------------
|
||||
;- Manage Exception Entry
|
||||
;-------------------------
|
||||
;- Adjust and save LR_irq in IRQ stack
|
||||
sub lr, lr, #4
|
||||
stmfd sp!, {lr}
|
||||
|
||||
;- Save r0 and SPSR (need to be saved for nested interrupt)
|
||||
mrs r14, SPSR
|
||||
stmfd sp!, {r0,r14}
|
||||
|
||||
;- Write in the IVR to support Protect Mode
|
||||
;- No effect in Normal Mode
|
||||
;- De-assert the NIRQ and clear the source in Protect Mode
|
||||
ldr r14, =AT91C_BASE_AIC
|
||||
ldr r0 , [r14, #AIC_IVR]
|
||||
str r14, [r14, #AIC_IVR]
|
||||
|
||||
;- Enable Interrupt and Switch in Supervisor Mode
|
||||
msr CPSR_c, #ARM_MODE_SVC
|
||||
|
||||
;- Save scratch/used registers and LR in User Stack
|
||||
stmfd sp!, { r1-r3, r12, r14}
|
||||
|
||||
;----------------------------------------------
|
||||
;- Branch to the routine pointed by the AIC_IVR
|
||||
;----------------------------------------------
|
||||
mov r14, pc
|
||||
bx r0
|
||||
|
||||
;----------------------------------------------
|
||||
;- Manage Exception Exit
|
||||
;----------------------------------------------
|
||||
;- Restore scratch/used registers and LR from User Stack
|
||||
ldmia sp!, { r1-r3, r12, r14}
|
||||
|
||||
;- Disable Interrupt and switch back in IRQ mode
|
||||
msr CPSR_c, #I_BIT | ARM_MODE_IRQ
|
||||
|
||||
;- Mark the End of Interrupt on the AIC
|
||||
ldr r14, =AT91C_BASE_AIC
|
||||
str r14, [r14, #AIC_EOICR]
|
||||
|
||||
;- Restore SPSR_irq and r0 from IRQ stack
|
||||
ldmia sp!, {r0,r14}
|
||||
msr SPSR_cxsf, r14
|
||||
|
||||
;- Restore adjusted LR_irq from IRQ stack directly in the PC
|
||||
ldmia sp!, {pc}^
|
||||
|
||||
|
||||
|
||||
InitReset:
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Low level Init is performed in a C function: AT91F_LowLevelInit
|
||||
;- Init Stack Pointer to a valid memory area before calling AT91F_LowLevelInit
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
;- Retrieve end of RAM address
|
||||
__iramend EQU SFB(INTRAMEND_REMAP) ;- Segment begin
|
||||
|
||||
EXTERN AT91F_LowLevelInit
|
||||
ldr r13,=__iramend ;- Temporary stack in internal RAM for Low Level Init execution
|
||||
ldr r0,=AT91F_LowLevelInit
|
||||
mov lr, pc
|
||||
bx r0 ;- Branch on C function (with interworking)
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Top of Stack Definition
|
||||
;------------------------------------------------------------------------------
|
||||
;- Interrupt and Supervisor Stack are located at the top of internal memory in
|
||||
;- order to speed the exception handling context saving and restoring.
|
||||
;- ARM_MODE_SVC (Application, C) Stack is located at the top of the external memory.
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
IRQ_STACK_SIZE EQU (3*8*4) ; 3 words to be saved per interrupt priority level
|
||||
ARM_MODE_FIQ EQU 0x11
|
||||
ARM_MODE_IRQ EQU 0x12
|
||||
ARM_MODE_SVC EQU 0x13
|
||||
I_BIT EQU 0x80
|
||||
F_BIT EQU 0x40
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Setup the stack for each mode
|
||||
;------------------------------------------------------------------------------
|
||||
ldr r0, =__iramend
|
||||
|
||||
;- Set up Fast Interrupt Mode and set FIQ Mode Stack
|
||||
msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT
|
||||
;- Init the FIQ register
|
||||
ldr r8, =AT91C_BASE_AIC
|
||||
|
||||
;- Set up Interrupt Mode and set IRQ Mode Stack
|
||||
msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT
|
||||
mov r13, r0 ; Init stack IRQ
|
||||
sub r0, r0, #IRQ_STACK_SIZE
|
||||
|
||||
;- Enable interrupt & Set up Supervisor Mode and set Supervisor Mode Stack
|
||||
msr CPSR_c, #ARM_MODE_SVC
|
||||
mov r13, r0
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Initialize segments.
|
||||
;------------------------------------------------------------------------------
|
||||
; __segment_init is assumed to use
|
||||
; instruction set and to be reachable by BL from the ICODE segment
|
||||
; (it is safest to link them in segment ICODE).
|
||||
;------------------------------------------------------------------------------
|
||||
EXTERN __segment_init
|
||||
ldr r0,=__segment_init
|
||||
mov lr, pc
|
||||
bx r0
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Branch on C code Main function (with interworking)
|
||||
;------------------------------------------------------------------------------
|
||||
EXTERN main
|
||||
PUBLIC __main
|
||||
?jump_to_main:
|
||||
ldr lr,=?call_exit
|
||||
ldr r0,=main
|
||||
__main:
|
||||
bx r0
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Loop for ever
|
||||
;------------------------------------------------------------------------------
|
||||
;- End of application. Normally, never occur.
|
||||
;- Could jump on Software Reset ( B 0x0 ).
|
||||
;------------------------------------------------------------------------------
|
||||
?call_exit:
|
||||
End
|
||||
b End
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;- Exception Vectors
|
||||
;------------------------------------------------------------------------------
|
||||
PUBLIC AT91F_Default_FIQ_handler
|
||||
PUBLIC AT91F_Default_IRQ_handler
|
||||
PUBLIC AT91F_Spurious_handler
|
||||
|
||||
CODE32 ; Always ARM mode after exeption
|
||||
|
||||
AT91F_Default_FIQ_handler
|
||||
b AT91F_Default_FIQ_handler
|
||||
|
||||
AT91F_Default_IRQ_handler
|
||||
b AT91F_Default_IRQ_handler
|
||||
|
||||
AT91F_Spurious_handler
|
||||
b AT91F_Spurious_handler
|
||||
|
||||
ENDMOD ;- Terminates the assembly of the current module
|
||||
END ;- Terminates the assembly of the last module in a file
|
||||
@@ -0,0 +1,99 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// ATMEL Microcontroller Software Support - ROUSSET -
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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.
|
||||
// ----------------------------------------------------------------------------
|
||||
// File Name : Cstartup_SAM7.c
|
||||
// Object : Low level initialisations written in C for IAR Tools
|
||||
// Creation : FBr 01-Sep-2005
|
||||
// 1.0 08-Sep-2005 JPP : Suppress Reset
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
//#include "project.h"
|
||||
#include "AT91SAM7X256.h"
|
||||
|
||||
// The following functions must be write in ARM mode this function called directly by exception vector
|
||||
extern void AT91F_Spurious_handler(void);
|
||||
extern void AT91F_Default_IRQ_handler(void);
|
||||
extern void AT91F_Default_FIQ_handler(void);
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_LowLevelInit
|
||||
//* \brief This function performs very low level HW initialization
|
||||
//* this function can use a Stack, depending the compilation
|
||||
//* optimization mode
|
||||
//*----------------------------------------------------------------------------
|
||||
void AT91F_LowLevelInit(void)
|
||||
{
|
||||
unsigned char i;
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// EFC Init
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS; // 1 Wait State necessary to work at 48MHz
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Init PMC Step 1. Enable Main Oscillator
|
||||
// Main Oscillator startup time is board specific:
|
||||
// Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms (0x40 for AT91C_CKGR_OSCOUNT field)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
AT91C_BASE_PMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x40 <<8) | AT91C_CKGR_MOSCEN ));
|
||||
#ifndef SIMULATE
|
||||
// Wait Main Oscillator stabilization
|
||||
while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS));
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Init PMC Step 2.
|
||||
// Set PLL to 96MHz (96,109MHz) and UDP Clock to 48MHz
|
||||
// PLL Startup time depends on PLL RC filter: worst case is choosen
|
||||
// UDP Clock (48,058MHz) is compliant with the Universal Serial Bus Specification (+/- 0.25% for full speed)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
AT91C_BASE_PMC->PMC_PLLR = AT91C_CKGR_USBDIV_1 | AT91C_CKGR_OUT_0 | AT91C_CKGR_PLLCOUNT |
|
||||
(AT91C_CKGR_MUL & (72 << 16)) | (AT91C_CKGR_DIV & 14);
|
||||
#ifndef SIMULATE
|
||||
// Wait for PLL stabilization
|
||||
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCK) );
|
||||
// Wait until the master clock is established for the case we already turn on the PLL
|
||||
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) );
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Init PMC Step 3.
|
||||
// Selection of Master Clock MCK (equal to Processor Clock PCK) equal to PLL/2 = 48MHz
|
||||
// The PMC_MCKR register must not be programmed in a single write operation (see. Product Errata Sheet)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
AT91C_BASE_PMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2;
|
||||
#ifndef SIMULATE
|
||||
// Wait until the master clock is established
|
||||
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) );
|
||||
#endif
|
||||
|
||||
AT91C_BASE_PMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK;
|
||||
#ifndef SIMULATE
|
||||
// Wait until the master clock is established
|
||||
while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) );
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable Watchdog (write once register)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Init AIC: assign corresponding handler for each interrupt source
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ;
|
||||
for (i = 1; i < 31; i++) {
|
||||
AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ;
|
||||
}
|
||||
AT91C_BASE_AIC->AIC_SPU = (unsigned int) AT91F_Spurious_handler;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// ATMEL Microcontroller Software Support - ROUSSET -
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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.
|
||||
// ----------------------------------------------------------------------------
|
||||
// File Name : SAM7_FLASH.mac
|
||||
// Object : Generic Macro File for IAR
|
||||
// 1.0 17/Aug/05 FBr : Creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _InitRSTC()
|
||||
*
|
||||
* Function description
|
||||
* Initializes the RSTC (Reset controller).
|
||||
* This makes sense since the default is to not allow user resets, which makes it impossible to
|
||||
* apply a second RESET via J-Link
|
||||
*/
|
||||
_InitRSTC() {
|
||||
__writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _InitPLL()
|
||||
* Function description
|
||||
* Initializes the PMC.
|
||||
* 1. Enable the Main Oscillator
|
||||
* 2. Configure PLL to 96MHz
|
||||
* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz
|
||||
*/
|
||||
_InitPLL() {
|
||||
|
||||
__message "Enable Main Oscillator";
|
||||
__writeMemory32(0x00000601,0xFFFFFc20,"Memory"); // MOSC
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) );
|
||||
|
||||
__message "Set PLL to 96MHz";
|
||||
__writeMemory32(0x10191c05,0xFFFFFc2c,"Memory"); // LOCK
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) );
|
||||
|
||||
__message "Set Master Clock to 48MHz";
|
||||
__writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) );
|
||||
__writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* execUserReset() : JTAG set initially to Full Speed
|
||||
*/
|
||||
execUserReset() {
|
||||
__message "execUserReset()";
|
||||
__emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset
|
||||
__hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz)
|
||||
_InitPLL(); // Allow to debug at JTAG Full Speed
|
||||
_InitRSTC(); // Enable User Reset to allow execUserReset() execution
|
||||
__emulatorSpeed(0); // Set JTAG speed to full speed
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// ATMEL Microcontroller Software Support - ROUSSET -
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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.
|
||||
// ----------------------------------------------------------------------------
|
||||
// File Name : SAM7_RAM.mac
|
||||
// Object : Generic Macro File for IAR
|
||||
// 1.0 17/Aug/05 FBr : Creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _MapRAMAt0()
|
||||
*
|
||||
* Function description
|
||||
* Maps RAM at 0.
|
||||
*/
|
||||
_MapRAMAt0(){
|
||||
__message "Changing mapping: RAM mapped to 0";
|
||||
__writeMemory32(0x00000001,0xFFFFFF00,"Memory");
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _InitRSTC()
|
||||
*
|
||||
* Function description
|
||||
* Initializes the RSTC (Reset controller).
|
||||
* This makes sense since the default is to not allow user resets, which makes it impossible to
|
||||
* apply a second RESET via J-Link
|
||||
*/
|
||||
_InitRSTC() {
|
||||
__writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _InitPLL()
|
||||
* Function description
|
||||
* Initializes the PMC.
|
||||
* 1. Enable the Main Oscillator
|
||||
* 2. Configure PLL to 96MHz
|
||||
* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz
|
||||
*/
|
||||
_InitPLL() {
|
||||
|
||||
__message "Set Main Oscillator";
|
||||
__writeMemory32(0x00004001,0xFFFFFc20,"Memory"); // MOSC
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) );
|
||||
|
||||
__message "Set PLL to 96MHz";
|
||||
__writeMemory32(0x10483f0e,0xFFFFFc2c,"Memory"); // LOCK
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) );
|
||||
|
||||
__message "Set Master Clock to 48MHz";
|
||||
__writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) );
|
||||
__writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY
|
||||
while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* execUserReset() : JTAG set initially to Full Speed
|
||||
*/
|
||||
execUserReset() {
|
||||
__message "execUserReset()";
|
||||
__emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset
|
||||
__hwReset(0); // Hardware Reset: CPU is automatically halted after the reset
|
||||
_InitPLL(); // Allow to debug at JTAG Full Speed
|
||||
_MapRAMAt0(); // Remap RAM to address 0
|
||||
__emulatorSpeed(0); // Set JTAG speed to full speed
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* execUserPreload() : JTAG set initially to 32kHz
|
||||
*/
|
||||
execUserPreload() {
|
||||
__message "execUserPreload()";
|
||||
__hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz)
|
||||
_InitPLL(); // Allow to load Code at JTAG Full Speed
|
||||
_MapRAMAt0(); // Remap RAM to address 0
|
||||
_InitRSTC(); // Enable User Reset to allow execUserReset() execution
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// ATMEL Microcontroller Software Support - ROUSSET -
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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.
|
||||
// ----------------------------------------------------------------------------
|
||||
// File Name : at91SAM7X256_RAM.xcl
|
||||
// Object : Generic Linker Command File for IAR
|
||||
// 1.0 30/Aug/05 FBr : Creation for 4.30A
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
//*************************************************************************
|
||||
// XLINK command file template for EWARM/ICCARM
|
||||
//
|
||||
// Usage: xlink -f lnkarm <your_object_file(s)>
|
||||
// -s <program start label> <C/C++ runtime library>
|
||||
//*************************************************************************
|
||||
//
|
||||
// -------------
|
||||
// Code segments - may be placed anywhere in memory.
|
||||
// -------------
|
||||
//
|
||||
// INTVEC -- Exception vector table.
|
||||
// SWITAB -- Software interrupt vector table.
|
||||
// ICODE -- Startup (cstartup) and exception code.
|
||||
// DIFUNCT -- Dynamic initialization vectors used by C++.
|
||||
// CODE -- Compiler generated code.
|
||||
// CODE_I -- Compiler generated code declared __ramfunc (executes in RAM)
|
||||
// CODE_ID -- Initializer for CODE_I (ROM).
|
||||
//
|
||||
// -------------
|
||||
// Data segments - may be placed anywhere in memory.
|
||||
// -------------
|
||||
//
|
||||
// CSTACK -- The stack used by C/C++ programs (system and user mode).
|
||||
// IRQ_STACK -- The stack used by IRQ service routines.
|
||||
// SVC_STACK -- The stack used in supervisor mode
|
||||
// (Define other exception stacks as needed for
|
||||
// FIQ, ABT, UND).
|
||||
// HEAP -- The heap used by malloc and free in C and new and
|
||||
// delete in C++.
|
||||
// INITTAB -- Table containing addresses and sizes of segments that
|
||||
// need to be initialized at startup (by cstartup).
|
||||
// CHECKSUM -- The linker places checksum byte(s) in this segment,
|
||||
// when the -J linker command line option is used.
|
||||
// DATA_y -- Data objects.
|
||||
//
|
||||
// Where _y can be one of:
|
||||
//
|
||||
// _AN -- Holds uninitialized located objects, i.e. objects with
|
||||
// an absolute location given by the @ operator or the
|
||||
// #pragma location directive. Since these segments
|
||||
// contain objects which already have a fixed address,
|
||||
// they should not be mentioned in this linker command
|
||||
// file.
|
||||
// _C -- Constants (ROM).
|
||||
// _I -- Initialized data (RAM).
|
||||
// _ID -- The original content of _I (copied to _I by cstartup) (ROM).
|
||||
// _N -- Uninitialized data (RAM).
|
||||
// _Z -- Zero initialized data (RAM).
|
||||
//
|
||||
// Note: Be sure to use end values for the defined address ranges.
|
||||
// Otherwise, the linker may allocate space outside the
|
||||
// intended memory range.
|
||||
//*************************************************************************
|
||||
|
||||
//*************************************************************************
|
||||
// Inform the linker about the CPU family used.
|
||||
// AT91SAM7X256 Memory mapping
|
||||
// No remap
|
||||
// ROMSTART
|
||||
// Start address 0x0000 0000
|
||||
// Size 256 Kbo 0x0004 0000
|
||||
// RAMSTART
|
||||
// Start address 0x0020 0000
|
||||
// Size 64 Kbo 0x0001 0000
|
||||
// Remap done
|
||||
// RAMSTART
|
||||
// Start address 0x0000 0000
|
||||
// Size 64 Kbo 0x0001 0000
|
||||
// ROMSTART
|
||||
// Start address 0x0010 0000
|
||||
// Size 256 Kbo 0x0004 0000
|
||||
|
||||
//*************************************************************************
|
||||
-carm
|
||||
|
||||
//*************************************************************************
|
||||
// Internal Ram segments mapped AFTER REMAP 64 K.
|
||||
//*************************************************************************
|
||||
-Z(CONST)INTRAMSTART_REMAP=00000000
|
||||
-Z(CONST)INTRAMEND_REMAP=0000FFFF
|
||||
|
||||
//*************************************************************************
|
||||
// Read-only segments mapped to Flash 256 K.
|
||||
//*************************************************************************
|
||||
-DROMSTART=00000000
|
||||
-DROMEND=0003FFFF
|
||||
//*************************************************************************
|
||||
// Read/write segments mapped to 64 K RAM.
|
||||
//*************************************************************************
|
||||
-DRAMSTART=00000000
|
||||
-DRAMEND=0000FFFF
|
||||
|
||||
//*************************************************************************
|
||||
// Address range for reset and exception
|
||||
// vectors (INTVEC).
|
||||
// The vector area is 32 bytes,
|
||||
// an additional 32 bytes is allocated for the
|
||||
// constant table used by ldr PC in cstartup.s79.
|
||||
//*************************************************************************
|
||||
-Z(CODE)INTVEC=00-3F
|
||||
|
||||
//*************************************************************************
|
||||
// Startup code and exception routines (ICODE).
|
||||
//*************************************************************************
|
||||
-Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND
|
||||
-Z(CODE)SWITAB=ROMSTART-ROMEND
|
||||
|
||||
//*************************************************************************
|
||||
// Code segments may be placed anywhere.
|
||||
//*************************************************************************
|
||||
-Z(CODE)CODE=ROMSTART-ROMEND
|
||||
|
||||
//*************************************************************************
|
||||
// Various constants and initializers.
|
||||
//*************************************************************************
|
||||
-Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND
|
||||
-Z(CONST)CHECKSUM=ROMSTART-ROMEND
|
||||
|
||||
//*************************************************************************
|
||||
// Data segments.
|
||||
//*************************************************************************
|
||||
-Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND
|
||||
|
||||
//*************************************************************************
|
||||
// __ramfunc code copied to and executed from RAM.
|
||||
//*************************************************************************
|
||||
-Z(DATA)CODE_I=RAMSTART-RAMEND
|
||||
-Z(CONST)CODE_ID=ROMSTART-ROMEND // Initializer for
|
||||
-QCODE_I=CODE_ID
|
||||
|
||||
//*************************************************************************
|
||||
// ICCARM produces code for __ramfunc functions in
|
||||
// CODE_I segments. The -Q XLINK command line
|
||||
// option redirects XLINK to emit the code in the
|
||||
// debug information associated with the CODE_I
|
||||
// segment, where the code will execute.
|
||||
//*************************************************************************
|
||||
|
||||
//*************************************************************************
|
||||
// Stack and heap segments.
|
||||
//*************************************************************************
|
||||
-D_CSTACK_SIZE=(100*4)
|
||||
-D_IRQ_STACK_SIZE=(3*8*4)
|
||||
-D_HEAP_SIZE=(1024*1)
|
||||
|
||||
-Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
|
||||
-Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND
|
||||
-Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND
|
||||
|
||||
//*************************************************************************
|
||||
// ELF/DWARF support.
|
||||
//
|
||||
// Uncomment the line "-Felf" below to generate ELF/DWARF output.
|
||||
// Available format specifiers are:
|
||||
//
|
||||
// "-yn": Suppress DWARF debug output
|
||||
// "-yp": Multiple ELF program sections
|
||||
// "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)
|
||||
//
|
||||
// "-Felf" and the format specifiers can also be supplied directly as
|
||||
// command line options, or selected from the Xlink Output tab in the
|
||||
// IAR Embedded Workbench.
|
||||
//*************************************************************************
|
||||
|
||||
// -Felf
|
||||
+2244
File diff suppressed because it is too large
Load Diff
+1696
File diff suppressed because it is too large
Load Diff
+2560
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\cmock_demo.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
@REM This bat file has been generated by the IAR Embeddded Workbench
|
||||
@REM C-SPY interactive debugger,as an aid to preparing a command
|
||||
@REM line for running the cspybat command line utility with the
|
||||
@REM appropriate settings.
|
||||
@REM
|
||||
@REM After making some adjustments to this file, you can launch cspybat
|
||||
@REM by typing the name of this file followed by the name of the debug
|
||||
@REM file (usually an ubrof file). Note that this file is generated
|
||||
@REM every time a new debug session is initialized, so you may want to
|
||||
@REM move or rename the file before making changes.
|
||||
@REM
|
||||
@REM Note: some command line arguments cannot be properly generated
|
||||
@REM by this process. Specifically, the plugin which is responsible
|
||||
@REM for the Terminal I/O window (and other C runtime functionality)
|
||||
@REM comes in a special version for cspybat, and the name of that
|
||||
@REM plugin dll is not known when generating this file. It resides in
|
||||
@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or
|
||||
@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding
|
||||
@REM tool chain. Replace the '<libsupport_plugin>' parameter
|
||||
@REM below with the appropriate file name. Other plugins loaded by
|
||||
@REM C-SPY are usually not needed by, or will not work in, cspybat
|
||||
@REM but they are listed at the end of this file for reference.
|
||||
|
||||
|
||||
"C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\<libsupport_plugin>" --macro "C:\svn\cmock\iar\SAM7_FLASH.mac" --backend -B "--endian" "little" "--cpu" "ARM7TDMI" "--fpu" "None" "--proc_device_desc_file" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\CONFIG\ioAT91SAM7X256.ddf" "--proc_driver" "jlink" "--jlink_connection" "USB:0" "--jlink_initial_speed" "32"
|
||||
|
||||
|
||||
@REM loaded plugins:
|
||||
@REM armlibsupport.dll
|
||||
@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\CodeCoverage\CodeCoverage.dll
|
||||
@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\Profiling\Profiling.dll
|
||||
@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\stack\stack.dll
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<Project>
|
||||
<Desktop>
|
||||
<Static>
|
||||
<Debug-Log/>
|
||||
<Workspace>
|
||||
<ColumnWidths>
|
||||
|
||||
|
||||
|
||||
|
||||
<Column0>234</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
|
||||
</Workspace>
|
||||
<Disassembly>
|
||||
|
||||
|
||||
|
||||
<MixedMode>1</MixedMode><CodeCovEnabled>0</CodeCovEnabled><CodeCovShow>0</CodeCovShow></Disassembly>
|
||||
<Build>
|
||||
<ColumnWidth0>20</ColumnWidth0>
|
||||
<ColumnWidth1>1115</ColumnWidth1>
|
||||
<ColumnWidth2>297</ColumnWidth2>
|
||||
<ColumnWidth3>74</ColumnWidth3>
|
||||
</Build>
|
||||
<TerminalIO><InputSource>1</InputSource><InputMode>10</InputMode><Filename>$PROJ_DIR$\TermIOInput.txt</Filename><InputEcho>1</InputEcho><ShowReset>0</ShowReset></TerminalIO></Static>
|
||||
<Windows>
|
||||
|
||||
|
||||
|
||||
<Wnd0>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-23656-3537</Identity>
|
||||
<TabName>Debug Log</TabName>
|
||||
<Factory>Debug-Log</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<Identity>TabID-22088-3567</Identity>
|
||||
<TabName>Build</TabName>
|
||||
<Factory>Build</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab><Identity>TabID-16970-5692</Identity><TabName>Terminal I/O</TabName><Factory>TerminalIO</Factory><Session/></Tab></Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd0><Wnd1>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-1637-3541</Identity>
|
||||
<TabName>Workspace</TabName>
|
||||
<Factory>Workspace</Factory>
|
||||
<Session>
|
||||
|
||||
<NodeDict><ExpandedNode>cmock_demo</ExpandedNode><ExpandedNode>cmock_demo/source</ExpandedNode></NodeDict></Session>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd1><Wnd2>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-12385-3544</Identity>
|
||||
<TabName>Disassembly</TabName>
|
||||
<Factory>Disassembly</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd2></Windows>
|
||||
<Editor>
|
||||
|
||||
|
||||
|
||||
|
||||
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\svn\cmock\test\system\src\Main.c</Filename><XPos>0</XPos><YPos>20</YPos><SelStart>820</SelStart><SelEnd>820</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
|
||||
<Positions>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Top><Row0><Sizes><Toolbar-008fe878><key>iaridepm1</key></Toolbar-008fe878></Sizes></Row0><Row1><Sizes><Toolbar-01a9f618><key>debuggergui1</key></Toolbar-01a9f618></Sizes></Row1></Top><Left><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>711</Bottom><Right>308</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>129366</sizeHorzCX><sizeHorzCY>173310</sizeHorzCY><sizeVertCX>200517</sizeVertCX><sizeVertCY>617851</sizeVertCY></Rect></Wnd1></Sizes></Row0></Left><Right><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>711</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>129366</sizeHorzCX><sizeHorzCY>173310</sizeHorzCY><sizeVertCX>129366</sizeVertCX><sizeVertCY>617851</sizeVertCY></Rect></Wnd2></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>375</Bottom><Right>1548</Right><x>-2</x><y>-2</y><xscreen>1550</xscreen><yscreen>377</yscreen><sizeHorzCX>1002587</sizeHorzCX><sizeHorzCY>326690</sizeHorzCY><sizeVertCX>129366</sizeVertCX><sizeVertCY>173310</sizeVertCY></Rect></Wnd0></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
|
||||
</Desktop>
|
||||
</Project>
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
[JLinkDriver]
|
||||
WatchCond=_ 0
|
||||
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
|
||||
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
|
||||
[DisAssemblyWindow]
|
||||
NumStates=_ 1
|
||||
State 1=_ 1
|
||||
[StackPlugin]
|
||||
Enabled=1
|
||||
OverflowWarningsEnabled=1
|
||||
WarningThreshold=90
|
||||
SpWarningsEnabled=1
|
||||
WarnHow=0
|
||||
UseTrigger=1
|
||||
TriggerName=main
|
||||
LimitSize=0
|
||||
ByteLimit=50
|
||||
[Interrupts]
|
||||
Enabled=1
|
||||
Irq0=_ 0 480549 0 480549 0 0 0 100 0 1 "IRQ 1 0x18 CPSR.I"
|
||||
Count=1
|
||||
[MemoryMap]
|
||||
Enabled=0
|
||||
Base=0
|
||||
UseAuto=0
|
||||
TypeViolation=1
|
||||
UnspecRange=1
|
||||
ActionState=1
|
||||
[Log file]
|
||||
LoggingEnabled=_ 0
|
||||
LogFile=_ ""
|
||||
Category=_ 0
|
||||
[TermIOLog]
|
||||
LoggingEnabled=_ 0
|
||||
LogFile=_ ""
|
||||
[Disassemble mode]
|
||||
mode=0
|
||||
[Breakpoints]
|
||||
Count=0
|
||||
[TraceHelper]
|
||||
Enabled=0
|
||||
ShowSource=1
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<Workspace>
|
||||
<ConfigDictionary>
|
||||
|
||||
<CurrentConfigs><Project>cmock_demo/Release</Project></CurrentConfigs></ConfigDictionary>
|
||||
<Desktop>
|
||||
<Static>
|
||||
<Workspace>
|
||||
<ColumnWidths>
|
||||
|
||||
|
||||
|
||||
|
||||
<Column0>252</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
|
||||
</Workspace>
|
||||
<Build>
|
||||
|
||||
|
||||
|
||||
|
||||
<ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1115</ColumnWidth1><ColumnWidth2>297</ColumnWidth2><ColumnWidth3>74</ColumnWidth3></Build>
|
||||
<Debug-Log/>
|
||||
<TerminalIO/>
|
||||
<CodeCoveragePlugin/>
|
||||
<Profiling/>
|
||||
</Static>
|
||||
<Windows>
|
||||
|
||||
|
||||
<Wnd0>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-20770-112</Identity>
|
||||
<TabName>Workspace</TabName>
|
||||
<Factory>Workspace</Factory>
|
||||
<Session>
|
||||
|
||||
<NodeDict><ExpandedNode>cmock_demo</ExpandedNode><ExpandedNode>cmock_demo/Startup</ExpandedNode><ExpandedNode>cmock_demo/source</ExpandedNode></NodeDict></Session>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd0><Wnd1>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-10733-1323</Identity>
|
||||
<TabName>Build</TabName>
|
||||
<Factory>Build</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<Identity>TabID-27316-3469</Identity>
|
||||
<TabName>Debug Log</TabName>
|
||||
<Factory>Debug-Log</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd1></Windows>
|
||||
<Editor>
|
||||
|
||||
|
||||
|
||||
|
||||
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\svn\cmock\test\system\src\Main.c</Filename><XPos>0</XPos><YPos>20</YPos><SelStart>725</SelStart><SelEnd>725</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
|
||||
<Positions>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Top><Row0><Sizes><Toolbar-008fe878><key>iaridepm1</key></Toolbar-008fe878></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>764</Bottom><Right>326</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>129366</sizeHorzCX><sizeHorzCY>173310</sizeHorzCY><sizeVertCX>212160</sizeVertCX><sizeVertCY>663778</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>346</Bottom><Right>1548</Right><x>-2</x><y>-2</y><xscreen>1550</xscreen><yscreen>348</yscreen><sizeHorzCX>1002587</sizeHorzCX><sizeHorzCY>301560</sizeHorzCY><sizeVertCX>129366</sizeVertCX><sizeVertCY>173310</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
|
||||
</Desktop>
|
||||
</Workspace>
|
||||
|
||||
|
||||
+1
-2
@@ -36,5 +36,4 @@ namespace :tests do
|
||||
report_summary
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2485,8 +2485,8 @@ extern AT91S_ADC AdcPeripheral;
|
||||
#define PIOA_ADDR 0xFFFFF400
|
||||
#define PIOB_ADDR 0xFFFFF600
|
||||
#define PMC_ADDR 0xFFFFFC00
|
||||
#define US0_ADDR 0xFFFFFC00
|
||||
#define TC0_ADDR 0xFFFFFC00
|
||||
#define US0_ADDR 0xFFFC0000
|
||||
#define TC0_ADDR 0xFFFA0000
|
||||
#define ADC_ADDR 0xFFFD8000
|
||||
|
||||
#endif // TEST
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
#include "AdcModel.h"
|
||||
|
||||
int AppMain(void)
|
||||
{
|
||||
{
|
||||
Executor_Init();
|
||||
|
||||
while(Executor_Run());
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef TEST
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _MYTYPES_H_
|
||||
#define _MYTYPES_H_
|
||||
|
||||
#include <AT91SAM7X256.h>
|
||||
#include "AT91SAM7X256.h"
|
||||
|
||||
#ifndef __monitor
|
||||
#define __monitor
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
void UsartConductor_Init(void)
|
||||
{
|
||||
UsartHardware_Init(UsartModel_GetBaudRateRegisterSetting());
|
||||
UsartHardware_Init(UsartModel_GetBaudRateRegisterSetting());
|
||||
UsartHardware_TransmitString(UsartModel_GetWakeupMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <math.h>
|
||||
|
||||
char formattedTemperature[32];
|
||||
char* wakeup = "It's Awesome Time!";
|
||||
char* wakeup = "It's Awesome Time!\n";
|
||||
|
||||
uint8 UsartModel_GetBaudRateRegisterSetting(void)
|
||||
{
|
||||
@@ -27,8 +27,8 @@ char* UsartModel_GetFormattedTemperature(void)
|
||||
}
|
||||
return formattedTemperature;
|
||||
}
|
||||
|
||||
char* UsartModel_GetWakeupMessage(void)
|
||||
{
|
||||
return wakeup;
|
||||
}
|
||||
|
||||
char* UsartModel_GetWakeupMessage(void)
|
||||
{
|
||||
return wakeup;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _USARTMODEL_H
|
||||
|
||||
uint8 UsartModel_GetBaudRateRegisterSetting(void);
|
||||
char* UsartModel_GetFormattedTemperature(void);
|
||||
char* UsartModel_GetFormattedTemperature(void);
|
||||
char* UsartModel_GetWakeupMessage(void);
|
||||
|
||||
#endif // _USARTMODEL_H
|
||||
|
||||
@@ -14,4 +14,3 @@ void Usart_PutChar(char data)
|
||||
AT91C_BASE_US0->US_THR = data;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -36,5 +36,5 @@ void testShouldReturnErrorMessageUponInvalidTemperatureValue(void)
|
||||
|
||||
void testShouldReturnWakeupMessage(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_STRING("It's Awesome Time!", UsartModel_GetWakeupMessage());
|
||||
TEST_ASSERT_EQUAL_STRING("It's Awesome Time!\n", UsartModel_GetWakeupMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user