mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-27 13:51:25 +03:00
.
This commit is contained in:
parent
630c6ac196
commit
f724b159c7
4
Makefile
4
Makefile
@ -258,8 +258,6 @@ endif
|
||||
|
||||
CFLAGS =
|
||||
|
||||
CFLAGS += -DCPU_CLOCK_HZ=48000000
|
||||
|
||||
ifeq ($(ENABLE_CLANG),0)
|
||||
#CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD
|
||||
CFLAGS += -Os -Werror -mcpu=cortex-m0 -freorder-blocks-algorithm=stc -std=c11 -MMD
|
||||
@ -282,6 +280,8 @@ endif
|
||||
# better to bust than add new bugs
|
||||
CFLAGS += -Wall -Wextra -Wpedantic
|
||||
|
||||
CFLAGS += -DCPU_CLOCK_HZ=48000000
|
||||
|
||||
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
|
||||
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
|
||||
ifeq ($(ENABLE_SWD),1)
|
||||
|
146
bsp/dp32g030/pwmplus.h
Normal file
146
bsp/dp32g030/pwmplus.h
Normal file
@ -0,0 +1,146 @@
|
||||
#ifndef HARDWARE_DP32G030_PWMPLUS_H
|
||||
#define HARDWARE_DP32G030_PWMPLUS_H
|
||||
|
||||
#define PWM_PLUS0_BASE_ADDR 0x400B4000U
|
||||
|
||||
//---------------
|
||||
|
||||
#define PWMPLUS_CFG 0x00U
|
||||
|
||||
#define PWMPLUS_CFG_COUNTER_EN_SHIFT 0U
|
||||
#define PWMPLUS_CFG_COUNTER_EN_WIDTH 1U
|
||||
#define PWMPLUS_CFG_COUNTER_EN_MASK (((1U << PWMPLUS_CFG_COUNTER_EN_WIDTH) - 1U) << PWMPLUS_CFG_COUNTER_EN_SHIFT)
|
||||
#define PWMPLUS_CFG_COUNTER_EN_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_CFG_COUNTER_EN_BITS_ENABLE (PWMPLUS_CFG_COUNTER_EN_VALUE_ENABLE << PWMPLUS_CFG_COUNTER_EN_SHIFT)
|
||||
|
||||
#define PWMPLUS_CFG_CNT_TYPE_SHIFT 1U
|
||||
|
||||
#define PWMPLUS_CFG_CNT_REP_SHIFT 2U
|
||||
#define PWMPLUS_CFG_CNT_REP_WIDTH 1U
|
||||
#define PWMPLUS_CFG_CNT_REP_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_CFG_CNT_REP_BITS_ENABLE (PWMPLUS_CFG_CNT_REP_VALUE_ENABLE << PWMPLUS_CFG_CNT_REP_SHIFT)
|
||||
|
||||
#define PWMPLUS_CFG_OUT_MODE_SHIFT 3U
|
||||
#define PWMPLUS_CFG_OUT_MODE_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_CFG_OUT_MODE_BITS_ENABLE (PWMPLUS_CFG_OUT_MODE_VALUE_ENABLE << PWMPLUS_CFG_OUT_MODE_SHIFT)
|
||||
|
||||
#define PWMPLUS_CFG_AUTO_RELOAD_SHIFT 8U
|
||||
|
||||
//---------------
|
||||
|
||||
#define PWMPLUS_GEN 0x04U
|
||||
|
||||
#define PWMPLUS_GEN_CH0_OE_SHIFT 24U
|
||||
#define PWMPLUS_GEN_CH0_OE_WIDTH 1U
|
||||
#define PWMPLUS_GEN_CH0_OE_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_GEN_CH0_OE_BITS_ENABLE (PWMPLUS_GEN_CH0_OE_VALUE_ENABLE << PWMPLUS_GEN_CH0_OE_SHIFT)
|
||||
|
||||
#define PWMPLUS_GEN_CH0_OUTINV_SHIFT 16U
|
||||
#define PWMPLUS_GEN_CH0_OUTINV_WIDTH 1U
|
||||
#define PWMPLUS_GEN_CH0_OUTINV_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_GEN_CH0_OUTINV_BITS_ENABLE (PWMPLUS_GEN_CH0_OUTINV_VALUE_ENABLE << PWMPLUS_GEN_CH0_OUTINV_SHIFT)
|
||||
|
||||
#define PWMPLUS_GEN_CH0_START_SHIFT 8U
|
||||
#define PWMPLUS_GEN_CH0_START_WIDTH 1U
|
||||
#define PWMPLUS_GEN_CH0_START_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_GEN_CH0_START_BITS_ENABLE (PWMPLUS_GEN_CH0_START_VALUE_ENABLE << PWMPLUS_GEN_CH0_START_SHIFT)
|
||||
|
||||
#define PWMPLUS_GEN_CH0_IDLE_SHIFT 0U
|
||||
#define PWMPLUS_GEN_CH0_IDLE_WIDTH 1U
|
||||
#define PWMPLUS_GEN_CH0_IDLE_VALUE_ENABLE 1U
|
||||
#define PWMPLUS_GEN_CH0_IDLE_BITS_ENABLE (PWMPLUS_GEN_CH0_IDLE_VALUE_ENABLE << PWMPLUS_GEN_CH0_IDLE_SHIFT)
|
||||
|
||||
//---------------
|
||||
|
||||
#define PWMPLUS_CLKSRC 0x08U
|
||||
#define PWMPLUS_BRAKE_CFG 0x0CU
|
||||
#define PWMPLUS_MASK_LEV 0x10U
|
||||
#define PWMPLUS_PERIOD 0x1CU
|
||||
#define PWMPLUS_CH0_COMP 0x20U
|
||||
#define PWMPLUS_CH1_COMP 0x24U
|
||||
#define PWMPLUS_CH2_COMP 0x28U
|
||||
#define PWMPLUS_CH0_DT 0x30U
|
||||
#define PWMPLUS_CH1_DT 0x34U
|
||||
#define PWMPLUS_CH2_DT 0x38U
|
||||
#define PWMPLUS_TRIG_COMP 0x40U
|
||||
#define PWMPLUS_TRIG_CFG 0x44U
|
||||
#define PWMPLUS_IE 0x60U
|
||||
#define PWMPLUS_IF 0x64U
|
||||
#define PWMPLUS_SWLOAD 0x84U
|
||||
#define PWMPLUS_MASK_EN 0x88
|
||||
#define PWMPLUS_CNT_ST 0xE0
|
||||
#define PWMPLUS_BRAKE_ST 0xE4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define PWM_PLUS0_CFG_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CFG)
|
||||
#define PWM_PLUS0_CFG (*(volatile uint32_t *)PWM_PLUS0_CFG_ADDR)
|
||||
|
||||
#define PWM_PLUS0_GEN_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_GEN)
|
||||
#define PWM_PLUS0_GEN (*(volatile uint32_t *)PWM_PLUS0_GEN_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CLKSRC_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CLKSRC)
|
||||
#define PWM_PLUS0_CLKSRC (*(volatile uint32_t *)PWM_PLUS0_CLKSRC_ADDR)
|
||||
|
||||
#define PWM_PLUS0_BRAKE_CFG_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_BRAKE_CFG)
|
||||
#define PWM_PLUS0_BRAKE_CFG (*(volatile uint32_t *)PWM_PLUS0_BRAKE_CFG_ADDR)
|
||||
|
||||
#define PWM_PLUS0_MASK_LEV_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_MASK_LEV)
|
||||
#define PWM_PLUS0_MASK_LEV (*(volatile uint32_t *)PWM_PLUS0_MASK_LEV_ADDR)
|
||||
|
||||
#define PWM_PLUS0_PERIOD_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_PERIOD)
|
||||
#define PWM_PLUS0_PERIOD (*(volatile uint32_t *)PWM_PLUS0_PERIOD_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CH0_COMP_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CH0_COMP)
|
||||
#define PWM_PLUS0_CH0_COMP (*(volatile uint32_t *)PWM_PLUS0_CH0_COMP_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CH1_COMP_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CH1_COMP)
|
||||
#define PWM_PLUS0_CH1_COMP (*(volatile uint32_t *)PWM_PLUS0_CH1_COMP_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CH2_COMP_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CH2_COMP)
|
||||
#define PWM_PLUS0_CH2_COMP (*(volatile uint32_t *)PWM_PLUS0_CH2_COMP_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CH0_DT_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CH0_DT)
|
||||
#define PWM_PLUS0_CH0_DT (*(volatile uint32_t *)PWM_PLUS0_CH0_DT_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CH1_DT_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CH1_DT)
|
||||
#define PWM_PLUS0_CH1_DT (*(volatile uint32_t *)PWM_PLUS0_CH1_DT_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CH2_DT_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CH2_DT)
|
||||
#define PWM_PLUS0_CH2_DT (*(volatile uint32_t *)PWM_PLUS0_CH2_DT_ADDR)
|
||||
|
||||
#define PWM_PLUS0_TRIG_COMP_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_TRIG_COMP)
|
||||
#define PWM_PLUS0_TRIG_COMP (*(volatile uint32_t *)PWM_PLUS0_TRIG_COMP_ADDR)
|
||||
|
||||
#define PWM_PLUS0_TRIG_CFG_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_TRIG_CFG)
|
||||
#define PWM_PLUS0_TRIG_CFG (*(volatile uint32_t *)PWM_PLUS0_TRIG_CFG_ADDR)
|
||||
|
||||
#define PWM_PLUS0_IE_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_IE)
|
||||
#define PWM_PLUS0_IE (*(volatile uint32_t *)PWM_PLUS0_IE_ADDR)
|
||||
|
||||
#define PWM_PLUS0_IF_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_IF)
|
||||
#define PWM_PLUS0_IF (*(volatile uint32_t *)PWM_PLUS0_IF_ADDR)
|
||||
|
||||
#define PWM_PLUS0_SWLOAD_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_SWLOAD)
|
||||
#define PWM_PLUS0_SWLOAD (*(volatile uint32_t *)PWM_PLUS0_SWLOAD_ADDR)
|
||||
|
||||
#define PWM_PLUS0_MASK_EN_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_MASK_EN)
|
||||
#define PWM_PLUS0_MASK_EN (*(volatile uint32_t *)PWM_PLUS0_MASK_EN_ADDR)
|
||||
|
||||
#define PWM_PLUS0_CNT_ST_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_CNT_ST)
|
||||
#define PWM_PLUS0_CNT_ST (*(volatile uint32_t *)PWM_PLUS0_CNT_ST_ADDR)
|
||||
|
||||
#define PWM_PLUS0_BRAKE_ST_ADDR (PWM_PLUS0_BASE_ADDR + PWMPLUS_BRAKE_ST)
|
||||
#define PWM_PLUS0_BRAKE_ST (*(volatile uint32_t *)PWM_PLUS0_BRAKE_ST_ADDR)
|
||||
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file main_s.c
|
||||
* @brief Code template for secure main function
|
||||
* @version V1.1.1
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* Use CMSE intrinsics */
|
||||
#include <arm_cmse.h>
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
|
||||
/* TZ_START_NS: Start address of non-secure application */
|
||||
#ifndef TZ_START_NS
|
||||
#define TZ_START_NS (0x200000U)
|
||||
#endif
|
||||
|
||||
/* typedef for non-secure callback functions */
|
||||
typedef void (*funcptr_void) (void) __attribute__((cmse_nonsecure_call));
|
||||
|
||||
/* Secure main() */
|
||||
int main(void) {
|
||||
funcptr_void NonSecure_ResetHandler;
|
||||
|
||||
/* Add user setup code for secure part here*/
|
||||
|
||||
/* Set non-secure main stack (MSP_NS) */
|
||||
__TZ_set_MSP_NS(*((uint32_t *)(TZ_START_NS)));
|
||||
|
||||
/* Get non-secure reset handler */
|
||||
NonSecure_ResetHandler = (funcptr_void)(*((uint32_t *)((TZ_START_NS) + 4U)));
|
||||
|
||||
/* Start non-secure state software application */
|
||||
NonSecure_ResetHandler();
|
||||
|
||||
/* Non-secure software does not return, this code is not executed */
|
||||
while (1) {
|
||||
__NOP();
|
||||
}
|
||||
}
|
@ -1,200 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file tz_context.c
|
||||
* @brief Context Management for Armv8-M TrustZone - Sample implementation
|
||||
* @version V1.1.1
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2016-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
#include "tz_context.h"
|
||||
|
||||
/// Number of process slots (threads may call secure library code)
|
||||
#ifndef TZ_PROCESS_STACK_SLOTS
|
||||
#define TZ_PROCESS_STACK_SLOTS 8U
|
||||
#endif
|
||||
|
||||
/// Stack size of the secure library code
|
||||
#ifndef TZ_PROCESS_STACK_SIZE
|
||||
#define TZ_PROCESS_STACK_SIZE 256U
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uint32_t sp_top; // stack space top
|
||||
uint32_t sp_limit; // stack space limit
|
||||
uint32_t sp; // current stack pointer
|
||||
} stack_info_t;
|
||||
|
||||
static stack_info_t ProcessStackInfo [TZ_PROCESS_STACK_SLOTS];
|
||||
static uint64_t ProcessStackMemory[TZ_PROCESS_STACK_SLOTS][TZ_PROCESS_STACK_SIZE/8U];
|
||||
static uint32_t ProcessStackFreeSlot = 0xFFFFFFFFU;
|
||||
|
||||
|
||||
/// Initialize secure context memory system
|
||||
/// \return execution status (1: success, 0: error)
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
uint32_t TZ_InitContextSystem_S (void) {
|
||||
uint32_t n;
|
||||
|
||||
if (__get_IPSR() == 0U) {
|
||||
return 0U; // Thread Mode
|
||||
}
|
||||
|
||||
for (n = 0U; n < TZ_PROCESS_STACK_SLOTS; n++) {
|
||||
ProcessStackInfo[n].sp = 0U;
|
||||
ProcessStackInfo[n].sp_limit = (uint32_t)&ProcessStackMemory[n];
|
||||
ProcessStackInfo[n].sp_top = (uint32_t)&ProcessStackMemory[n] + TZ_PROCESS_STACK_SIZE;
|
||||
*((uint32_t *)ProcessStackMemory[n]) = n + 1U;
|
||||
}
|
||||
*((uint32_t *)ProcessStackMemory[--n]) = 0xFFFFFFFFU;
|
||||
|
||||
ProcessStackFreeSlot = 0U;
|
||||
|
||||
// Default process stack pointer and stack limit
|
||||
__set_PSPLIM((uint32_t)ProcessStackMemory);
|
||||
__set_PSP ((uint32_t)ProcessStackMemory);
|
||||
|
||||
// Privileged Thread Mode using PSP
|
||||
__set_CONTROL(0x02U);
|
||||
|
||||
return 1U; // Success
|
||||
}
|
||||
|
||||
|
||||
/// Allocate context memory for calling secure software modules in TrustZone
|
||||
/// \param[in] module identifies software modules called from non-secure mode
|
||||
/// \return value != 0 id TrustZone memory slot identifier
|
||||
/// \return value 0 no memory available or internal error
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module) {
|
||||
uint32_t slot;
|
||||
|
||||
(void)module; // Ignore (fixed Stack size)
|
||||
|
||||
if (__get_IPSR() == 0U) {
|
||||
return 0U; // Thread Mode
|
||||
}
|
||||
|
||||
if (ProcessStackFreeSlot == 0xFFFFFFFFU) {
|
||||
return 0U; // No slot available
|
||||
}
|
||||
|
||||
slot = ProcessStackFreeSlot;
|
||||
ProcessStackFreeSlot = *((uint32_t *)ProcessStackMemory[slot]);
|
||||
|
||||
ProcessStackInfo[slot].sp = ProcessStackInfo[slot].sp_top;
|
||||
|
||||
return (slot + 1U);
|
||||
}
|
||||
|
||||
|
||||
/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id) {
|
||||
uint32_t slot;
|
||||
|
||||
if (__get_IPSR() == 0U) {
|
||||
return 0U; // Thread Mode
|
||||
}
|
||||
|
||||
if ((id == 0U) || (id > TZ_PROCESS_STACK_SLOTS)) {
|
||||
return 0U; // Invalid ID
|
||||
}
|
||||
|
||||
slot = id - 1U;
|
||||
|
||||
if (ProcessStackInfo[slot].sp == 0U) {
|
||||
return 0U; // Inactive slot
|
||||
}
|
||||
ProcessStackInfo[slot].sp = 0U;
|
||||
|
||||
*((uint32_t *)ProcessStackMemory[slot]) = ProcessStackFreeSlot;
|
||||
ProcessStackFreeSlot = slot;
|
||||
|
||||
return 1U; // Success
|
||||
}
|
||||
|
||||
|
||||
/// Load secure context (called on RTOS thread context switch)
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id) {
|
||||
uint32_t slot;
|
||||
|
||||
if ((__get_IPSR() == 0U) || ((__get_CONTROL() & 2U) == 0U)) {
|
||||
return 0U; // Thread Mode or using Main Stack for threads
|
||||
}
|
||||
|
||||
if ((id == 0U) || (id > TZ_PROCESS_STACK_SLOTS)) {
|
||||
return 0U; // Invalid ID
|
||||
}
|
||||
|
||||
slot = id - 1U;
|
||||
|
||||
if (ProcessStackInfo[slot].sp == 0U) {
|
||||
return 0U; // Inactive slot
|
||||
}
|
||||
|
||||
// Setup process stack pointer and stack limit
|
||||
__set_PSPLIM(ProcessStackInfo[slot].sp_limit);
|
||||
__set_PSP (ProcessStackInfo[slot].sp);
|
||||
|
||||
return 1U; // Success
|
||||
}
|
||||
|
||||
|
||||
/// Store secure context (called on RTOS thread context switch)
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id) {
|
||||
uint32_t slot;
|
||||
uint32_t sp;
|
||||
|
||||
if ((__get_IPSR() == 0U) || ((__get_CONTROL() & 2U) == 0U)) {
|
||||
return 0U; // Thread Mode or using Main Stack for threads
|
||||
}
|
||||
|
||||
if ((id == 0U) || (id > TZ_PROCESS_STACK_SLOTS)) {
|
||||
return 0U; // Invalid ID
|
||||
}
|
||||
|
||||
slot = id - 1U;
|
||||
|
||||
if (ProcessStackInfo[slot].sp == 0U) {
|
||||
return 0U; // Inactive slot
|
||||
}
|
||||
|
||||
sp = __get_PSP();
|
||||
if ((sp < ProcessStackInfo[slot].sp_limit) ||
|
||||
(sp > ProcessStackInfo[slot].sp_top)) {
|
||||
return 0U; // SP out of range
|
||||
}
|
||||
ProcessStackInfo[slot].sp = sp;
|
||||
|
||||
// Default process stack pointer and stack limit
|
||||
__set_PSPLIM((uint32_t)ProcessStackMemory);
|
||||
__set_PSP ((uint32_t)ProcessStackMemory);
|
||||
|
||||
return 1U; // Success
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Name: CV_Framework.h
|
||||
* Purpose: Framework header
|
||||
*----------------------------------------------------------------------------
|
||||
* Copyright (c) 2017 ARM Limited. All rights reserved.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifndef __FRAMEWORK_H__
|
||||
#define __FRAMEWORK_H__
|
||||
|
||||
#include "CV_Typedefs.h"
|
||||
#include "CV_Report.h"
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Test framework global definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Test case definition macro */
|
||||
#define TCD(x, y) {x, #x, y}
|
||||
|
||||
/* Test case description structure */
|
||||
typedef struct __TestCase {
|
||||
void (*TestFunc)(void); /* Test function */
|
||||
const char *TFName; /* Test function name string */
|
||||
BOOL en; /* Test function enabled */
|
||||
} TEST_CASE;
|
||||
|
||||
/* Test suite description structure */
|
||||
typedef struct __TestSuite {
|
||||
const char *FileName; /* Test module file name */
|
||||
const char *Date; /* Compilation date */
|
||||
const char *Time; /* Compilation time */
|
||||
const char *ReportTitle; /* Title or name of module under test */
|
||||
void (*Init)(void); /* Init function callback */
|
||||
|
||||
uint32_t TCBaseNum; /* Base number for test case numbering */
|
||||
TEST_CASE *TC; /* Array of test cases */
|
||||
uint32_t NumOfTC; /* Number of test cases (sz of TC array)*/
|
||||
|
||||
} TEST_SUITE;
|
||||
|
||||
/* Defined in user test module */
|
||||
extern TEST_SUITE ts;
|
||||
|
||||
#endif /* __FRAMEWORK_H__ */
|
@ -1,89 +0,0 @@
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Name: CV_Report.h
|
||||
* Purpose: Report statistics and layout header
|
||||
*----------------------------------------------------------------------------
|
||||
* Copyright (c) 2017 ARM Limited. All rights reserved.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifndef __REPORT_H__
|
||||
#define __REPORT_H__
|
||||
|
||||
#include "CV_Config.h"
|
||||
#include "CV_Typedefs.h"
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Test report global definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#define REP_TC_FAIL 0
|
||||
#define REP_TC_WARN 1
|
||||
#define REP_TC_PASS 2
|
||||
#define REP_TC_NOEX 3
|
||||
|
||||
/* Test case result definition */
|
||||
typedef enum {
|
||||
PASSED = 0,
|
||||
WARNING,
|
||||
FAILED,
|
||||
NOT_EXECUTED
|
||||
} TC_RES;
|
||||
|
||||
/* Assertion result info */
|
||||
typedef struct {
|
||||
const char *module; /* Module name */
|
||||
uint32_t line; /* Assertion line */
|
||||
} AS_INFO;
|
||||
|
||||
/* Test case callback interface definition */
|
||||
typedef struct {
|
||||
BOOL (* Result) (TC_RES res);
|
||||
BOOL (* Dbgi) (TC_RES res, const char *fn, uint32_t ln, char *desc);
|
||||
} TC_ITF;
|
||||
|
||||
/* Assert interface to the report */
|
||||
extern TC_ITF tcitf;
|
||||
|
||||
/* Assertion result buffer */
|
||||
typedef struct {
|
||||
AS_INFO passed[BUFFER_ASSERTIONS];
|
||||
AS_INFO failed[BUFFER_ASSERTIONS];
|
||||
AS_INFO warnings[BUFFER_ASSERTIONS];
|
||||
} AS_T_INFO;
|
||||
|
||||
/* Assertion statistics */
|
||||
typedef struct {
|
||||
uint32_t passed; /* Total assertions passed */
|
||||
uint32_t failed; /* Total assertions failed */
|
||||
uint32_t warnings; /* Total assertions warnings */
|
||||
AS_T_INFO info; /* Detailed assertion info */
|
||||
} AS_STAT;
|
||||
|
||||
/* Test global statistics */
|
||||
typedef struct {
|
||||
uint32_t tests; /* Total test cases count */
|
||||
uint32_t executed; /* Total test cases executed */
|
||||
uint32_t passed; /* Total test cases passed */
|
||||
uint32_t failed; /* Total test cases failed */
|
||||
uint32_t warnings; /* Total test cases warnings */
|
||||
AS_STAT assertions; /* Total assertions statistics */
|
||||
} TEST_REPORT;
|
||||
|
||||
/* Test report interface */
|
||||
typedef struct {
|
||||
BOOL (* Init) (void);
|
||||
BOOL (* Open) (const char *title, const char *date, const char *time, const char *fn);
|
||||
BOOL (* Close) (void);
|
||||
BOOL (* Open_TC) (uint32_t num, const char *fn);
|
||||
BOOL (* Close_TC) (void);
|
||||
} REPORT_ITF;
|
||||
|
||||
/* Test report statistics */
|
||||
extern TEST_REPORT test_report;
|
||||
|
||||
/* Test report interface */
|
||||
extern REPORT_ITF ritf;
|
||||
|
||||
/* Assertions and test results */
|
||||
extern TC_RES __set_result (const char *fn, uint32_t ln, TC_RES res, char* desc);
|
||||
extern TC_RES __assert_true (const char *fn, uint32_t ln, uint32_t cond);
|
||||
|
||||
#endif /* __REPORT_H__ */
|
@ -1,58 +0,0 @@
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Name: CV_Typedefs.h
|
||||
* Purpose: Test framework filetypes and structures description
|
||||
*----------------------------------------------------------------------------
|
||||
* Copyright (c) 2017 - 2018 Arm Limited. All rights reserved.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifndef __TYPEDEFS_H__
|
||||
#define __TYPEDEFS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef unsigned int BOOL;
|
||||
|
||||
#ifndef __TRUE
|
||||
#define __TRUE 1
|
||||
#endif
|
||||
#ifndef __FALSE
|
||||
#define __FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef ENABLED
|
||||
#define ENABLED 1
|
||||
#endif
|
||||
#ifndef DISABLED
|
||||
#define DISABLED 0
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus // EC++
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((void *) 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
|
||||
|
||||
#if defined( __GNUC__ ) || defined ( __clang__ )
|
||||
static const int PATH_DELIMITER = '/';
|
||||
#else
|
||||
static const int PATH_DELIMITER = '\\';
|
||||
#endif
|
||||
|
||||
//lint -emacro(9016,__FILENAME__) allow pointer arithmetic for truncating filename
|
||||
//lint -emacro(613,__FILENAME__) null pointer is checked
|
||||
#define __FILENAME__ ((strrchr(__FILE__, PATH_DELIMITER) != NULL) ? (strrchr(__FILE__, PATH_DELIMITER) + 1) : __FILE__)
|
||||
|
||||
/* Assertions and test results */
|
||||
#define SET_RESULT(res, desc) (void)__set_result(__FILENAME__, __LINE__, (res), (desc));
|
||||
|
||||
//lint -emacro(9031,ASSERT_TRUE) allow boolean condition as parameter
|
||||
//lint -emacro(613,ASSERT_TRUE) null pointer is checked
|
||||
#define ASSERT_TRUE(cond) (void)__assert_true (__FILENAME__, __LINE__, (cond) ? 1U : 0U)
|
||||
|
||||
#endif /* __TYPEDEFS_H__ */
|
@ -1,135 +0,0 @@
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Name: cmsis_cv.h
|
||||
* Purpose: cmsis_cv header
|
||||
*----------------------------------------------------------------------------
|
||||
* Copyright (c) 2017 - 2021 Arm Limited. All rights reserved.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifndef __CMSIS_CV_H
|
||||
#define __CMSIS_CV_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "CV_Config.h"
|
||||
|
||||
/* Expansion macro used to create CMSIS Driver references */
|
||||
#define EXPAND_SYMBOL(name, port) name##port
|
||||
#define CREATE_SYMBOL(name, port) EXPAND_SYMBOL(name, port)
|
||||
|
||||
// Simulator counter
|
||||
#ifndef HW_PRESENT
|
||||
extern uint32_t SIM_CYCCNT;
|
||||
#endif
|
||||
|
||||
// SVC interrupt callback
|
||||
extern void (*TST_IRQHandler)(void);
|
||||
|
||||
// Test main function
|
||||
extern void cmsis_cv (void);
|
||||
extern void cmsis_cv_abort (const char *fn, uint32_t ln, char *desc);
|
||||
|
||||
// Test cases
|
||||
extern void TC_CoreInstr_NOP (void);
|
||||
extern void TC_CoreInstr_SEV (void);
|
||||
extern void TC_CoreInstr_BKPT (void);
|
||||
extern void TC_CoreInstr_ISB (void);
|
||||
extern void TC_CoreInstr_DSB (void);
|
||||
extern void TC_CoreInstr_DMB (void);
|
||||
extern void TC_CoreInstr_WFI (void);
|
||||
extern void TC_CoreInstr_WFE (void);
|
||||
extern void TC_CoreInstr_REV (void);
|
||||
extern void TC_CoreInstr_REV16 (void);
|
||||
extern void TC_CoreInstr_REVSH (void);
|
||||
extern void TC_CoreInstr_ROR (void);
|
||||
extern void TC_CoreInstr_RBIT (void);
|
||||
extern void TC_CoreInstr_CLZ (void);
|
||||
extern void TC_CoreInstr_SSAT (void);
|
||||
extern void TC_CoreInstr_USAT (void);
|
||||
extern void TC_CoreInstr_RRX (void);
|
||||
extern void TC_CoreInstr_LoadStoreExclusive (void);
|
||||
extern void TC_CoreInstr_LoadStoreUnpriv (void);
|
||||
extern void TC_CoreInstr_LoadStoreAcquire (void);
|
||||
extern void TC_CoreInstr_LoadStoreAcquireExclusive (void);
|
||||
extern void TC_CoreInstr_UnalignedUint16 (void);
|
||||
extern void TC_CoreInstr_UnalignedUint32 (void);
|
||||
|
||||
extern void TC_CoreSimd_SatAddSub (void);
|
||||
extern void TC_CoreSimd_ParSat16 (void);
|
||||
extern void TC_CoreSimd_PackUnpack (void);
|
||||
extern void TC_CoreSimd_ParSel (void);
|
||||
extern void TC_CoreSimd_ParAddSub8 (void);
|
||||
extern void TC_CoreSimd_AbsDif8 (void);
|
||||
extern void TC_CoreSimd_ParAddSub16 (void);
|
||||
extern void TC_CoreSimd_ParMul16 (void);
|
||||
extern void TC_CoreSimd_Pack16 (void);
|
||||
extern void TC_CoreSimd_MulAcc32 (void);
|
||||
|
||||
#if defined(__CORTEX_M)
|
||||
extern void TC_CoreFunc_EnDisIRQ (void);
|
||||
extern void TC_CoreFunc_IRQPrio (void);
|
||||
extern void TC_CoreFunc_EncDecIRQPrio (void);
|
||||
extern void TC_CoreFunc_IRQVect (void);
|
||||
extern void TC_CoreFunc_Control (void);
|
||||
extern void TC_CoreFunc_IPSR (void);
|
||||
extern void TC_CoreFunc_APSR (void);
|
||||
extern void TC_CoreFunc_PSP (void);
|
||||
extern void TC_CoreFunc_MSP (void);
|
||||
extern void TC_CoreFunc_PSPLIM (void);
|
||||
extern void TC_CoreFunc_PSPLIM_NS (void);
|
||||
extern void TC_CoreFunc_MSPLIM (void);
|
||||
extern void TC_CoreFunc_MSPLIM_NS (void);
|
||||
extern void TC_CoreFunc_PRIMASK (void);
|
||||
extern void TC_CoreFunc_FAULTMASK (void);
|
||||
extern void TC_CoreFunc_BASEPRI (void);
|
||||
extern void TC_CoreFunc_FPUType (void);
|
||||
extern void TC_CoreFunc_FPSCR (void);
|
||||
#elif defined(__CORTEX_A)
|
||||
extern void TC_CoreAFunc_IRQ (void);
|
||||
extern void TC_CoreAFunc_FaultIRQ (void);
|
||||
extern void TC_CoreAFunc_FPSCR (void);
|
||||
extern void TC_CoreAFunc_CPSR (void);
|
||||
extern void TC_CoreAFunc_Mode (void);
|
||||
extern void TC_CoreAFunc_SP (void);
|
||||
extern void TC_CoreAFunc_SP_usr (void);
|
||||
extern void TC_CoreAFunc_FPEXC (void);
|
||||
extern void TC_CoreAFunc_ACTLR (void);
|
||||
extern void TC_CoreAFunc_CPACR (void);
|
||||
extern void TC_CoreAFunc_DFSR (void);
|
||||
extern void TC_CoreAFunc_IFSR (void);
|
||||
extern void TC_CoreAFunc_ISR (void);
|
||||
extern void TC_CoreAFunc_CBAR (void);
|
||||
extern void TC_CoreAFunc_TTBR0 (void);
|
||||
extern void TC_CoreAFunc_DACR (void);
|
||||
extern void TC_CoreAFunc_SCTLR (void);
|
||||
extern void TC_CoreAFunc_ACTRL (void);
|
||||
extern void TC_CoreAFunc_MPIDR (void);
|
||||
extern void TC_CoreAFunc_VBAR (void);
|
||||
extern void TC_CoreAFunc_MVBAR (void);
|
||||
extern void TC_CoreAFunc_FPU_Enable (void);
|
||||
#endif
|
||||
|
||||
#if defined(__CORTEX_M)
|
||||
extern void TC_MPU_SetClear (void);
|
||||
extern void TC_MPU_Load (void);
|
||||
#endif
|
||||
|
||||
#if defined(__CORTEX_A)
|
||||
extern void TC_GenTimer_CNTFRQ (void);
|
||||
extern void TC_GenTimer_CNTP_TVAL (void);
|
||||
extern void TC_GenTimer_CNTP_CTL (void);
|
||||
extern void TC_GenTimer_CNTPCT(void);
|
||||
extern void TC_GenTimer_CNTP_CVAL(void);
|
||||
#endif
|
||||
|
||||
#if defined(__CORTEX_M)
|
||||
extern void TC_CML1Cache_EnDisableICache(void);
|
||||
extern void TC_CML1Cache_EnDisableDCache(void);
|
||||
extern void TC_CML1Cache_CleanDCacheByAddrWhileDisabled(void);
|
||||
#elif defined(__CORTEX_A)
|
||||
extern void TC_CAL1Cache_EnDisable(void);
|
||||
extern void TC_CAL1Cache_EnDisableBTAC(void);
|
||||
extern void TC_CAL1Cache_log2_up(void);
|
||||
extern void TC_CAL1Cache_InvalidateDCacheAll(void);
|
||||
extern void TC_CAL1Cache_CleanDCacheAll(void);
|
||||
extern void TC_CAL1Cache_CleanInvalidateDCacheAll(void);
|
||||
#endif
|
||||
|
||||
#endif /* __CMSIS_CV_H */
|
201
external/CMSIS_5/CMSIS/CoreValidation/LICENSE.txt
vendored
201
external/CMSIS_5/CMSIS/CoreValidation/LICENSE.txt
vendored
@ -1,201 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -1,14 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: App
|
||||
# name: CMSIS-Core_Validation (Bootloader)
|
||||
description: Validation of CMSIS-Core implementation (Bootloader part)
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
groups:
|
||||
- group: Source Files
|
||||
files:
|
||||
- file: ./bootloader.c
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2016 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* ----------------------------------------------------------------------
|
||||
*
|
||||
* $Date: 15. October 2016
|
||||
* $Revision: 1.1.0
|
||||
*
|
||||
* Project: TrustZone for ARMv8-M
|
||||
* Title: Code template for secure main function
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Use CMSE intrinsics */
|
||||
#include <arm_cmse.h>
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
|
||||
/* TZ_START_NS: Start address of non-secure application */
|
||||
#ifndef TZ_START_NS
|
||||
#define TZ_START_NS (0x200000U)
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
/* Dummy Non-secure callable (entry) function */
|
||||
__attribute__((cmse_nonsecure_entry)) int validationDummy(int x) {
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* typedef for non-secure callback functions */
|
||||
typedef void (*funcptr_void) (void) __attribute__((cmse_nonsecure_call));
|
||||
|
||||
/* Secure main() */
|
||||
int main(void) {
|
||||
funcptr_void NonSecure_ResetHandler;
|
||||
|
||||
/* Add user setup code for secure part here*/
|
||||
|
||||
/* Set non-secure main stack (MSP_NS) */
|
||||
__TZ_set_MSP_NS(*((uint32_t *)(TZ_START_NS)));
|
||||
|
||||
/* Get non-secure reset handler */
|
||||
NonSecure_ResetHandler = (funcptr_void)(*((uint32_t *)((TZ_START_NS) + 4U)));
|
||||
|
||||
/* Start non-secure state software application */
|
||||
NonSecure_ResetHandler();
|
||||
|
||||
/* Non-secure software does not return, this code is not executed */
|
||||
while (1) {
|
||||
__NOP();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__CORTEX_M)
|
||||
__NO_RETURN
|
||||
extern void HardFault_Handler(void);
|
||||
void HardFault_Handler(void) {
|
||||
printf("Bootloader HardFault!\n");
|
||||
#ifdef __MICROLIB
|
||||
for(;;) {}
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
#endif
|
@ -1,48 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: App
|
||||
# name: CMSIS-Core_Validation
|
||||
description: Validation of CMSIS-Core implementation
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
define:
|
||||
- PRINT_XML_REPORT: 1
|
||||
|
||||
add-path:
|
||||
- ../../../Include
|
||||
- ../../../Source/ConfigA
|
||||
|
||||
misc:
|
||||
- for-compiler: AC6
|
||||
C-CPP:
|
||||
- -Wno-declaration-after-statement
|
||||
- -Wno-covered-switch-default
|
||||
- for-compiler: GCC
|
||||
C-CPP:
|
||||
- -Wno-declaration-after-statement
|
||||
- -Wno-covered-switch-default
|
||||
|
||||
groups:
|
||||
- group: Documentation
|
||||
files:
|
||||
- file: ../../../README.md
|
||||
|
||||
- group: Source Files
|
||||
files:
|
||||
- file: ./main.c
|
||||
|
||||
- group: CMSIS-Core_Validation
|
||||
files:
|
||||
- file: ../../../Source/cmsis_cv.c
|
||||
- file: ../../../Source/CV_CoreAFunc.c
|
||||
- file: ../../../Source/CV_CoreInstr.c
|
||||
- file: ../../../Source/CV_CAL1Cache.c
|
||||
# - file: ../../../Source/ConfigA/mmu.c
|
||||
|
||||
- group: Validation Framework
|
||||
files:
|
||||
- file: ../../../Source/CV_Framework.c
|
||||
- file: ../../../Source/CV_Report.c
|
@ -1,133 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 ARM Limited or its affiliates. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
|
||||
#ifdef RTE_Compiler_EventRecorder
|
||||
#include "EventRecorder.h"
|
||||
#endif
|
||||
|
||||
#include "cmsis_cv.h"
|
||||
#include "CV_Report.h"
|
||||
|
||||
//lint -e970 allow using int for main
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
||||
// System Initialization
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
#ifdef RTE_Compiler_EventRecorder
|
||||
// Initialize and start Event Recorder
|
||||
(void)EventRecorderInitialize(EventRecordError, 1U);
|
||||
(void)EventRecorderEnable(EventRecordAll, 0xFEU, 0xFEU);
|
||||
#endif
|
||||
|
||||
cmsis_cv();
|
||||
|
||||
#ifdef __MICROLIB
|
||||
for(;;) {}
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__CORTEX_A)
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#if (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || \
|
||||
(defined ( __GNUC__ ))
|
||||
#define __IRQ __attribute__((interrupt("IRQ")))
|
||||
#elif defined ( __CC_ARM )
|
||||
#define __IRQ __irq
|
||||
#elif defined ( __ICCARM__ )
|
||||
#define __IRQ __irq __arm
|
||||
#else
|
||||
#error "Unsupported compiler!"
|
||||
#endif
|
||||
|
||||
|
||||
__IRQ
|
||||
void IRQ_Handler(void);
|
||||
__IRQ
|
||||
void IRQ_Handler(void) {
|
||||
const IRQn_ID_t irqn = IRQ_GetActiveIRQ();
|
||||
IRQHandler_t const handler = IRQ_GetHandler(irqn);
|
||||
if (handler != NULL) {
|
||||
__enable_irq();
|
||||
handler();
|
||||
__disable_irq();
|
||||
}
|
||||
IRQ_EndOfInterrupt(irqn);
|
||||
}
|
||||
|
||||
__IRQ __NO_RETURN
|
||||
void Undef_Handler (void);
|
||||
__IRQ __NO_RETURN
|
||||
void Undef_Handler (void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "Undefined Instruction!");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
__IRQ
|
||||
void SVC_Handler (void);
|
||||
__IRQ
|
||||
void SVC_Handler (void) {
|
||||
}
|
||||
|
||||
__IRQ __NO_RETURN
|
||||
void PAbt_Handler (void);
|
||||
__IRQ __NO_RETURN
|
||||
void PAbt_Handler (void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "Prefetch Abort!");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
__IRQ __NO_RETURN
|
||||
void DAbt_Handler (void);
|
||||
__IRQ __NO_RETURN
|
||||
void DAbt_Handler (void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "Data Abort!");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
__IRQ
|
||||
void FIQ_Handler (void);
|
||||
__IRQ
|
||||
void FIQ_Handler (void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__CORTEX_M)
|
||||
__NO_RETURN
|
||||
void HardFault_Handler(void);
|
||||
__NO_RETURN
|
||||
void HardFault_Handler(void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "HardFault!");
|
||||
#ifdef __MICROLIB
|
||||
for(;;) {}
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
@ -1,73 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: App
|
||||
# name: CMSIS-Core_Validation
|
||||
description: Validation of CMSIS-Core implementation
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
define:
|
||||
- PRINT_XML_REPORT: 1
|
||||
|
||||
add-path:
|
||||
- ../../../Include
|
||||
- ../../../Source/Config
|
||||
|
||||
misc:
|
||||
- for-compiler: AC6
|
||||
C-CPP:
|
||||
- -Wno-declaration-after-statement
|
||||
- -Wno-covered-switch-default
|
||||
- for-compiler: GCC
|
||||
C-CPP:
|
||||
- -Wno-declaration-after-statement
|
||||
- -Wno-covered-switch-default
|
||||
|
||||
groups:
|
||||
- group: Documentation
|
||||
files:
|
||||
- file: ../../../README.md
|
||||
|
||||
- group: Source Files
|
||||
files:
|
||||
- file: ./main.c
|
||||
|
||||
- group: CMSIS-Core_Validation
|
||||
files:
|
||||
- file: ../../../Source/cmsis_cv.c
|
||||
- file: ../../../Source/CV_CoreFunc.c
|
||||
- file: ../../../Source/CV_CoreInstr.c
|
||||
- file: ../../../Source/CV_CoreSimd.c
|
||||
- file: ../../../Source/CV_CML1Cache.c
|
||||
- file: ../../../Source/CV_MPU_ARMv7.c
|
||||
for-context:
|
||||
- +CM0
|
||||
- +CM0plus
|
||||
- +CM3
|
||||
- +CM4
|
||||
- +CM4FP
|
||||
- +CM7
|
||||
- +CM7SP
|
||||
- +CM7DP
|
||||
- file: ../../../Source/CV_MPU_ARMv8.c
|
||||
for-context:
|
||||
- +CM23
|
||||
- +CM23S
|
||||
- +CM23NS
|
||||
- +CM33
|
||||
- +CM33S
|
||||
- +CM33NS
|
||||
- +CM35P
|
||||
- +CM35PS
|
||||
- +CM35PNS
|
||||
- +CM55S
|
||||
- +CM55NS
|
||||
- +CM85S
|
||||
- +CM85NS
|
||||
|
||||
- group: Validation Framework
|
||||
files:
|
||||
- file: ../../../Source/CV_Framework.c
|
||||
- file: ../../../Source/CV_Report.c
|
@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 ARM Limited or its affiliates. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
|
||||
#ifdef RTE_Compiler_EventRecorder
|
||||
#include "EventRecorder.h"
|
||||
#endif
|
||||
|
||||
#include "cmsis_cv.h"
|
||||
#include "CV_Report.h"
|
||||
|
||||
//lint -e970 allow using int for main
|
||||
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#include <arm_cmse.h>
|
||||
|
||||
/* Dummy Non-secure callable (entry) function */
|
||||
__attribute__((cmse_nonsecure_entry)) int validationDummy(int x) {
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
||||
// System Initialization
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
#ifdef RTE_Compiler_EventRecorder
|
||||
// Initialize and start Event Recorder
|
||||
(void)EventRecorderInitialize(EventRecordError, 1U);
|
||||
(void)EventRecorderEnable(EventRecordAll, 0xFEU, 0xFEU);
|
||||
#endif
|
||||
|
||||
cmsis_cv();
|
||||
|
||||
#ifdef __MICROLIB
|
||||
for(;;) {}
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__CORTEX_A)
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#if (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || \
|
||||
(defined ( __GNUC__ ))
|
||||
#define __IRQ __attribute__((interrupt("IRQ")))
|
||||
#elif defined ( __CC_ARM )
|
||||
#define __IRQ __irq
|
||||
#elif defined ( __ICCARM__ )
|
||||
#define __IRQ __irq __arm
|
||||
#else
|
||||
#error "Unsupported compiler!"
|
||||
#endif
|
||||
|
||||
|
||||
__IRQ
|
||||
void IRQ_Handler(void);
|
||||
__IRQ
|
||||
void IRQ_Handler(void) {
|
||||
const IRQn_ID_t irqn = IRQ_GetActiveIRQ();
|
||||
IRQHandler_t const handler = IRQ_GetHandler(irqn);
|
||||
if (handler != NULL) {
|
||||
__enable_irq();
|
||||
handler();
|
||||
__disable_irq();
|
||||
}
|
||||
IRQ_EndOfInterrupt(irqn);
|
||||
}
|
||||
|
||||
__IRQ __NO_RETURN
|
||||
void Undef_Handler (void);
|
||||
__IRQ __NO_RETURN
|
||||
void Undef_Handler (void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "Undefined Instruction!");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
__IRQ
|
||||
void SVC_Handler (void);
|
||||
__IRQ
|
||||
void SVC_Handler (void) {
|
||||
}
|
||||
|
||||
__IRQ __NO_RETURN
|
||||
void PAbt_Handler (void);
|
||||
__IRQ __NO_RETURN
|
||||
void PAbt_Handler (void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "Prefetch Abort!");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
__IRQ __NO_RETURN
|
||||
void DAbt_Handler (void);
|
||||
__IRQ __NO_RETURN
|
||||
void DAbt_Handler (void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "Data Abort!");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
__IRQ
|
||||
void FIQ_Handler (void);
|
||||
__IRQ
|
||||
void FIQ_Handler (void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__CORTEX_M)
|
||||
__NO_RETURN
|
||||
void HardFault_Handler(void);
|
||||
__NO_RETURN
|
||||
void HardFault_Handler(void) {
|
||||
cmsis_cv_abort(__FILENAME__, __LINE__, "HardFault!");
|
||||
#ifdef __MICROLIB
|
||||
for(;;) {}
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
@ -1,67 +0,0 @@
|
||||
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = 0x80000000;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = 0x801FFFFF;
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = 0x80200000;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = 0x803FFFFF;
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_TTB_start__ = 0x80500000;
|
||||
define symbol __ICFEDIT_region_TTB_end__ = 0x805FFFFF;
|
||||
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
define symbol __ICFEDIT_size_irqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_svcstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_abtstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_undstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x8000;
|
||||
define symbol __ICFEDIT_size_ttb__ = 0x4000;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__];
|
||||
define region TTB_region = mem:[from __ICFEDIT_region_TTB_start__ to __ICFEDIT_region_TTB_end__ ];
|
||||
|
||||
define block USR_STACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
|
||||
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
|
||||
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
|
||||
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
|
||||
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block TTB with alignment = 8, size = __ICFEDIT_size_ttb__ { section TTB };
|
||||
|
||||
do not initialize { section .noinit };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
place at address mem:__ICFEDIT_region_IROM1_start__ { readonly section RESET };
|
||||
place in IROM_region { readonly };
|
||||
place in IRAM_region { readwrite, block HEAP, block USR_STACK, block IRQ_STACK, block FIQ_STACK, block SVC_STACK, block ABT_STACK, block UND_STACK };
|
||||
place in TTB_region { block TTB };
|
@ -1,67 +0,0 @@
|
||||
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = 0x80000000;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = 0x801FFFFF;
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = 0x80200000;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = 0x803FFFFF;
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_TTB_start__ = 0x80500000;
|
||||
define symbol __ICFEDIT_region_TTB_end__ = 0x805FFFFF;
|
||||
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
define symbol __ICFEDIT_size_irqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_svcstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_abtstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_undstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x8000;
|
||||
define symbol __ICFEDIT_size_ttb__ = 0x4000;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__];
|
||||
define region TTB_region = mem:[from __ICFEDIT_region_TTB_start__ to __ICFEDIT_region_TTB_end__ ];
|
||||
|
||||
define block USR_STACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
|
||||
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
|
||||
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
|
||||
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
|
||||
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block TTB with alignment = 8, size = __ICFEDIT_size_ttb__ { section TTB };
|
||||
|
||||
do not initialize { section .noinit };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
place at address mem:__ICFEDIT_region_IROM1_start__ { readonly section RESET };
|
||||
place in IROM_region { readonly };
|
||||
place in IRAM_region { readwrite, block HEAP, block USR_STACK, block IRQ_STACK, block FIQ_STACK, block SVC_STACK, block ABT_STACK, block UND_STACK };
|
||||
place in TTB_region { block TTB };
|
@ -1,181 +0,0 @@
|
||||
#include "mem_ARMCA5.h"
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ROM (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
L_TTB (rw) : ORIGIN = __TTB_BASE, LENGTH = __TTB_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
|
||||
Image$$VECTORS$$Base = .;
|
||||
* (RESET)
|
||||
KEEP(*(.isr_vector))
|
||||
Image$$VECTORS$$Limit = .;
|
||||
|
||||
*(SVC_TABLE)
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
Image$$RO_DATA$$Base = .;
|
||||
*(.rodata*)
|
||||
Image$$RO_DATA$$Limit = .;
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > ROM
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > ROM
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > ROM
|
||||
__exidx_end = .;
|
||||
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > ROM
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > ROM
|
||||
|
||||
__etext = .;
|
||||
|
||||
.ttb :
|
||||
{
|
||||
Image$$TTB$$ZI$$Base = .;
|
||||
. += __TTB_SIZE;
|
||||
Image$$TTB$$ZI$$Limit = .;
|
||||
} > L_TTB
|
||||
|
||||
.data :
|
||||
{
|
||||
Image$$RW_DATA$$Base = .;
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
Image$$RW_DATA$$Limit = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE (__fini_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
|
||||
.bss ALIGN(0x400):
|
||||
{
|
||||
Image$$ZI_DATA$$Base = .;
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
__bss_end__ = .;
|
||||
Image$$ZI_DATA$$Limit = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
} > RAM AT > RAM
|
||||
|
||||
#if defined(__HEAP_SIZE) && (__HEAP_SIZE > 0)
|
||||
.heap (NOLOAD):
|
||||
{
|
||||
. = ALIGN(8);
|
||||
Image$$HEAP$$ZI$$Base = .;
|
||||
. += __HEAP_SIZE;
|
||||
Image$$HEAP$$ZI$$Limit = .;
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
#endif
|
||||
|
||||
.stack (NOLOAD):
|
||||
{
|
||||
. = ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE - __FIQ_STACK_SIZE - __IRQ_STACK_SIZE - __SVC_STACK_SIZE - __ABT_STACK_SIZE - __UND_STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
|
||||
__StackTop = .;
|
||||
Image$$SYS_STACK$$ZI$$Base = .;
|
||||
. += __STACK_SIZE;
|
||||
Image$$SYS_STACK$$ZI$$Limit = .;
|
||||
__stack = .;
|
||||
|
||||
Image$$FIQ_STACK$$ZI$$Base = .;
|
||||
. += __FIQ_STACK_SIZE;
|
||||
Image$$FIQ_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$IRQ_STACK$$ZI$$Base = .;
|
||||
. += __IRQ_STACK_SIZE;
|
||||
Image$$IRQ_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$SVC_STACK$$ZI$$Base = .;
|
||||
. += __SVC_STACK_SIZE;
|
||||
Image$$SVC_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$ABT_STACK$$ZI$$Base = .;
|
||||
. += __ABT_STACK_SIZE;
|
||||
Image$$ABT_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$UND_STACK$$ZI$$Base = .;
|
||||
. += __UND_STACK_SIZE;
|
||||
Image$$UND_STACK$$ZI$$Limit = .;
|
||||
|
||||
} > RAM
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-a5 -xc
|
||||
;**************************************************
|
||||
; Copyright (c) 2017 ARM Ltd. All rights reserved.
|
||||
;**************************************************
|
||||
|
||||
; Scatter-file for RTX Example on Versatile Express
|
||||
|
||||
; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map.
|
||||
|
||||
; This platform has 2GB SDRAM starting at 0x80000000.
|
||||
|
||||
#include "mem_ARMCA5.h"
|
||||
|
||||
SDRAM __ROM_BASE __ROM_SIZE ; load region size_region
|
||||
{
|
||||
VECTORS __ROM_BASE __ROM_SIZE ; load address = execution address
|
||||
{
|
||||
* (RESET, +FIRST) ; Vector table and other startup code
|
||||
* (InRoot$$Sections) ; All (library) code that must be in a root region
|
||||
* (+RO-CODE) ; Application RO code (.text)
|
||||
* (+RO-DATA) ; Application RO data (.constdata)
|
||||
}
|
||||
|
||||
RW_DATA __RAM_BASE __RW_DATA_SIZE
|
||||
{ * (+RW) } ; Application RW data (.data)
|
||||
|
||||
ZI_DATA (__RAM_BASE+
|
||||
__RW_DATA_SIZE) __ZI_DATA_SIZE
|
||||
{ * (+ZI) } ; Application ZI data (.bss)
|
||||
|
||||
ARM_LIB_HEAP (__RAM_BASE
|
||||
+__RW_DATA_SIZE
|
||||
+__ZI_DATA_SIZE) EMPTY __HEAP_SIZE ; Heap region growing up
|
||||
{ }
|
||||
|
||||
ARM_LIB_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE
|
||||
-__ABT_STACK_SIZE
|
||||
-__UND_STACK_SIZE) EMPTY -__STACK_SIZE ; Stack region growing down
|
||||
{ }
|
||||
|
||||
UND_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE
|
||||
-__ABT_STACK_SIZE) EMPTY -__UND_STACK_SIZE ; UND mode stack
|
||||
{ }
|
||||
|
||||
ABT_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE) EMPTY -__ABT_STACK_SIZE ; ABT mode stack
|
||||
{ }
|
||||
|
||||
SVC_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE) EMPTY -__SVC_STACK_SIZE ; SVC mode stack
|
||||
{ }
|
||||
|
||||
IRQ_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE) EMPTY -__IRQ_STACK_SIZE ; IRQ mode stack
|
||||
{ }
|
||||
|
||||
FIQ_STACK (__RAM_BASE
|
||||
+__RAM_SIZE) EMPTY -__FIQ_STACK_SIZE ; FIQ mode stack
|
||||
{ }
|
||||
|
||||
TTB __TTB_BASE EMPTY __TTB_SIZE ; Level-1 Translation Table for MMU
|
||||
{ }
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file mem_ARMCA5.h
|
||||
* @brief Memory base and size definitions (used in scatter file)
|
||||
* @version V1.1.0
|
||||
* @date 15. May 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __MEM_ARMCA5_H
|
||||
#define __MEM_ARMCA5_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
/*
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
*/
|
||||
|
||||
/*--------------------- ROM Configuration ------------------------------------
|
||||
//
|
||||
// <h> ROM Configuration
|
||||
// <i> For compatibility with MMU config the sections must be multiple of 1MB
|
||||
// <o0> ROM Base Address <0x0-0xFFFFFFFF:0x100000>
|
||||
// <o1> ROM Size (in Bytes) <0x0-0xFFFFFFFF:0x100000>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x80000000
|
||||
#define __ROM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- RAM Configuration -----------------------------------
|
||||
// <h> RAM Configuration
|
||||
// <i> For compatibility with MMU config the sections must be multiple of 1MB
|
||||
// <o0> RAM Base Address <0x0-0xFFFFFFFF:0x100000>
|
||||
// <o1> RAM Total Size (in Bytes) <0x0-0xFFFFFFFF:0x100000>
|
||||
// <h> Data Sections
|
||||
// <o2> RW_DATA Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o3> ZI_DATA Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
// <h> Stack / Heap Configuration
|
||||
// <o4> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o5> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <h> Exceptional Modes
|
||||
// <o6> UND Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o7> ABT Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o8> SVC Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o9> IRQ Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o10> FIQ Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
// </h>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x80200000
|
||||
#define __RAM_SIZE 0x00200000
|
||||
|
||||
#define __RW_DATA_SIZE 0x00100000
|
||||
#define __ZI_DATA_SIZE 0x000F0000
|
||||
|
||||
#define __STACK_SIZE 0x00001000
|
||||
#define __HEAP_SIZE 0x00008000
|
||||
|
||||
#define __UND_STACK_SIZE 0x00000100
|
||||
#define __ABT_STACK_SIZE 0x00000100
|
||||
#define __SVC_STACK_SIZE 0x00000100
|
||||
#define __IRQ_STACK_SIZE 0x00000100
|
||||
#define __FIQ_STACK_SIZE 0x00000100
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------- TTB Configuration ------------------------------------
|
||||
//
|
||||
// <h> TTB Configuration
|
||||
// <i> The TLB L1 contains 4096 32-bit entries and must be 16kB aligned
|
||||
// <i> The TLB L2 entries are placed after the L1 in the MMU config
|
||||
// <o0> TTB Base Address <0x0-0xFFFFFFFF:0x4000>
|
||||
// <o1> TTB Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __TTB_BASE 0x80500000
|
||||
#define __TTB_SIZE 0x00005000
|
||||
|
||||
#endif /* __MEM_ARMCA5_H */
|
@ -1,232 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file mmu_ARMCA5.c
|
||||
* @brief MMU Configuration for ARM Cortex-A5 Device Series
|
||||
* @version V1.2.0
|
||||
* @date 15. May 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* Memory map description from: DUI0447G_v2m_p1_trm.pdf 4.2.2 Arm Cortex-A Series memory map
|
||||
|
||||
Memory Type
|
||||
0xffffffff |--------------------------| ------------
|
||||
| FLAG SYNC | Device Memory
|
||||
0xfffff000 |--------------------------| ------------
|
||||
| Fault | Fault
|
||||
0xfff00000 |--------------------------| ------------
|
||||
| | Normal
|
||||
| |
|
||||
| Daughterboard |
|
||||
| memory |
|
||||
| |
|
||||
0x80505000 |--------------------------| ------------
|
||||
|TTB (L2 Sync Flags ) 4k | Normal
|
||||
0x80504C00 |--------------------------| ------------
|
||||
|TTB (L2 Peripherals-B) 16k| Normal
|
||||
0x80504800 |--------------------------| ------------
|
||||
|TTB (L2 Peripherals-A) 16k| Normal
|
||||
0x80504400 |--------------------------| ------------
|
||||
|TTB (L2 Priv Periphs) 4k | Normal
|
||||
0x80504000 |--------------------------| ------------
|
||||
| TTB (L1 Descriptors) | Normal
|
||||
0x80500000 |--------------------------| ------------
|
||||
| Stack | Normal
|
||||
|--------------------------| ------------
|
||||
| Heap | Normal
|
||||
0x80400000 |--------------------------| ------------
|
||||
| ZI Data | Normal
|
||||
0x80300000 |--------------------------| ------------
|
||||
| RW Data | Normal
|
||||
0x80200000 |--------------------------| ------------
|
||||
| RO Data | Normal
|
||||
|--------------------------| ------------
|
||||
| RO Code | USH Normal
|
||||
0x80000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| HSB AXI buses |
|
||||
0x40000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| test chips peripherals |
|
||||
0x2c002000 |--------------------------| ------------
|
||||
| Private Address | Device Memory
|
||||
0x2c000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| test chips peripherals |
|
||||
0x20000000 |--------------------------| ------------
|
||||
| Peripherals | Device Memory RW/RO
|
||||
| | & Fault
|
||||
0x00000000 |--------------------------|
|
||||
*/
|
||||
|
||||
// L1 Cache info and restrictions about architecture of the caches (CCSIR register):
|
||||
// Write-Through support *not* available
|
||||
// Write-Back support available.
|
||||
// Read allocation support available.
|
||||
// Write allocation support available.
|
||||
|
||||
//Note: You should use the Shareable attribute carefully.
|
||||
//For cores without coherency logic (such as SCU) marking a region as shareable forces the processor to not cache that region regardless of the inner cache settings.
|
||||
//Cortex-A versions of RTX use LDREX/STREX instructions relying on Local monitors. Local monitors will be used only when the region gets cached, regions that are not cached will use the Global Monitor.
|
||||
//Some Cortex-A implementations do not include Global Monitors, so wrongly setting the attribute Shareable may cause STREX to fail.
|
||||
|
||||
//Recall: When the Shareable attribute is applied to a memory region that is not Write-Back, Normal memory, data held in this region is treated as Non-cacheable.
|
||||
//When SMP bit = 0, Inner WB/WA Cacheable Shareable attributes are treated as Non-cacheable.
|
||||
//When SMP bit = 1, Inner WB/WA Cacheable Shareable attributes are treated as Cacheable.
|
||||
|
||||
|
||||
//Following MMU configuration is expected
|
||||
//SCTLR.AFE == 1 (Simplified access permissions model - AP[2:1] define access permissions, AP[0] is an access flag)
|
||||
//SCTLR.TRE == 0 (TEX remap disabled, so memory type and attributes are described directly by bits in the descriptor)
|
||||
//Domain 0 is always the Client domain
|
||||
//Descriptors should place all memory in domain 0
|
||||
|
||||
#include "ARMCA5.h"
|
||||
#include "mem_ARMCA5.h"
|
||||
|
||||
// TTB base address
|
||||
#define TTB_BASE ((uint32_t*)__TTB_BASE)
|
||||
|
||||
// L2 table pointers
|
||||
//----------------------------------------
|
||||
#define TTB_L1_SIZE (0x00004000) // The L1 translation table divides the full 4GB address space of a 32-bit core
|
||||
// into 4096 equally sized sections, each of which describes 1MB of virtual memory space.
|
||||
// The L1 translation table therefore contains 4096 32-bit (word-sized) entries.
|
||||
|
||||
#define PRIVATE_TABLE_L2_BASE_4k (__TTB_BASE + TTB_L1_SIZE) // Map 4k Private Address space
|
||||
#define PERIPHERAL_A_TABLE_L2_BASE_64k (__TTB_BASE + TTB_L1_SIZE + 0x400) // Map 64k Peripheral #1 0x1C000000 - 0x1C00FFFFF
|
||||
#define PERIPHERAL_B_TABLE_L2_BASE_64k (__TTB_BASE + TTB_L1_SIZE + 0x800) // Map 64k Peripheral #2 0x1C100000 - 0x1C1FFFFFF
|
||||
#define SYNC_FLAGS_TABLE_L2_BASE_4k (__TTB_BASE + TTB_L1_SIZE + 0xC00) // Map 4k Flag synchronization
|
||||
|
||||
//--------------------- PERIPHERALS -------------------
|
||||
#define PERIPHERAL_A_FAULT (0x00000000 + 0x1c000000) //0x1C000000-0x1C00FFFF (1M)
|
||||
#define PERIPHERAL_B_FAULT (0x00100000 + 0x1c000000) //0x1C100000-0x1C10FFFF (1M)
|
||||
|
||||
//--------------------- SYNC FLAGS --------------------
|
||||
#define FLAG_SYNC 0xFFFFF000
|
||||
#define F_SYNC_BASE 0xFFF00000 //1M aligned
|
||||
|
||||
static uint32_t Sect_Normal; //outer & inner wb/wa, non-shareable, executable, rw, domain 0, base addr 0
|
||||
static uint32_t Sect_Normal_Cod; //outer & inner wb/wa, non-shareable, executable, ro, domain 0, base addr 0
|
||||
static uint32_t Sect_Normal_RO; //as Sect_Normal_Cod, but not executable
|
||||
static uint32_t Sect_Normal_RW; //as Sect_Normal_Cod, but writeable and not executable
|
||||
static uint32_t Sect_Device_RO; //device, non-shareable, non-executable, ro, domain 0, base addr 0
|
||||
static uint32_t Sect_Device_RW; //as Sect_Device_RO, but writeable
|
||||
|
||||
/* Define global descriptors */
|
||||
static uint32_t Page_L1_4k = 0x0; //generic
|
||||
static uint32_t Page_L1_64k = 0x0; //generic
|
||||
static uint32_t Page_4k_Device_RW; //Shared device, not executable, rw, domain 0
|
||||
static uint32_t Page_64k_Device_RW; //Shared device, not executable, rw, domain 0
|
||||
|
||||
void MMU_CreateTranslationTable(void)
|
||||
{
|
||||
mmu_region_attributes_Type region;
|
||||
|
||||
//Create 4GB of faulting entries
|
||||
MMU_TTSection (TTB_BASE, 0, 4096, DESCRIPTOR_FAULT);
|
||||
|
||||
/*
|
||||
* Generate descriptors. Refer to core_ca.h to get information about attributes
|
||||
*
|
||||
*/
|
||||
//Create descriptors for Vectors, RO, RW, ZI sections
|
||||
section_normal(Sect_Normal, region);
|
||||
section_normal_cod(Sect_Normal_Cod, region);
|
||||
section_normal_ro(Sect_Normal_RO, region);
|
||||
section_normal_rw(Sect_Normal_RW, region);
|
||||
//Create descriptors for peripherals
|
||||
section_device_ro(Sect_Device_RO, region);
|
||||
section_device_rw(Sect_Device_RW, region);
|
||||
//Create descriptors for 64k pages
|
||||
page64k_device_rw(Page_L1_64k, Page_64k_Device_RW, region);
|
||||
//Create descriptors for 4k pages
|
||||
page4k_device_rw(Page_L1_4k, Page_4k_Device_RW, region);
|
||||
|
||||
|
||||
/*
|
||||
* Define MMU flat-map regions and attributes
|
||||
*
|
||||
*/
|
||||
|
||||
//Define Image
|
||||
MMU_TTSection (TTB_BASE, __ROM_BASE, __ROM_SIZE/0x100000, Sect_Normal_Cod); // multiple of 1MB sections
|
||||
MMU_TTSection (TTB_BASE, __RAM_BASE, __RAM_SIZE/0x100000, Sect_Normal_RW); // multiple of 1MB sections
|
||||
|
||||
//--------------------- PERIPHERALS -------------------
|
||||
MMU_TTSection (TTB_BASE, VE_A5_MP_FLASH_BASE0 , 64, Sect_Device_RO); // 64MB NOR
|
||||
MMU_TTSection (TTB_BASE, VE_A5_MP_FLASH_BASE1 , 64, Sect_Device_RO); // 64MB NOR
|
||||
MMU_TTSection (TTB_BASE, VE_A5_MP_SRAM_BASE , 32, Sect_Device_RW); // 32MB RAM
|
||||
MMU_TTSection (TTB_BASE, VE_A5_MP_VRAM_BASE , 32, Sect_Device_RW); // 32MB RAM
|
||||
MMU_TTSection (TTB_BASE, VE_A5_MP_ETHERNET_BASE , 16, Sect_Device_RW);
|
||||
MMU_TTSection (TTB_BASE, VE_A5_MP_USB_BASE , 16, Sect_Device_RW);
|
||||
|
||||
// Create (16 * 64k)=1MB faulting entries to cover peripheral range 0x1C000000-0x1C00FFFF
|
||||
MMU_TTPage64k(TTB_BASE, PERIPHERAL_A_FAULT , 16, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, DESCRIPTOR_FAULT);
|
||||
// Define peripheral range 0x1C000000-0x1C00FFFF
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_DAP_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_SYSTEM_REG_BASE, 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_SERIAL_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_AACI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_MMCI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_KMI0_BASE , 2, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_UART_BASE , 4, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_WDT_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
|
||||
// Create (16 * 64k)=1MB faulting entries to cover peripheral range 0x1C100000-0x1C10FFFF
|
||||
MMU_TTPage64k(TTB_BASE, PERIPHERAL_B_FAULT , 16, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, DESCRIPTOR_FAULT);
|
||||
// Define peripheral range 0x1C100000-0x1C10FFFF
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_TIMER_BASE , 2, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_DVI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_RTC_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_UART4_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A5_MP_CLCD_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
|
||||
// Create (256 * 4k)=1MB faulting entries to cover private address space. Needs to be marked as Device memory
|
||||
MMU_TTPage4k (TTB_BASE, __get_CBAR() ,256, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, DESCRIPTOR_FAULT);
|
||||
// Define private address space entry.
|
||||
MMU_TTPage4k (TTB_BASE, __get_CBAR() , 3, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
// Define L2CC entry. Uncomment if PL310 is present
|
||||
// MMU_TTPage4k (TTB_BASE, VE_A5_MP_PL310_BASE , 1, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
|
||||
// Create (256 * 4k)=1MB faulting entries to synchronization space (Useful if some non-cacheable DMA agent is present in the SoC)
|
||||
MMU_TTPage4k (TTB_BASE, F_SYNC_BASE , 256, Page_L1_4k, (uint32_t *)SYNC_FLAGS_TABLE_L2_BASE_4k, DESCRIPTOR_FAULT);
|
||||
// Define synchronization space entry.
|
||||
MMU_TTPage4k (TTB_BASE, FLAG_SYNC , 1, Page_L1_4k, (uint32_t *)SYNC_FLAGS_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
|
||||
/* Set location of level 1 page table
|
||||
; 31:14 - Translation table base addr (31:14-TTBCR.N, TTBCR.N is 0 out of reset)
|
||||
; 13:7 - 0x0
|
||||
; 6 - IRGN[0] 0x1 (Inner WB WA)
|
||||
; 5 - NOS 0x0 (Non-shared)
|
||||
; 4:3 - RGN 0x01 (Outer WB WA)
|
||||
; 2 - IMP 0x0 (Implementation Defined)
|
||||
; 1 - S 0x0 (Non-shared)
|
||||
; 0 - IRGN[1] 0x0 (Inner WB WA) */
|
||||
__set_TTBR0(__TTB_BASE | 0x48);
|
||||
__ISB();
|
||||
|
||||
/* Set up domain access control register
|
||||
; We set domain 0 to Client and all other domains to No Access.
|
||||
; All translation table entries specify domain 0 */
|
||||
__set_DACR(1);
|
||||
__ISB();
|
||||
}
|
@ -1,148 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA5.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A5 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2021
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <ARMCA5.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define USR_MODE 0x10 // User mode
|
||||
#define FIQ_MODE 0x11 // Fast Interrupt Request mode
|
||||
#define IRQ_MODE 0x12 // Interrupt Request mode
|
||||
#define SVC_MODE 0x13 // Supervisor mode
|
||||
#define ABT_MODE 0x17 // Abort mode
|
||||
#define UND_MODE 0x1B // Undefined Instruction mode
|
||||
#define SYS_MODE 0x1F // System mode
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors (void) __attribute__ ((naked, section("RESET")));
|
||||
void Reset_Handler (void) __attribute__ ((naked));
|
||||
void Default_Handler(void) __attribute__ ((noreturn));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Undef_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void DAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void IRQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void FIQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors(void) {
|
||||
__ASM volatile(
|
||||
"LDR PC, =Reset_Handler \n"
|
||||
"LDR PC, =Undef_Handler \n"
|
||||
"LDR PC, =SVC_Handler \n"
|
||||
"LDR PC, =PAbt_Handler \n"
|
||||
"LDR PC, =DAbt_Handler \n"
|
||||
"NOP \n"
|
||||
"LDR PC, =IRQ_Handler \n"
|
||||
"LDR PC, =FIQ_Handler \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Reset_Handler(void) {
|
||||
__ASM volatile(
|
||||
|
||||
// Mask interrupts
|
||||
"CPSID if \n"
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
"MRC p15, 0, R0, c0, c0, 5 \n" // Read MPIDR
|
||||
"ANDS R0, R0, #3 \n"
|
||||
"goToSleep: \n"
|
||||
"WFINE \n"
|
||||
"BNE goToSleep \n"
|
||||
|
||||
// Reset SCTLR Settings
|
||||
"MRC p15, 0, R0, c1, c0, 0 \n" // Read CP15 System Control register
|
||||
"BIC R0, R0, #(0x1 << 12) \n" // Clear I bit 12 to disable I Cache
|
||||
"BIC R0, R0, #(0x1 << 2) \n" // Clear C bit 2 to disable D Cache
|
||||
"BIC R0, R0, #0x1 \n" // Clear M bit 0 to disable MMU
|
||||
"BIC R0, R0, #(0x1 << 11) \n" // Clear Z bit 11 to disable branch prediction
|
||||
"BIC R0, R0, #(0x1 << 13) \n" // Clear V bit 13 to disable hivecs
|
||||
"MCR p15, 0, R0, c1, c0, 0 \n" // Write value back to CP15 System Control register
|
||||
"ISB \n"
|
||||
|
||||
// Configure ACTLR
|
||||
"MRC p15, 0, r0, c1, c0, 1 \n" // Read CP15 Auxiliary Control Register
|
||||
"ORR r0, r0, #(1 << 1) \n" // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
"MCR p15, 0, r0, c1, c0, 1 \n" // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
"LDR R0, =Vectors \n"
|
||||
"MCR p15, 0, R0, c12, c0, 0 \n"
|
||||
|
||||
// Setup Stack for each exceptional mode
|
||||
"CPS #0x11 \n"
|
||||
"LDR SP, =Image$$FIQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x12 \n"
|
||||
"LDR SP, =Image$$IRQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x13 \n"
|
||||
"LDR SP, =Image$$SVC_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x17 \n"
|
||||
"LDR SP, =Image$$ABT_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1B \n"
|
||||
"LDR SP, =Image$$UND_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1F \n"
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||
"LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit \n"
|
||||
#elif defined ( __GNUC__ )
|
||||
"LDR SP, =Image$$SYS_STACK$$ZI$$Limit \n"
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
|
||||
// Call SystemInit
|
||||
"BL SystemInit \n"
|
||||
|
||||
// Unmask interrupts
|
||||
"CPSIE if \n"
|
||||
|
||||
// Call __main
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||
"BL __main \n"
|
||||
#elif defined ( __GNUC__ )
|
||||
"BL _start \n"
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void) {
|
||||
while(1);
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA5.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A5 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2021
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <ARMCA5.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define USR_MODE 0x10 // User mode
|
||||
#define FIQ_MODE 0x11 // Fast Interrupt Request mode
|
||||
#define IRQ_MODE 0x12 // Interrupt Request mode
|
||||
#define SVC_MODE 0x13 // Supervisor mode
|
||||
#define ABT_MODE 0x17 // Abort mode
|
||||
#define UND_MODE 0x1B // Undefined Instruction mode
|
||||
#define SYS_MODE 0x1F // System mode
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors (void) __attribute__ ((naked, section("RESET")));
|
||||
void Reset_Handler (void) __attribute__ ((naked));
|
||||
void Default_Handler(void) __attribute__ ((noreturn));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Undef_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void DAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void IRQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void FIQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors(void) {
|
||||
__ASM volatile(
|
||||
"LDR PC, =Reset_Handler \n"
|
||||
"LDR PC, =Undef_Handler \n"
|
||||
"LDR PC, =SVC_Handler \n"
|
||||
"LDR PC, =PAbt_Handler \n"
|
||||
"LDR PC, =DAbt_Handler \n"
|
||||
"NOP \n"
|
||||
"LDR PC, =IRQ_Handler \n"
|
||||
"LDR PC, =FIQ_Handler \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Reset_Handler(void) {
|
||||
__ASM volatile(
|
||||
|
||||
// Mask interrupts
|
||||
"CPSID if \n"
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
"MRC p15, 0, R0, c0, c0, 5 \n" // Read MPIDR
|
||||
"ANDS R0, R0, #3 \n"
|
||||
"goToSleep: \n"
|
||||
"WFINE \n"
|
||||
"BNE goToSleep \n"
|
||||
|
||||
// Reset SCTLR Settings
|
||||
"MRC p15, 0, R0, c1, c0, 0 \n" // Read CP15 System Control register
|
||||
"BIC R0, R0, #(0x1 << 12) \n" // Clear I bit 12 to disable I Cache
|
||||
"BIC R0, R0, #(0x1 << 2) \n" // Clear C bit 2 to disable D Cache
|
||||
"BIC R0, R0, #0x1 \n" // Clear M bit 0 to disable MMU
|
||||
"BIC R0, R0, #(0x1 << 11) \n" // Clear Z bit 11 to disable branch prediction
|
||||
"BIC R0, R0, #(0x1 << 13) \n" // Clear V bit 13 to disable hivecs
|
||||
"MCR p15, 0, R0, c1, c0, 0 \n" // Write value back to CP15 System Control register
|
||||
"ISB \n"
|
||||
|
||||
// Configure ACTLR
|
||||
"MRC p15, 0, r0, c1, c0, 1 \n" // Read CP15 Auxiliary Control Register
|
||||
"ORR r0, r0, #(1 << 1) \n" // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
"MCR p15, 0, r0, c1, c0, 1 \n" // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
"LDR R0, =Vectors \n"
|
||||
"MCR p15, 0, R0, c12, c0, 0 \n"
|
||||
|
||||
// Setup Stack for each exceptional mode
|
||||
"CPS #0x11 \n"
|
||||
"LDR SP, =Image$$FIQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x12 \n"
|
||||
"LDR SP, =Image$$IRQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x13 \n"
|
||||
"LDR SP, =Image$$SVC_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x17 \n"
|
||||
"LDR SP, =Image$$ABT_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1B \n"
|
||||
"LDR SP, =Image$$UND_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1F \n"
|
||||
"LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit \n"
|
||||
|
||||
// Call SystemInit
|
||||
"BL SystemInit \n"
|
||||
|
||||
// Unmask interrupts
|
||||
"CPSIE if \n"
|
||||
|
||||
// Call __main
|
||||
"BL __main \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void) {
|
||||
while(1);
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA9.s
|
||||
* @brief CMSIS Device System Source File for ARM Cortex-A5 Device Series
|
||||
* @version V1.00
|
||||
* @date 01 Nov 2017
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MODULE ?startup_ARMCA5
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
PUBLIC Reset_Handler
|
||||
PUBWEAK Undef_Handler
|
||||
PUBWEAK SVC_Handler
|
||||
PUBWEAK PAbt_Handler
|
||||
PUBWEAK DAbt_Handler
|
||||
PUBWEAK IRQ_Handler
|
||||
PUBWEAK FIQ_Handler
|
||||
|
||||
SECTION SVC_STACK:DATA:NOROOT(3)
|
||||
SECTION IRQ_STACK:DATA:NOROOT(3)
|
||||
SECTION FIQ_STACK:DATA:NOROOT(3)
|
||||
SECTION ABT_STACK:DATA:NOROOT(3)
|
||||
SECTION UND_STACK:DATA:NOROOT(3)
|
||||
SECTION USR_STACK:DATA:NOROOT(3)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
section RESET:CODE:NOROOT(2)
|
||||
PUBLIC Vectors
|
||||
|
||||
Vectors:
|
||||
LDR PC, =Reset_Handler
|
||||
LDR PC, =Undef_Handler
|
||||
LDR PC, =SVC_Handler
|
||||
LDR PC, =PAbt_Handler
|
||||
LDR PC, =DAbt_Handler
|
||||
NOP
|
||||
LDR PC, =IRQ_Handler
|
||||
LDR PC, =FIQ_Handler
|
||||
|
||||
|
||||
section .text:CODE:NOROOT(4)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_program_start
|
||||
|
||||
Reset_Handler:
|
||||
|
||||
// Mask interrupts
|
||||
CPSID if
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
MRC p15, 0, R0, c0, c0, 5
|
||||
ANDS R0, R0, #3
|
||||
goToSleep:
|
||||
WFINE
|
||||
BNE goToSleep
|
||||
|
||||
// Reset SCTLR Settings
|
||||
MRC p15, 0, R0, c1, c0, 0 // Read CP15 System Control register
|
||||
BIC R0, R0, #(0x1 << 12) // Clear I bit 12 to disable I Cache
|
||||
BIC R0, R0, #(0x1 << 2) // Clear C bit 2 to disable D Cache
|
||||
BIC R0, R0, #0x1 // Clear M bit 0 to disable MMU
|
||||
BIC R0, R0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction
|
||||
BIC R0, R0, #(0x1 << 13) // Clear V bit 13 to disable hivecs
|
||||
MCR p15, 0, R0, c1, c0, 0 // Write value back to CP15 System Control register
|
||||
ISB
|
||||
|
||||
// Configure ACTLR
|
||||
MRC p15, 0, r0, c1, c0, 1 // Read CP15 Auxiliary Control Register
|
||||
ORR r0, r0, #(1 << 1) // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
MCR p15, 0, r0, c1, c0, 1 // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
LDR R0, =Vectors
|
||||
MCR p15, 0, R0, c12, c0, 0
|
||||
|
||||
// Setup Stack for each exception mode
|
||||
CPS #0x11
|
||||
LDR SP, =SFE(FIQ_STACK)
|
||||
CPS #0x12
|
||||
LDR SP, =SFE(IRQ_STACK)
|
||||
CPS #0x13
|
||||
LDR SP, =SFE(SVC_STACK)
|
||||
CPS #0x17
|
||||
LDR SP, =SFE(ABT_STACK)
|
||||
CPS #0x1B
|
||||
LDR SP, =SFE(UND_STACK)
|
||||
CPS #0x1F
|
||||
LDR SP, =SFE(USR_STACK)
|
||||
|
||||
// Call SystemInit
|
||||
BL SystemInit
|
||||
|
||||
// Unmask interrupts
|
||||
CPSIE if
|
||||
|
||||
// Call __iar_program_start
|
||||
BL __iar_program_start
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
Undef_Handler:
|
||||
SVC_Handler:
|
||||
PAbt_Handler:
|
||||
DAbt_Handler:
|
||||
IRQ_Handler:
|
||||
FIQ_Handler:
|
||||
Default_Handler:
|
||||
B .
|
||||
|
||||
END
|
@ -1,140 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA9.s
|
||||
* @brief CMSIS Device System Source File for ARM Cortex-A5 Device Series
|
||||
* @version V1.00
|
||||
* @date 01 Nov 2017
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MODULE ?startup_ARMCA5
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
PUBLIC Reset_Handler
|
||||
PUBWEAK Undef_Handler
|
||||
PUBWEAK SVC_Handler
|
||||
PUBWEAK PAbt_Handler
|
||||
PUBWEAK DAbt_Handler
|
||||
PUBWEAK IRQ_Handler
|
||||
PUBWEAK FIQ_Handler
|
||||
|
||||
SECTION SVC_STACK:DATA:NOROOT(3)
|
||||
SECTION IRQ_STACK:DATA:NOROOT(3)
|
||||
SECTION FIQ_STACK:DATA:NOROOT(3)
|
||||
SECTION ABT_STACK:DATA:NOROOT(3)
|
||||
SECTION UND_STACK:DATA:NOROOT(3)
|
||||
SECTION USR_STACK:DATA:NOROOT(3)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
section RESET:CODE:NOROOT(2)
|
||||
PUBLIC Vectors
|
||||
|
||||
Vectors:
|
||||
LDR PC, =Reset_Handler
|
||||
LDR PC, =Undef_Handler
|
||||
LDR PC, =SVC_Handler
|
||||
LDR PC, =PAbt_Handler
|
||||
LDR PC, =DAbt_Handler
|
||||
NOP
|
||||
LDR PC, =IRQ_Handler
|
||||
LDR PC, =FIQ_Handler
|
||||
|
||||
|
||||
section .text:CODE:NOROOT(4)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_program_start
|
||||
|
||||
Reset_Handler:
|
||||
|
||||
// Mask interrupts
|
||||
CPSID if
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
MRC p15, 0, R0, c0, c0, 5
|
||||
ANDS R0, R0, #3
|
||||
goToSleep:
|
||||
WFINE
|
||||
BNE goToSleep
|
||||
|
||||
// Reset SCTLR Settings
|
||||
MRC p15, 0, R0, c1, c0, 0 // Read CP15 System Control register
|
||||
BIC R0, R0, #(0x1 << 12) // Clear I bit 12 to disable I Cache
|
||||
BIC R0, R0, #(0x1 << 2) // Clear C bit 2 to disable D Cache
|
||||
BIC R0, R0, #0x1 // Clear M bit 0 to disable MMU
|
||||
BIC R0, R0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction
|
||||
BIC R0, R0, #(0x1 << 13) // Clear V bit 13 to disable hivecs
|
||||
MCR p15, 0, R0, c1, c0, 0 // Write value back to CP15 System Control register
|
||||
ISB
|
||||
|
||||
// Configure ACTLR
|
||||
MRC p15, 0, r0, c1, c0, 1 // Read CP15 Auxiliary Control Register
|
||||
ORR r0, r0, #(1 << 1) // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
MCR p15, 0, r0, c1, c0, 1 // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
LDR R0, =Vectors
|
||||
MCR p15, 0, R0, c12, c0, 0
|
||||
|
||||
// Setup Stack for each exception mode
|
||||
CPS #0x11
|
||||
LDR SP, =SFE(FIQ_STACK)
|
||||
CPS #0x12
|
||||
LDR SP, =SFE(IRQ_STACK)
|
||||
CPS #0x13
|
||||
LDR SP, =SFE(SVC_STACK)
|
||||
CPS #0x17
|
||||
LDR SP, =SFE(ABT_STACK)
|
||||
CPS #0x1B
|
||||
LDR SP, =SFE(UND_STACK)
|
||||
CPS #0x1F
|
||||
LDR SP, =SFE(USR_STACK)
|
||||
|
||||
// Call SystemInit
|
||||
BL SystemInit
|
||||
|
||||
// Unmask interrupts
|
||||
CPSIE if
|
||||
|
||||
// Call __iar_program_start
|
||||
BL __iar_program_start
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
Undef_Handler:
|
||||
SVC_Handler:
|
||||
PAbt_Handler:
|
||||
DAbt_Handler:
|
||||
IRQ_Handler:
|
||||
FIQ_Handler:
|
||||
Default_Handler:
|
||||
B .
|
||||
|
||||
END
|
@ -1,93 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA5.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A5 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 13. February 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#define SYSTEM_CLOCK 12000000U
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Initialization
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
/* do not use global variables because this function is called before
|
||||
reaching pre-main. RW section may be overwritten afterwards. */
|
||||
|
||||
// Invalidate entire Unified TLB
|
||||
__set_TLBIALL(0);
|
||||
|
||||
// Invalidate entire branch predictor array
|
||||
__set_BPIALL(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate instruction cache and flush branch target cache
|
||||
__set_ICIALLU(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate data cache
|
||||
L1C_InvalidateDCacheAll();
|
||||
|
||||
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
|
||||
// Enable FPU
|
||||
__FPU_Enable();
|
||||
#endif
|
||||
|
||||
// Create Translation Table
|
||||
MMU_CreateTranslationTable();
|
||||
|
||||
// Enable MMU
|
||||
MMU_Enable();
|
||||
|
||||
// Enable Caches
|
||||
L1C_EnableCaches();
|
||||
L1C_EnableBTAC();
|
||||
|
||||
#if (__L2C_PRESENT == 1)
|
||||
// Enable GIC
|
||||
L2C_Enable();
|
||||
#endif
|
||||
|
||||
// IRQ Initialize
|
||||
IRQ_Initialize();
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA5.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A5 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 13. February 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#define SYSTEM_CLOCK 12000000U
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Initialization
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
/* do not use global variables because this function is called before
|
||||
reaching pre-main. RW section may be overwritten afterwards. */
|
||||
|
||||
// Invalidate entire Unified TLB
|
||||
__set_TLBIALL(0);
|
||||
|
||||
// Invalidate entire branch predictor array
|
||||
__set_BPIALL(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate instruction cache and flush branch target cache
|
||||
__set_ICIALLU(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate data cache
|
||||
L1C_InvalidateDCacheAll();
|
||||
|
||||
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
|
||||
// Enable FPU
|
||||
__FPU_Enable();
|
||||
#endif
|
||||
|
||||
// Create Translation Table
|
||||
MMU_CreateTranslationTable();
|
||||
|
||||
// Enable MMU
|
||||
MMU_Enable();
|
||||
|
||||
// Enable Caches
|
||||
L1C_EnableCaches();
|
||||
L1C_EnableBTAC();
|
||||
|
||||
#if (__L2C_PRESENT == 1)
|
||||
// Enable GIC
|
||||
L2C_Enable();
|
||||
#endif
|
||||
|
||||
// IRQ Initialize
|
||||
IRQ_Initialize();
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA5.h
|
||||
* @brief CMSIS Device System Header File for Arm Cortex-A5 Device Series
|
||||
* @version V1.00
|
||||
* @date 10. January 2018
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEM_ARMCA5_H
|
||||
#define __SYSTEM_ARMCA5_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
/**
|
||||
\brief Setup the microcontroller system.
|
||||
|
||||
Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
|
||||
/**
|
||||
\brief Update SystemCoreClock variable.
|
||||
|
||||
Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
/**
|
||||
\brief Create Translation Table.
|
||||
|
||||
Creates Memory Management Unit Translation Table.
|
||||
*/
|
||||
extern void MMU_CreateTranslationTable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_ARMCA5_H */
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA5.h
|
||||
* @brief CMSIS Device System Header File for Arm Cortex-A5 Device Series
|
||||
* @version V1.00
|
||||
* @date 10. January 2018
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEM_ARMCA5_H
|
||||
#define __SYSTEM_ARMCA5_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
/**
|
||||
\brief Setup the microcontroller system.
|
||||
|
||||
Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
|
||||
/**
|
||||
\brief Update SystemCoreClock variable.
|
||||
|
||||
Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
/**
|
||||
\brief Create Translation Table.
|
||||
|
||||
Creates Memory Management Unit Translation Table.
|
||||
*/
|
||||
extern void MMU_CreateTranslationTable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_ARMCA5_H */
|
@ -1,23 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup
|
||||
- component: Device:IRQ Controller:GIC
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,21 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#----------------------------------------------------------------------------------------------
|
||||
motherboard.vis.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
cluster.cpu0.vfp-present=1 # (bool , init-time) default = '1' : Set whether the model has VFP support
|
||||
cluster.cpu0.ase-present=0 # (bool , init-time) default = '1' : Set whether model has NEON support
|
||||
cluster.cpu0.semihosting-enable=1 # (bool , init-time) default = '1' : Enable semihosting SVC traps. Applications that do not use semihosting must set this parameter to false
|
||||
cluster.cpu0.semihosting-hlt-enable=0 # (bool , init-time) default = '0' : Enable semihosting HLT traps. Applications that use HLT semihosting must set this parameter to true and the semihosting-enable parameter to true
|
||||
cluster.cpu0.semihosting-ARM_SVC=0x123456 # (int , init-time) default = '0x123456' : ARM SVC number for semihosting : [0x0..0xFFFFFF]
|
||||
cluster.cpu0.semihosting-Thumb_SVC=0xAB # (int , init-time) default = '0xAB' : Thumb SVC number for semihosting : [0x0..0xFF]
|
||||
cluster.cpu0.semihosting-ARM_HLT=0xF000 # (int , init-time) default = '0xF000' : ARM HLT number for semihosting : [0x0..0xFFFF]
|
||||
cluster.cpu0.semihosting-Thumb_HLT=0x3C # (int , init-time) default = '0x3C' : Thumb HLT number for semihosting : [0x0..0x3F]
|
||||
cluster.cpu0.semihosting-cmd_line="" # (string, init-time) default = '' : Command line available to semihosting SVC calls
|
||||
cluster.cpu0.semihosting-heap_base=0x0 # (int , init-time) default = '0x0' : Virtual address of heap base : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-heap_limit=0x0 # (int , init-time) default = '0xFF000000' : Virtual address of top of heap : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-stack_base=0x0 # (int , init-time) default = '0xFFFF0000' : Virtual address of base of descending stack : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-stack_limit=0x0 # (int , init-time) default = '0xFF000000' : Virtual address of stack limit : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-cwd="" # (string, init-time) default = '' : Base directory for semihosting file access.
|
||||
cluster.dcache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether D-cache has stateful implementation
|
||||
cluster.icache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether I-cache has stateful implementation
|
||||
#----------------------------------------------------------------------------------------------
|
@ -1,67 +0,0 @@
|
||||
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = 0x80000000;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = 0x801FFFFF;
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = 0x80200000;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = 0x803FFFFF;
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_TTB_start__ = 0x80500000;
|
||||
define symbol __ICFEDIT_region_TTB_end__ = 0x805FFFFF;
|
||||
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
define symbol __ICFEDIT_size_irqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_svcstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_abtstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_undstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x8000;
|
||||
define symbol __ICFEDIT_size_ttb__ = 0x4000;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__];
|
||||
define region TTB_region = mem:[from __ICFEDIT_region_TTB_start__ to __ICFEDIT_region_TTB_end__ ];
|
||||
|
||||
define block USR_STACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
|
||||
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
|
||||
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
|
||||
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
|
||||
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block TTB with alignment = 8, size = __ICFEDIT_size_ttb__ { section TTB };
|
||||
|
||||
do not initialize { section .noinit };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
place at address mem:__ICFEDIT_region_IROM1_start__ { readonly section RESET };
|
||||
place in IROM_region { readonly };
|
||||
place in IRAM_region { readwrite, block HEAP, block USR_STACK, block IRQ_STACK, block FIQ_STACK, block SVC_STACK, block ABT_STACK, block UND_STACK };
|
||||
place in TTB_region { block TTB };
|
@ -1,67 +0,0 @@
|
||||
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = 0x80000000;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = 0x801FFFFF;
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = 0x80200000;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = 0x803FFFFF;
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_TTB_start__ = 0x80500000;
|
||||
define symbol __ICFEDIT_region_TTB_end__ = 0x805FFFFF;
|
||||
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
define symbol __ICFEDIT_size_irqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_svcstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_abtstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_undstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x8000;
|
||||
define symbol __ICFEDIT_size_ttb__ = 0x4000;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__];
|
||||
define region TTB_region = mem:[from __ICFEDIT_region_TTB_start__ to __ICFEDIT_region_TTB_end__ ];
|
||||
|
||||
define block USR_STACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
|
||||
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
|
||||
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
|
||||
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
|
||||
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block TTB with alignment = 8, size = __ICFEDIT_size_ttb__ { section TTB };
|
||||
|
||||
do not initialize { section .noinit };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
place at address mem:__ICFEDIT_region_IROM1_start__ { readonly section RESET };
|
||||
place in IROM_region { readonly };
|
||||
place in IRAM_region { readwrite, block HEAP, block USR_STACK, block IRQ_STACK, block FIQ_STACK, block SVC_STACK, block ABT_STACK, block UND_STACK };
|
||||
place in TTB_region { block TTB };
|
@ -1,181 +0,0 @@
|
||||
#include "mem_ARMCA7.h"
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ROM (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
L_TTB (rw) : ORIGIN = __TTB_BASE, LENGTH = __TTB_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
|
||||
Image$$VECTORS$$Base = .;
|
||||
* (RESET)
|
||||
KEEP(*(.isr_vector))
|
||||
Image$$VECTORS$$Limit = .;
|
||||
|
||||
*(SVC_TABLE)
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
Image$$RO_DATA$$Base = .;
|
||||
*(.rodata*)
|
||||
Image$$RO_DATA$$Limit = .;
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > ROM
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > ROM
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > ROM
|
||||
__exidx_end = .;
|
||||
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > ROM
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > ROM
|
||||
|
||||
__etext = .;
|
||||
|
||||
.ttb :
|
||||
{
|
||||
Image$$TTB$$ZI$$Base = .;
|
||||
. += __TTB_SIZE;
|
||||
Image$$TTB$$ZI$$Limit = .;
|
||||
} > L_TTB
|
||||
|
||||
.data :
|
||||
{
|
||||
Image$$RW_DATA$$Base = .;
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
Image$$RW_DATA$$Limit = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE (__fini_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
|
||||
.bss ALIGN(0x400):
|
||||
{
|
||||
Image$$ZI_DATA$$Base = .;
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
__bss_end__ = .;
|
||||
Image$$ZI_DATA$$Limit = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
} > RAM AT > RAM
|
||||
|
||||
#if defined(__HEAP_SIZE) && (__HEAP_SIZE > 0)
|
||||
.heap (NOLOAD):
|
||||
{
|
||||
. = ALIGN(8);
|
||||
Image$$HEAP$$ZI$$Base = .;
|
||||
. += __HEAP_SIZE;
|
||||
Image$$HEAP$$ZI$$Limit = .;
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
#endif
|
||||
|
||||
.stack (NOLOAD):
|
||||
{
|
||||
. = ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE - __FIQ_STACK_SIZE - __IRQ_STACK_SIZE - __SVC_STACK_SIZE - __ABT_STACK_SIZE - __UND_STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
|
||||
__StackTop = .;
|
||||
Image$$SYS_STACK$$ZI$$Base = .;
|
||||
. += __STACK_SIZE;
|
||||
Image$$SYS_STACK$$ZI$$Limit = .;
|
||||
__stack = .;
|
||||
|
||||
Image$$FIQ_STACK$$ZI$$Base = .;
|
||||
. += __FIQ_STACK_SIZE;
|
||||
Image$$FIQ_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$IRQ_STACK$$ZI$$Base = .;
|
||||
. += __IRQ_STACK_SIZE;
|
||||
Image$$IRQ_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$SVC_STACK$$ZI$$Base = .;
|
||||
. += __SVC_STACK_SIZE;
|
||||
Image$$SVC_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$ABT_STACK$$ZI$$Base = .;
|
||||
. += __ABT_STACK_SIZE;
|
||||
Image$$ABT_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$UND_STACK$$ZI$$Base = .;
|
||||
. += __UND_STACK_SIZE;
|
||||
Image$$UND_STACK$$ZI$$Limit = .;
|
||||
|
||||
} > RAM
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-a7 -xc
|
||||
;**************************************************
|
||||
; Copyright (c) 2017 ARM Ltd. All rights reserved.
|
||||
;**************************************************
|
||||
|
||||
; Scatter-file for RTX Example on Versatile Express
|
||||
|
||||
; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map.
|
||||
|
||||
; This platform has 2GB SDRAM starting at 0x80000000.
|
||||
|
||||
#include "mem_ARMCA7.h"
|
||||
|
||||
SDRAM __ROM_BASE __ROM_SIZE ; load region size_region
|
||||
{
|
||||
VECTORS __ROM_BASE __ROM_SIZE ; load address = execution address
|
||||
{
|
||||
* (RESET, +FIRST) ; Vector table and other startup code
|
||||
* (InRoot$$Sections) ; All (library) code that must be in a root region
|
||||
* (+RO-CODE) ; Application RO code (.text)
|
||||
* (+RO-DATA) ; Application RO data (.constdata)
|
||||
}
|
||||
|
||||
RW_DATA __RAM_BASE __RW_DATA_SIZE
|
||||
{ * (+RW) } ; Application RW data (.data)
|
||||
|
||||
ZI_DATA (__RAM_BASE+
|
||||
__RW_DATA_SIZE) __ZI_DATA_SIZE
|
||||
{ * (+ZI) } ; Application ZI data (.bss)
|
||||
|
||||
ARM_LIB_HEAP (__RAM_BASE
|
||||
+__RW_DATA_SIZE
|
||||
+__ZI_DATA_SIZE) EMPTY __HEAP_SIZE ; Heap region growing up
|
||||
{ }
|
||||
|
||||
ARM_LIB_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE
|
||||
-__ABT_STACK_SIZE
|
||||
-__UND_STACK_SIZE) EMPTY -__STACK_SIZE ; Stack region growing down
|
||||
{ }
|
||||
|
||||
UND_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE
|
||||
-__ABT_STACK_SIZE) EMPTY -__UND_STACK_SIZE ; UND mode stack
|
||||
{ }
|
||||
|
||||
ABT_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE) EMPTY -__ABT_STACK_SIZE ; ABT mode stack
|
||||
{ }
|
||||
|
||||
SVC_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE) EMPTY -__SVC_STACK_SIZE ; SVC mode stack
|
||||
{ }
|
||||
|
||||
IRQ_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE) EMPTY -__IRQ_STACK_SIZE ; IRQ mode stack
|
||||
{ }
|
||||
|
||||
FIQ_STACK (__RAM_BASE
|
||||
+__RAM_SIZE) EMPTY -__FIQ_STACK_SIZE ; FIQ mode stack
|
||||
{ }
|
||||
|
||||
TTB __TTB_BASE EMPTY __TTB_SIZE ; Level-1 Translation Table for MMU
|
||||
{ }
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file mem_ARMCA7.h
|
||||
* @brief Memory base and size definitions (used in scatter file)
|
||||
* @version V1.1.0
|
||||
* @date 15. May 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __MEM_ARMCA7_H
|
||||
#define __MEM_ARMCA7_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
/*
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
*/
|
||||
|
||||
/*--------------------- ROM Configuration ------------------------------------
|
||||
//
|
||||
// <h> ROM Configuration
|
||||
// <i> For compatibility with MMU config the sections must be multiple of 1MB
|
||||
// <o0> ROM Base Address <0x0-0xFFFFFFFF:0x100000>
|
||||
// <o1> ROM Size (in Bytes) <0x0-0xFFFFFFFF:0x100000>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x80000000
|
||||
#define __ROM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- RAM Configuration -----------------------------------
|
||||
// <h> RAM Configuration
|
||||
// <i> For compatibility with MMU config the sections must be multiple of 1MB
|
||||
// <o0> RAM Base Address <0x0-0xFFFFFFFF:0x100000>
|
||||
// <o1> RAM Total Size (in Bytes) <0x0-0xFFFFFFFF:0x100000>
|
||||
// <h> Data Sections
|
||||
// <o2> RW_DATA Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o3> ZI_DATA Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
// <h> Stack / Heap Configuration
|
||||
// <o4> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o5> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <h> Exceptional Modes
|
||||
// <o6> UND Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o7> ABT Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o8> SVC Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o9> IRQ Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o10> FIQ Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
// </h>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x80200000
|
||||
#define __RAM_SIZE 0x00200000
|
||||
|
||||
#define __RW_DATA_SIZE 0x00100000
|
||||
#define __ZI_DATA_SIZE 0x000F0000
|
||||
|
||||
#define __STACK_SIZE 0x00001000
|
||||
#define __HEAP_SIZE 0x00008000
|
||||
|
||||
#define __UND_STACK_SIZE 0x00000100
|
||||
#define __ABT_STACK_SIZE 0x00000100
|
||||
#define __SVC_STACK_SIZE 0x00000100
|
||||
#define __IRQ_STACK_SIZE 0x00000100
|
||||
#define __FIQ_STACK_SIZE 0x00000100
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------- TTB Configuration ------------------------------------
|
||||
//
|
||||
// <h> TTB Configuration
|
||||
// <i> The TLB L1 contains 4096 32-bit entries and must be 16kB aligned
|
||||
// <i> The TLB L2 entries are placed after the L1 in the MMU config
|
||||
// <o0> TTB Base Address <0x0-0xFFFFFFFF:0x4000>
|
||||
// <o1> TTB Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __TTB_BASE 0x80500000
|
||||
#define __TTB_SIZE 0x00005000
|
||||
|
||||
#endif /* __MEM_ARMCA7_H */
|
@ -1,232 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file mmu_ARMCA7.c
|
||||
* @brief MMU Configuration for Arm Cortex-A7 Device Series
|
||||
* @version V1.2.0
|
||||
* @date 15. May 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* Memory map description from: DUI0447G_v2m_p1_trm.pdf 4.2.2 Arm Cortex-A Series memory map
|
||||
|
||||
Memory Type
|
||||
0xffffffff |--------------------------| ------------
|
||||
| FLAG SYNC | Device Memory
|
||||
0xfffff000 |--------------------------| ------------
|
||||
| Fault | Fault
|
||||
0xfff00000 |--------------------------| ------------
|
||||
| | Normal
|
||||
| |
|
||||
| Daughterboard |
|
||||
| memory |
|
||||
| |
|
||||
0x80505000 |--------------------------| ------------
|
||||
|TTB (L2 Sync Flags ) 4k | Normal
|
||||
0x80504C00 |--------------------------| ------------
|
||||
|TTB (L2 Peripherals-B) 16k| Normal
|
||||
0x80504800 |--------------------------| ------------
|
||||
|TTB (L2 Peripherals-A) 16k| Normal
|
||||
0x80504400 |--------------------------| ------------
|
||||
|TTB (L2 Priv Periphs) 4k | Normal
|
||||
0x80504000 |--------------------------| ------------
|
||||
| TTB (L1 Descriptors) | Normal
|
||||
0x80500000 |--------------------------| ------------
|
||||
| Stack | Normal
|
||||
|--------------------------| ------------
|
||||
| Heap | Normal
|
||||
0x80400000 |--------------------------| ------------
|
||||
| ZI Data | Normal
|
||||
0x80300000 |--------------------------| ------------
|
||||
| RW Data | Normal
|
||||
0x80200000 |--------------------------| ------------
|
||||
| RO Data | Normal
|
||||
|--------------------------| ------------
|
||||
| RO Code | USH Normal
|
||||
0x80000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| HSB AXI buses |
|
||||
0x40000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| test chips peripherals |
|
||||
0x2c002000 |--------------------------| ------------
|
||||
| Private Address | Device Memory
|
||||
0x2c000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| test chips peripherals |
|
||||
0x20000000 |--------------------------| ------------
|
||||
| Peripherals | Device Memory RW/RO
|
||||
| | & Fault
|
||||
0x00000000 |--------------------------|
|
||||
*/
|
||||
|
||||
// L1 Cache info and restrictions about architecture of the caches (CCSIR register):
|
||||
// Write-Through support *not* available
|
||||
// Write-Back support available.
|
||||
// Read allocation support available.
|
||||
// Write allocation support available.
|
||||
|
||||
//Note: You should use the Shareable attribute carefully.
|
||||
//For cores without coherency logic (such as SCU) marking a region as shareable forces the processor to not cache that region regardless of the inner cache settings.
|
||||
//Cortex-A versions of RTX use LDREX/STREX instructions relying on Local monitors. Local monitors will be used only when the region gets cached, regions that are not cached will use the Global Monitor.
|
||||
//Some Cortex-A implementations do not include Global Monitors, so wrongly setting the attribute Shareable may cause STREX to fail.
|
||||
|
||||
//Recall: When the Shareable attribute is applied to a memory region that is not Write-Back, Normal memory, data held in this region is treated as Non-cacheable.
|
||||
//When SMP bit = 0, Inner WB/WA Cacheable Shareable attributes are treated as Non-cacheable.
|
||||
//When SMP bit = 1, Inner WB/WA Cacheable Shareable attributes are treated as Cacheable.
|
||||
|
||||
|
||||
//Following MMU configuration is expected
|
||||
//SCTLR.AFE == 1 (Simplified access permissions model - AP[2:1] define access permissions, AP[0] is an access flag)
|
||||
//SCTLR.TRE == 0 (TEX remap disabled, so memory type and attributes are described directly by bits in the descriptor)
|
||||
//Domain 0 is always the Client domain
|
||||
//Descriptors should place all memory in domain 0
|
||||
|
||||
#include "ARMCA7.h"
|
||||
#include "mem_ARMCA7.h"
|
||||
|
||||
// TTB base address
|
||||
#define TTB_BASE ((uint32_t*)__TTB_BASE)
|
||||
|
||||
// L2 table pointers
|
||||
//----------------------------------------
|
||||
#define TTB_L1_SIZE (0x00004000) // The L1 translation table divides the full 4GB address space of a 32-bit core
|
||||
// into 4096 equally sized sections, each of which describes 1MB of virtual memory space.
|
||||
// The L1 translation table therefore contains 4096 32-bit (word-sized) entries.
|
||||
|
||||
#define PRIVATE_TABLE_L2_BASE_4k (__TTB_BASE + TTB_L1_SIZE) // Map 4k Private Address space
|
||||
#define PERIPHERAL_A_TABLE_L2_BASE_64k (__TTB_BASE + TTB_L1_SIZE + 0x400) // Map 64k Peripheral #1 0x1C000000 - 0x1C00FFFFF
|
||||
#define PERIPHERAL_B_TABLE_L2_BASE_64k (__TTB_BASE + TTB_L1_SIZE + 0x800) // Map 64k Peripheral #2 0x1C100000 - 0x1C1FFFFFF
|
||||
#define SYNC_FLAGS_TABLE_L2_BASE_4k (__TTB_BASE + TTB_L1_SIZE + 0xC00) // Map 4k Flag synchronization
|
||||
|
||||
//--------------------- PERIPHERALS -------------------
|
||||
#define PERIPHERAL_A_FAULT (0x00000000 + 0x1c000000) //0x1C000000-0x1C00FFFF (1M)
|
||||
#define PERIPHERAL_B_FAULT (0x00100000 + 0x1c000000) //0x1C100000-0x1C10FFFF (1M)
|
||||
|
||||
//--------------------- SYNC FLAGS --------------------
|
||||
#define FLAG_SYNC 0xFFFFF000
|
||||
#define F_SYNC_BASE 0xFFF00000 //1M aligned
|
||||
|
||||
static uint32_t Sect_Normal; //outer & inner wb/wa, non-shareable, executable, rw, domain 0, base addr 0
|
||||
static uint32_t Sect_Normal_Cod; //outer & inner wb/wa, non-shareable, executable, ro, domain 0, base addr 0
|
||||
static uint32_t Sect_Normal_RO; //as Sect_Normal_Cod, but not executable
|
||||
static uint32_t Sect_Normal_RW; //as Sect_Normal_Cod, but writeable and not executable
|
||||
static uint32_t Sect_Device_RO; //device, non-shareable, non-executable, ro, domain 0, base addr 0
|
||||
static uint32_t Sect_Device_RW; //as Sect_Device_RO, but writeable
|
||||
|
||||
/* Define global descriptors */
|
||||
static uint32_t Page_L1_4k = 0x0; //generic
|
||||
static uint32_t Page_L1_64k = 0x0; //generic
|
||||
static uint32_t Page_4k_Device_RW; //Shared device, not executable, rw, domain 0
|
||||
static uint32_t Page_64k_Device_RW; //Shared device, not executable, rw, domain 0
|
||||
|
||||
void MMU_CreateTranslationTable(void)
|
||||
{
|
||||
mmu_region_attributes_Type region;
|
||||
|
||||
//Create 4GB of faulting entries
|
||||
MMU_TTSection (TTB_BASE, 0, 4096, DESCRIPTOR_FAULT);
|
||||
|
||||
/*
|
||||
* Generate descriptors. Refer to core_ca.h to get information about attributes
|
||||
*
|
||||
*/
|
||||
//Create descriptors for Vectors, RO, RW, ZI sections
|
||||
section_normal(Sect_Normal, region);
|
||||
section_normal_cod(Sect_Normal_Cod, region);
|
||||
section_normal_ro(Sect_Normal_RO, region);
|
||||
section_normal_rw(Sect_Normal_RW, region);
|
||||
//Create descriptors for peripherals
|
||||
section_device_ro(Sect_Device_RO, region);
|
||||
section_device_rw(Sect_Device_RW, region);
|
||||
//Create descriptors for 64k pages
|
||||
page64k_device_rw(Page_L1_64k, Page_64k_Device_RW, region);
|
||||
//Create descriptors for 4k pages
|
||||
page4k_device_rw(Page_L1_4k, Page_4k_Device_RW, region);
|
||||
|
||||
|
||||
/*
|
||||
* Define MMU flat-map regions and attributes
|
||||
*
|
||||
*/
|
||||
|
||||
//Define Image
|
||||
MMU_TTSection (TTB_BASE, __ROM_BASE, __ROM_SIZE/0x100000, Sect_Normal_Cod); // multiple of 1MB sections
|
||||
MMU_TTSection (TTB_BASE, __RAM_BASE, __RAM_SIZE/0x100000, Sect_Normal_RW); // multiple of 1MB sections
|
||||
|
||||
//--------------------- PERIPHERALS -------------------
|
||||
MMU_TTSection (TTB_BASE, VE_A7_MP_FLASH_BASE0 , 64, Sect_Device_RO); // 64MB NOR
|
||||
MMU_TTSection (TTB_BASE, VE_A7_MP_FLASH_BASE1 , 64, Sect_Device_RO); // 64MB NOR
|
||||
MMU_TTSection (TTB_BASE, VE_A7_MP_SRAM_BASE , 32, Sect_Device_RW); // 32MB RAM
|
||||
MMU_TTSection (TTB_BASE, VE_A7_MP_VRAM_BASE , 32, Sect_Device_RW); // 32MB RAM
|
||||
MMU_TTSection (TTB_BASE, VE_A7_MP_ETHERNET_BASE , 16, Sect_Device_RW);
|
||||
MMU_TTSection (TTB_BASE, VE_A7_MP_USB_BASE , 16, Sect_Device_RW);
|
||||
|
||||
// Create (16 * 64k)=1MB faulting entries to cover peripheral range 0x1C000000-0x1C00FFFF
|
||||
MMU_TTPage64k(TTB_BASE, PERIPHERAL_A_FAULT , 16, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, DESCRIPTOR_FAULT);
|
||||
// Define peripheral range 0x1C000000-0x1C00FFFF
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_DAP_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_SYSTEM_REG_BASE, 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_SERIAL_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_AACI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_MMCI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_KMI0_BASE , 2, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_UART_BASE , 4, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_WDT_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
|
||||
// Create (16 * 64k)=1MB faulting entries to cover peripheral range 0x1C100000-0x1C10FFFF
|
||||
MMU_TTPage64k(TTB_BASE, PERIPHERAL_B_FAULT , 16, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, DESCRIPTOR_FAULT);
|
||||
// Define peripheral range 0x1C100000-0x1C10FFFF
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_TIMER_BASE , 2, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_DVI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_RTC_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_UART4_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A7_MP_CLCD_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
|
||||
// Create (256 * 4k)=1MB faulting entries to cover private address space. Needs to be marked as Device memory
|
||||
MMU_TTPage4k (TTB_BASE, __get_CBAR() ,256, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, DESCRIPTOR_FAULT);
|
||||
// Define private address space entry.
|
||||
MMU_TTPage4k (TTB_BASE, __get_CBAR() , 3, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
// Define L2CC entry. Uncomment if PL310 is present
|
||||
// MMU_TTPage4k (TTB_BASE, VE_A5_MP_PL310_BASE , 1, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
|
||||
// Create (256 * 4k)=1MB faulting entries to synchronization space (Useful if some non-cacheable DMA agent is present in the SoC)
|
||||
MMU_TTPage4k (TTB_BASE, F_SYNC_BASE , 256, Page_L1_4k, (uint32_t *)SYNC_FLAGS_TABLE_L2_BASE_4k, DESCRIPTOR_FAULT);
|
||||
// Define synchronization space entry.
|
||||
MMU_TTPage4k (TTB_BASE, FLAG_SYNC , 1, Page_L1_4k, (uint32_t *)SYNC_FLAGS_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
|
||||
/* Set location of level 1 page table
|
||||
; 31:14 - Translation table base addr (31:14-TTBCR.N, TTBCR.N is 0 out of reset)
|
||||
; 13:7 - 0x0
|
||||
; 6 - IRGN[0] 0x1 (Inner WB WA)
|
||||
; 5 - NOS 0x0 (Non-shared)
|
||||
; 4:3 - RGN 0x01 (Outer WB WA)
|
||||
; 2 - IMP 0x0 (Implementation Defined)
|
||||
; 1 - S 0x0 (Non-shared)
|
||||
; 0 - IRGN[1] 0x0 (Inner WB WA) */
|
||||
__set_TTBR0(__TTB_BASE | 0x48);
|
||||
__ISB();
|
||||
|
||||
/* Set up domain access control register
|
||||
; We set domain 0 to Client and all other domains to No Access.
|
||||
; All translation table entries specify domain 0 */
|
||||
__set_DACR(1);
|
||||
__ISB();
|
||||
}
|
@ -1,148 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA7.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A7 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2021
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <ARMCA7.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define USR_MODE 0x10 // User mode
|
||||
#define FIQ_MODE 0x11 // Fast Interrupt Request mode
|
||||
#define IRQ_MODE 0x12 // Interrupt Request mode
|
||||
#define SVC_MODE 0x13 // Supervisor mode
|
||||
#define ABT_MODE 0x17 // Abort mode
|
||||
#define UND_MODE 0x1B // Undefined Instruction mode
|
||||
#define SYS_MODE 0x1F // System mode
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors (void) __attribute__ ((naked, section("RESET")));
|
||||
void Reset_Handler (void) __attribute__ ((naked));
|
||||
void Default_Handler(void) __attribute__ ((noreturn));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Undef_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void DAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void IRQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void FIQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors(void) {
|
||||
__ASM volatile(
|
||||
"LDR PC, =Reset_Handler \n"
|
||||
"LDR PC, =Undef_Handler \n"
|
||||
"LDR PC, =SVC_Handler \n"
|
||||
"LDR PC, =PAbt_Handler \n"
|
||||
"LDR PC, =DAbt_Handler \n"
|
||||
"NOP \n"
|
||||
"LDR PC, =IRQ_Handler \n"
|
||||
"LDR PC, =FIQ_Handler \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Reset_Handler(void) {
|
||||
__ASM volatile(
|
||||
|
||||
// Mask interrupts
|
||||
"CPSID if \n"
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
"MRC p15, 0, R0, c0, c0, 5 \n" // Read MPIDR
|
||||
"ANDS R0, R0, #3 \n"
|
||||
"goToSleep: \n"
|
||||
"WFINE \n"
|
||||
"BNE goToSleep \n"
|
||||
|
||||
// Reset SCTLR Settings
|
||||
"MRC p15, 0, R0, c1, c0, 0 \n" // Read CP15 System Control register
|
||||
"BIC R0, R0, #(0x1 << 12) \n" // Clear I bit 12 to disable I Cache
|
||||
"BIC R0, R0, #(0x1 << 2) \n" // Clear C bit 2 to disable D Cache
|
||||
"BIC R0, R0, #0x1 \n" // Clear M bit 0 to disable MMU
|
||||
"BIC R0, R0, #(0x1 << 11) \n" // Clear Z bit 11 to disable branch prediction
|
||||
"BIC R0, R0, #(0x1 << 13) \n" // Clear V bit 13 to disable hivecs
|
||||
"MCR p15, 0, R0, c1, c0, 0 \n" // Write value back to CP15 System Control register
|
||||
"ISB \n"
|
||||
|
||||
// Configure ACTLR
|
||||
"MRC p15, 0, r0, c1, c0, 1 \n" // Read CP15 Auxiliary Control Register
|
||||
"ORR r0, r0, #(1 << 1) \n" // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
"MCR p15, 0, r0, c1, c0, 1 \n" // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
"LDR R0, =Vectors \n"
|
||||
"MCR p15, 0, R0, c12, c0, 0 \n"
|
||||
|
||||
// Setup Stack for each exceptional mode
|
||||
"CPS #0x11 \n"
|
||||
"LDR SP, =Image$$FIQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x12 \n"
|
||||
"LDR SP, =Image$$IRQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x13 \n"
|
||||
"LDR SP, =Image$$SVC_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x17 \n"
|
||||
"LDR SP, =Image$$ABT_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1B \n"
|
||||
"LDR SP, =Image$$UND_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1F \n"
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||
"LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit \n"
|
||||
#elif defined ( __GNUC__ )
|
||||
"LDR SP, =Image$$SYS_STACK$$ZI$$Limit \n"
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
|
||||
// Call SystemInit
|
||||
"BL SystemInit \n"
|
||||
|
||||
// Unmask interrupts
|
||||
"CPSIE if \n"
|
||||
|
||||
// Call __main
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||
"BL __main \n"
|
||||
#elif defined ( __GNUC__ )
|
||||
"BL _start \n"
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void) {
|
||||
while(1);
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA7.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A7 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2021
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <ARMCA7.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define USR_MODE 0x10 // User mode
|
||||
#define FIQ_MODE 0x11 // Fast Interrupt Request mode
|
||||
#define IRQ_MODE 0x12 // Interrupt Request mode
|
||||
#define SVC_MODE 0x13 // Supervisor mode
|
||||
#define ABT_MODE 0x17 // Abort mode
|
||||
#define UND_MODE 0x1B // Undefined Instruction mode
|
||||
#define SYS_MODE 0x1F // System mode
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors (void) __attribute__ ((naked, section("RESET")));
|
||||
void Reset_Handler (void) __attribute__ ((naked));
|
||||
void Default_Handler(void) __attribute__ ((noreturn));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Undef_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void DAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void IRQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void FIQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors(void) {
|
||||
__ASM volatile(
|
||||
"LDR PC, =Reset_Handler \n"
|
||||
"LDR PC, =Undef_Handler \n"
|
||||
"LDR PC, =SVC_Handler \n"
|
||||
"LDR PC, =PAbt_Handler \n"
|
||||
"LDR PC, =DAbt_Handler \n"
|
||||
"NOP \n"
|
||||
"LDR PC, =IRQ_Handler \n"
|
||||
"LDR PC, =FIQ_Handler \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Reset_Handler(void) {
|
||||
__ASM volatile(
|
||||
|
||||
// Mask interrupts
|
||||
"CPSID if \n"
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
"MRC p15, 0, R0, c0, c0, 5 \n" // Read MPIDR
|
||||
"ANDS R0, R0, #3 \n"
|
||||
"goToSleep: \n"
|
||||
"WFINE \n"
|
||||
"BNE goToSleep \n"
|
||||
|
||||
// Reset SCTLR Settings
|
||||
"MRC p15, 0, R0, c1, c0, 0 \n" // Read CP15 System Control register
|
||||
"BIC R0, R0, #(0x1 << 12) \n" // Clear I bit 12 to disable I Cache
|
||||
"BIC R0, R0, #(0x1 << 2) \n" // Clear C bit 2 to disable D Cache
|
||||
"BIC R0, R0, #0x1 \n" // Clear M bit 0 to disable MMU
|
||||
"BIC R0, R0, #(0x1 << 11) \n" // Clear Z bit 11 to disable branch prediction
|
||||
"BIC R0, R0, #(0x1 << 13) \n" // Clear V bit 13 to disable hivecs
|
||||
"MCR p15, 0, R0, c1, c0, 0 \n" // Write value back to CP15 System Control register
|
||||
"ISB \n"
|
||||
|
||||
// Configure ACTLR
|
||||
"MRC p15, 0, r0, c1, c0, 1 \n" // Read CP15 Auxiliary Control Register
|
||||
"ORR r0, r0, #(1 << 1) \n" // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
"MCR p15, 0, r0, c1, c0, 1 \n" // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
"LDR R0, =Vectors \n"
|
||||
"MCR p15, 0, R0, c12, c0, 0 \n"
|
||||
|
||||
// Setup Stack for each exceptional mode
|
||||
"CPS #0x11 \n"
|
||||
"LDR SP, =Image$$FIQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x12 \n"
|
||||
"LDR SP, =Image$$IRQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x13 \n"
|
||||
"LDR SP, =Image$$SVC_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x17 \n"
|
||||
"LDR SP, =Image$$ABT_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1B \n"
|
||||
"LDR SP, =Image$$UND_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1F \n"
|
||||
"LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit \n"
|
||||
|
||||
// Call SystemInit
|
||||
"BL SystemInit \n"
|
||||
|
||||
// Unmask interrupts
|
||||
"CPSIE if \n"
|
||||
|
||||
// Call __main
|
||||
"BL __main \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void) {
|
||||
while(1);
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA7.s
|
||||
* @brief CMSIS Device System Source File for ARM Cortex-A9 Device Series
|
||||
* @version V1.00
|
||||
* @date 01 Nov 2017
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MODULE ?startup_ARMCA7
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
PUBLIC Reset_Handler
|
||||
PUBWEAK Undef_Handler
|
||||
PUBWEAK SVC_Handler
|
||||
PUBWEAK PAbt_Handler
|
||||
PUBWEAK DAbt_Handler
|
||||
PUBWEAK IRQ_Handler
|
||||
PUBWEAK FIQ_Handler
|
||||
|
||||
SECTION SVC_STACK:DATA:NOROOT(3)
|
||||
SECTION IRQ_STACK:DATA:NOROOT(3)
|
||||
SECTION FIQ_STACK:DATA:NOROOT(3)
|
||||
SECTION ABT_STACK:DATA:NOROOT(3)
|
||||
SECTION UND_STACK:DATA:NOROOT(3)
|
||||
SECTION USR_STACK:DATA:NOROOT(3)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
section RESET:CODE:NOROOT(2)
|
||||
PUBLIC Vectors
|
||||
|
||||
Vectors:
|
||||
LDR PC, =Reset_Handler
|
||||
LDR PC, =Undef_Handler
|
||||
LDR PC, =SVC_Handler
|
||||
LDR PC, =PAbt_Handler
|
||||
LDR PC, =DAbt_Handler
|
||||
NOP
|
||||
LDR PC, =IRQ_Handler
|
||||
LDR PC, =FIQ_Handler
|
||||
|
||||
|
||||
section .text:CODE:NOROOT(4)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_program_start
|
||||
|
||||
Reset_Handler:
|
||||
|
||||
// Mask interrupts
|
||||
CPSID if
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
MRC p15, 0, R0, c0, c0, 5
|
||||
ANDS R0, R0, #3
|
||||
goToSleep:
|
||||
WFINE
|
||||
BNE goToSleep
|
||||
|
||||
// Reset SCTLR Settings
|
||||
MRC p15, 0, R0, c1, c0, 0 // Read CP15 System Control register
|
||||
BIC R0, R0, #(0x1 << 12) // Clear I bit 12 to disable I Cache
|
||||
BIC R0, R0, #(0x1 << 2) // Clear C bit 2 to disable D Cache
|
||||
BIC R0, R0, #0x1 // Clear M bit 0 to disable MMU
|
||||
BIC R0, R0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction
|
||||
BIC R0, R0, #(0x1 << 13) // Clear V bit 13 to disable hivecs
|
||||
MCR p15, 0, R0, c1, c0, 0 // Write value back to CP15 System Control register
|
||||
ISB
|
||||
|
||||
// Configure ACTLR
|
||||
MRC p15, 0, r0, c1, c0, 1 // Read CP15 Auxiliary Control Register
|
||||
ORR r0, r0, #(1 << 1) // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
MCR p15, 0, r0, c1, c0, 1 // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
LDR R0, =Vectors
|
||||
MCR p15, 0, R0, c12, c0, 0
|
||||
|
||||
// Setup Stack for each exception mode
|
||||
CPS #0x11
|
||||
LDR SP, =SFE(FIQ_STACK)
|
||||
CPS #0x12
|
||||
LDR SP, =SFE(IRQ_STACK)
|
||||
CPS #0x13
|
||||
LDR SP, =SFE(SVC_STACK)
|
||||
CPS #0x17
|
||||
LDR SP, =SFE(ABT_STACK)
|
||||
CPS #0x1B
|
||||
LDR SP, =SFE(UND_STACK)
|
||||
CPS #0x1F
|
||||
LDR SP, =SFE(USR_STACK)
|
||||
|
||||
// Call SystemInit
|
||||
BL SystemInit
|
||||
|
||||
// Unmask interrupts
|
||||
CPSIE if
|
||||
|
||||
// Call __iar_program_start
|
||||
BL __iar_program_start
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
Undef_Handler:
|
||||
SVC_Handler:
|
||||
PAbt_Handler:
|
||||
DAbt_Handler:
|
||||
IRQ_Handler:
|
||||
FIQ_Handler:
|
||||
Default_Handler:
|
||||
B .
|
||||
|
||||
END
|
@ -1,140 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA7.s
|
||||
* @brief CMSIS Device System Source File for ARM Cortex-A9 Device Series
|
||||
* @version V1.00
|
||||
* @date 01 Nov 2017
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MODULE ?startup_ARMCA7
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
PUBLIC Reset_Handler
|
||||
PUBWEAK Undef_Handler
|
||||
PUBWEAK SVC_Handler
|
||||
PUBWEAK PAbt_Handler
|
||||
PUBWEAK DAbt_Handler
|
||||
PUBWEAK IRQ_Handler
|
||||
PUBWEAK FIQ_Handler
|
||||
|
||||
SECTION SVC_STACK:DATA:NOROOT(3)
|
||||
SECTION IRQ_STACK:DATA:NOROOT(3)
|
||||
SECTION FIQ_STACK:DATA:NOROOT(3)
|
||||
SECTION ABT_STACK:DATA:NOROOT(3)
|
||||
SECTION UND_STACK:DATA:NOROOT(3)
|
||||
SECTION USR_STACK:DATA:NOROOT(3)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
section RESET:CODE:NOROOT(2)
|
||||
PUBLIC Vectors
|
||||
|
||||
Vectors:
|
||||
LDR PC, =Reset_Handler
|
||||
LDR PC, =Undef_Handler
|
||||
LDR PC, =SVC_Handler
|
||||
LDR PC, =PAbt_Handler
|
||||
LDR PC, =DAbt_Handler
|
||||
NOP
|
||||
LDR PC, =IRQ_Handler
|
||||
LDR PC, =FIQ_Handler
|
||||
|
||||
|
||||
section .text:CODE:NOROOT(4)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_program_start
|
||||
|
||||
Reset_Handler:
|
||||
|
||||
// Mask interrupts
|
||||
CPSID if
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
MRC p15, 0, R0, c0, c0, 5
|
||||
ANDS R0, R0, #3
|
||||
goToSleep:
|
||||
WFINE
|
||||
BNE goToSleep
|
||||
|
||||
// Reset SCTLR Settings
|
||||
MRC p15, 0, R0, c1, c0, 0 // Read CP15 System Control register
|
||||
BIC R0, R0, #(0x1 << 12) // Clear I bit 12 to disable I Cache
|
||||
BIC R0, R0, #(0x1 << 2) // Clear C bit 2 to disable D Cache
|
||||
BIC R0, R0, #0x1 // Clear M bit 0 to disable MMU
|
||||
BIC R0, R0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction
|
||||
BIC R0, R0, #(0x1 << 13) // Clear V bit 13 to disable hivecs
|
||||
MCR p15, 0, R0, c1, c0, 0 // Write value back to CP15 System Control register
|
||||
ISB
|
||||
|
||||
// Configure ACTLR
|
||||
MRC p15, 0, r0, c1, c0, 1 // Read CP15 Auxiliary Control Register
|
||||
ORR r0, r0, #(1 << 1) // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
MCR p15, 0, r0, c1, c0, 1 // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
LDR R0, =Vectors
|
||||
MCR p15, 0, R0, c12, c0, 0
|
||||
|
||||
// Setup Stack for each exception mode
|
||||
CPS #0x11
|
||||
LDR SP, =SFE(FIQ_STACK)
|
||||
CPS #0x12
|
||||
LDR SP, =SFE(IRQ_STACK)
|
||||
CPS #0x13
|
||||
LDR SP, =SFE(SVC_STACK)
|
||||
CPS #0x17
|
||||
LDR SP, =SFE(ABT_STACK)
|
||||
CPS #0x1B
|
||||
LDR SP, =SFE(UND_STACK)
|
||||
CPS #0x1F
|
||||
LDR SP, =SFE(USR_STACK)
|
||||
|
||||
// Call SystemInit
|
||||
BL SystemInit
|
||||
|
||||
// Unmask interrupts
|
||||
CPSIE if
|
||||
|
||||
// Call __iar_program_start
|
||||
BL __iar_program_start
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
Undef_Handler:
|
||||
SVC_Handler:
|
||||
PAbt_Handler:
|
||||
DAbt_Handler:
|
||||
IRQ_Handler:
|
||||
FIQ_Handler:
|
||||
Default_Handler:
|
||||
B .
|
||||
|
||||
END
|
@ -1,93 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA7.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A7 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 13. February 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#define SYSTEM_CLOCK 12000000U
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Initialization
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
/* do not use global variables because this function is called before
|
||||
reaching pre-main. RW section may be overwritten afterwards. */
|
||||
|
||||
// Invalidate entire Unified TLB
|
||||
__set_TLBIALL(0);
|
||||
|
||||
// Invalidate entire branch predictor array
|
||||
__set_BPIALL(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate instruction cache and flush branch target cache
|
||||
__set_ICIALLU(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate data cache
|
||||
L1C_InvalidateDCacheAll();
|
||||
|
||||
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
|
||||
// Enable FPU
|
||||
__FPU_Enable();
|
||||
#endif
|
||||
|
||||
// Create Translation Table
|
||||
MMU_CreateTranslationTable();
|
||||
|
||||
// Enable MMU
|
||||
MMU_Enable();
|
||||
|
||||
// Enable Caches
|
||||
L1C_EnableCaches();
|
||||
L1C_EnableBTAC();
|
||||
|
||||
#if (__L2C_PRESENT == 1)
|
||||
// Enable GIC
|
||||
L2C_Enable();
|
||||
#endif
|
||||
|
||||
// IRQ Initialize
|
||||
IRQ_Initialize();
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA7.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A7 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 13. February 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#define SYSTEM_CLOCK 12000000U
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Initialization
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
/* do not use global variables because this function is called before
|
||||
reaching pre-main. RW section may be overwritten afterwards. */
|
||||
|
||||
// Invalidate entire Unified TLB
|
||||
__set_TLBIALL(0);
|
||||
|
||||
// Invalidate entire branch predictor array
|
||||
__set_BPIALL(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate instruction cache and flush branch target cache
|
||||
__set_ICIALLU(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate data cache
|
||||
L1C_InvalidateDCacheAll();
|
||||
|
||||
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
|
||||
// Enable FPU
|
||||
__FPU_Enable();
|
||||
#endif
|
||||
|
||||
// Create Translation Table
|
||||
MMU_CreateTranslationTable();
|
||||
|
||||
// Enable MMU
|
||||
MMU_Enable();
|
||||
|
||||
// Enable Caches
|
||||
L1C_EnableCaches();
|
||||
L1C_EnableBTAC();
|
||||
|
||||
#if (__L2C_PRESENT == 1)
|
||||
// Enable GIC
|
||||
L2C_Enable();
|
||||
#endif
|
||||
|
||||
// IRQ Initialize
|
||||
IRQ_Initialize();
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA7.h
|
||||
* @brief CMSIS Device System Header File for Arm Cortex-A7 Device Series
|
||||
* @version V1.00
|
||||
* @date 10. January 2018
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEM_ARMCA7_H
|
||||
#define __SYSTEM_ARMCA7_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
/**
|
||||
\brief Setup the microcontroller system.
|
||||
|
||||
Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
|
||||
/**
|
||||
\brief Update SystemCoreClock variable.
|
||||
|
||||
Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
/**
|
||||
\brief Create Translation Table.
|
||||
|
||||
Creates Memory Management Unit Translation Table.
|
||||
*/
|
||||
extern void MMU_CreateTranslationTable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_ARMCA7_H */
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA7.h
|
||||
* @brief CMSIS Device System Header File for Arm Cortex-A7 Device Series
|
||||
* @version V1.00
|
||||
* @date 10. January 2018
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEM_ARMCA7_H
|
||||
#define __SYSTEM_ARMCA7_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
/**
|
||||
\brief Setup the microcontroller system.
|
||||
|
||||
Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
|
||||
/**
|
||||
\brief Update SystemCoreClock variable.
|
||||
|
||||
Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
/**
|
||||
\brief Create Translation Table.
|
||||
|
||||
Creates Memory Management Unit Translation Table.
|
||||
*/
|
||||
extern void MMU_CreateTranslationTable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_ARMCA7_H */
|
@ -1,23 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup
|
||||
- component: Device:IRQ Controller:GIC
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,22 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#----------------------------------------------------------------------------------------------
|
||||
motherboard.vis.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
cluster.cpu0.vfp-present=1 # (bool , init-time) default = '1' : Set whether CT model has been built with VFP support
|
||||
cluster.cpu0.ase-present=0 # (bool , init-time) default = '1' : Set whether CT model has been built with NEON support
|
||||
cluster.cpu0.semihosting-enable=1 # (bool , init-time) default = '1' : Enable semihosting SVC traps. Applications that do not use semihosting must set this parameter to false
|
||||
cluster.cpu0.semihosting-hlt-enable=0 # (bool , init-time) default = '0' : Enable semihosting HLT traps. Applications that use HLT semihosting must set this parameter to true and the semihosting-enable parameter to true
|
||||
cluster.cpu0.semihosting-ARM_SVC=0x123456 # (int , init-time) default = '0x123456' : ARM SVC number for semihosting : [0x0..0xFFFFFF]
|
||||
cluster.cpu0.semihosting-Thumb_SVC=0xAB # (int , init-time) default = '0xAB' : Thumb SVC number for semihosting : [0x0..0xFF]
|
||||
cluster.cpu0.semihosting-ARM_HLT=0xF000 # (int , init-time) default = '0xF000' : ARM HLT number for semihosting : [0x0..0xFFFF]
|
||||
cluster.cpu0.semihosting-Thumb_HLT=0x3C # (int , init-time) default = '0x3C' : Thumb HLT number for semihosting : [0x0..0x3F]
|
||||
cluster.cpu0.semihosting-cmd_line="" # (string, init-time) default = '' : Command line available to semihosting SVC calls
|
||||
cluster.cpu0.semihosting-heap_base=0x0 # (int , init-time) default = '0x0' : Virtual address of heap base : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-heap_limit=0x0 # (int , init-time) default = '0xFF000000' : Virtual address of top of heap : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-stack_base=0x0 # (int , init-time) default = '0xFFFF0000' : Virtual address of base of descending stack : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-stack_limit=0x0 # (int , init-time) default = '0xFF000000' : Virtual address of stack limit : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-cwd="" # (string, init-time) default = '' : Base directory for semihosting file access.
|
||||
cluster.l1_icache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether L1 I-cache has stateful implementation
|
||||
cluster.l1_dcache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether L1 D-cache has stateful implementation
|
||||
cluster.l2_cache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether L2 cache has stateful implementation
|
||||
#----------------------------------------------------------------------------------------------
|
@ -1,67 +0,0 @@
|
||||
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = 0x80000000;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = 0x801FFFFF;
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = 0x80200000;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = 0x803FFFFF;
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_TTB_start__ = 0x80500000;
|
||||
define symbol __ICFEDIT_region_TTB_end__ = 0x805FFFFF;
|
||||
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
define symbol __ICFEDIT_size_irqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_svcstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_abtstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_undstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x8000;
|
||||
define symbol __ICFEDIT_size_ttb__ = 0x4000;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__];
|
||||
define region TTB_region = mem:[from __ICFEDIT_region_TTB_start__ to __ICFEDIT_region_TTB_end__ ];
|
||||
|
||||
define block USR_STACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
|
||||
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
|
||||
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
|
||||
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
|
||||
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block TTB with alignment = 8, size = __ICFEDIT_size_ttb__ { section TTB };
|
||||
|
||||
do not initialize { section .noinit };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
place at address mem:__ICFEDIT_region_IROM1_start__ { readonly section RESET };
|
||||
place in IROM_region { readonly };
|
||||
place in IRAM_region { readwrite, block HEAP, block USR_STACK, block IRQ_STACK, block FIQ_STACK, block SVC_STACK, block ABT_STACK, block UND_STACK };
|
||||
place in TTB_region { block TTB };
|
@ -1,67 +0,0 @@
|
||||
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = 0x80000000;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = 0x801FFFFF;
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = 0x80200000;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = 0x803FFFFF;
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
define symbol __ICFEDIT_region_TTB_start__ = 0x80500000;
|
||||
define symbol __ICFEDIT_region_TTB_end__ = 0x805FFFFF;
|
||||
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
define symbol __ICFEDIT_size_irqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_svcstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_abtstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_undstack__ = 0x100;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x8000;
|
||||
define symbol __ICFEDIT_size_ttb__ = 0x4000;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]
|
||||
| mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__];
|
||||
define region TTB_region = mem:[from __ICFEDIT_region_TTB_start__ to __ICFEDIT_region_TTB_end__ ];
|
||||
|
||||
define block USR_STACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
|
||||
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
|
||||
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
|
||||
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
|
||||
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block TTB with alignment = 8, size = __ICFEDIT_size_ttb__ { section TTB };
|
||||
|
||||
do not initialize { section .noinit };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
place at address mem:__ICFEDIT_region_IROM1_start__ { readonly section RESET };
|
||||
place in IROM_region { readonly };
|
||||
place in IRAM_region { readwrite, block HEAP, block USR_STACK, block IRQ_STACK, block FIQ_STACK, block SVC_STACK, block ABT_STACK, block UND_STACK };
|
||||
place in TTB_region { block TTB };
|
@ -1,181 +0,0 @@
|
||||
#include "mem_ARMCA9.h"
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ROM (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
L_TTB (rw) : ORIGIN = __TTB_BASE, LENGTH = __TTB_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
|
||||
Image$$VECTORS$$Base = .;
|
||||
* (RESET)
|
||||
KEEP(*(.isr_vector))
|
||||
Image$$VECTORS$$Limit = .;
|
||||
|
||||
*(SVC_TABLE)
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
Image$$RO_DATA$$Base = .;
|
||||
*(.rodata*)
|
||||
Image$$RO_DATA$$Limit = .;
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > ROM
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > ROM
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > ROM
|
||||
__exidx_end = .;
|
||||
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > ROM
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > ROM
|
||||
|
||||
__etext = .;
|
||||
|
||||
.ttb :
|
||||
{
|
||||
Image$$TTB$$ZI$$Base = .;
|
||||
. += __TTB_SIZE;
|
||||
Image$$TTB$$ZI$$Limit = .;
|
||||
} > L_TTB
|
||||
|
||||
.data :
|
||||
{
|
||||
Image$$RW_DATA$$Base = .;
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
Image$$RW_DATA$$Limit = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE (__fini_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
|
||||
.bss ALIGN(0x400):
|
||||
{
|
||||
Image$$ZI_DATA$$Base = .;
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
__bss_end__ = .;
|
||||
Image$$ZI_DATA$$Limit = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
} > RAM AT > RAM
|
||||
|
||||
#if defined(__HEAP_SIZE) && (__HEAP_SIZE > 0)
|
||||
.heap (NOLOAD):
|
||||
{
|
||||
. = ALIGN(8);
|
||||
Image$$HEAP$$ZI$$Base = .;
|
||||
. += __HEAP_SIZE;
|
||||
Image$$HEAP$$ZI$$Limit = .;
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
#endif
|
||||
|
||||
.stack (NOLOAD):
|
||||
{
|
||||
. = ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE - __FIQ_STACK_SIZE - __IRQ_STACK_SIZE - __SVC_STACK_SIZE - __ABT_STACK_SIZE - __UND_STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
|
||||
__StackTop = .;
|
||||
Image$$SYS_STACK$$ZI$$Base = .;
|
||||
. += __STACK_SIZE;
|
||||
Image$$SYS_STACK$$ZI$$Limit = .;
|
||||
__stack = .;
|
||||
|
||||
Image$$FIQ_STACK$$ZI$$Base = .;
|
||||
. += __FIQ_STACK_SIZE;
|
||||
Image$$FIQ_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$IRQ_STACK$$ZI$$Base = .;
|
||||
. += __IRQ_STACK_SIZE;
|
||||
Image$$IRQ_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$SVC_STACK$$ZI$$Base = .;
|
||||
. += __SVC_STACK_SIZE;
|
||||
Image$$SVC_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$ABT_STACK$$ZI$$Base = .;
|
||||
. += __ABT_STACK_SIZE;
|
||||
Image$$ABT_STACK$$ZI$$Limit = .;
|
||||
|
||||
Image$$UND_STACK$$ZI$$Base = .;
|
||||
. += __UND_STACK_SIZE;
|
||||
Image$$UND_STACK$$ZI$$Limit = .;
|
||||
|
||||
} > RAM
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-a9 -xc
|
||||
;**************************************************
|
||||
; Copyright (c) 2017 ARM Ltd. All rights reserved.
|
||||
;**************************************************
|
||||
|
||||
; Scatter-file for RTX Example on Versatile Express
|
||||
|
||||
; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map.
|
||||
|
||||
; This platform has 2GB SDRAM starting at 0x80000000.
|
||||
|
||||
#include "mem_ARMCA9.h"
|
||||
|
||||
SDRAM __ROM_BASE __ROM_SIZE ; load region size_region
|
||||
{
|
||||
VECTORS __ROM_BASE __ROM_SIZE ; load address = execution address
|
||||
{
|
||||
* (RESET, +FIRST) ; Vector table and other startup code
|
||||
* (InRoot$$Sections) ; All (library) code that must be in a root region
|
||||
* (+RO-CODE) ; Application RO code (.text)
|
||||
* (+RO-DATA) ; Application RO data (.constdata)
|
||||
}
|
||||
|
||||
RW_DATA __RAM_BASE __RW_DATA_SIZE
|
||||
{ * (+RW) } ; Application RW data (.data)
|
||||
|
||||
ZI_DATA (__RAM_BASE+
|
||||
__RW_DATA_SIZE) __ZI_DATA_SIZE
|
||||
{ * (+ZI) } ; Application ZI data (.bss)
|
||||
|
||||
ARM_LIB_HEAP (__RAM_BASE
|
||||
+__RW_DATA_SIZE
|
||||
+__ZI_DATA_SIZE) EMPTY __HEAP_SIZE ; Heap region growing up
|
||||
{ }
|
||||
|
||||
ARM_LIB_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE
|
||||
-__ABT_STACK_SIZE
|
||||
-__UND_STACK_SIZE) EMPTY -__STACK_SIZE ; Stack region growing down
|
||||
{ }
|
||||
|
||||
UND_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE
|
||||
-__ABT_STACK_SIZE) EMPTY -__UND_STACK_SIZE ; UND mode stack
|
||||
{ }
|
||||
|
||||
ABT_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE
|
||||
-__SVC_STACK_SIZE) EMPTY -__ABT_STACK_SIZE ; ABT mode stack
|
||||
{ }
|
||||
|
||||
SVC_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE
|
||||
-__IRQ_STACK_SIZE) EMPTY -__SVC_STACK_SIZE ; SVC mode stack
|
||||
{ }
|
||||
|
||||
IRQ_STACK (__RAM_BASE
|
||||
+__RAM_SIZE
|
||||
-__FIQ_STACK_SIZE) EMPTY -__IRQ_STACK_SIZE ; IRQ mode stack
|
||||
{ }
|
||||
|
||||
FIQ_STACK (__RAM_BASE
|
||||
+__RAM_SIZE) EMPTY -__FIQ_STACK_SIZE ; FIQ mode stack
|
||||
{ }
|
||||
|
||||
TTB __TTB_BASE EMPTY __TTB_SIZE ; Level-1 Translation Table for MMU
|
||||
{ }
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file mem_ARMCA9.h
|
||||
* @brief Memory base and size definitions (used in scatter file)
|
||||
* @version V1.1.0
|
||||
* @date 15. May 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __MEM_ARMCA9_H
|
||||
#define __MEM_ARMCA9_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
/*
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
*/
|
||||
|
||||
/*--------------------- ROM Configuration ------------------------------------
|
||||
//
|
||||
// <h> ROM Configuration
|
||||
// <i> For compatibility with MMU config the sections must be multiple of 1MB
|
||||
// <o0> ROM Base Address <0x0-0xFFFFFFFF:0x100000>
|
||||
// <o1> ROM Size (in Bytes) <0x0-0xFFFFFFFF:0x100000>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x80000000
|
||||
#define __ROM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- RAM Configuration -----------------------------------
|
||||
// <h> RAM Configuration
|
||||
// <i> For compatibility with MMU config the sections must be multiple of 1MB
|
||||
// <o0> RAM Base Address <0x0-0xFFFFFFFF:0x100000>
|
||||
// <o1> RAM Total Size (in Bytes) <0x0-0xFFFFFFFF:0x100000>
|
||||
// <h> Data Sections
|
||||
// <o2> RW_DATA Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o3> ZI_DATA Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
// <h> Stack / Heap Configuration
|
||||
// <o4> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o5> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <h> Exceptional Modes
|
||||
// <o6> UND Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o7> ABT Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o8> SVC Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o9> IRQ Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// <o10> FIQ Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
// </h>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x80200000
|
||||
#define __RAM_SIZE 0x00200000
|
||||
|
||||
#define __RW_DATA_SIZE 0x00100000
|
||||
#define __ZI_DATA_SIZE 0x000F0000
|
||||
|
||||
#define __STACK_SIZE 0x00001000
|
||||
#define __HEAP_SIZE 0x00008000
|
||||
|
||||
#define __UND_STACK_SIZE 0x00000100
|
||||
#define __ABT_STACK_SIZE 0x00000100
|
||||
#define __SVC_STACK_SIZE 0x00000100
|
||||
#define __IRQ_STACK_SIZE 0x00000100
|
||||
#define __FIQ_STACK_SIZE 0x00000100
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------- TTB Configuration ------------------------------------
|
||||
//
|
||||
// <h> TTB Configuration
|
||||
// <i> The TLB L1 contains 4096 32-bit entries and must be 16kB aligned
|
||||
// <i> The TLB L2 entries are placed after the L1 in the MMU config
|
||||
// <o0> TTB Base Address <0x0-0xFFFFFFFF:0x4000>
|
||||
// <o1> TTB Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
// </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __TTB_BASE 0x80500000
|
||||
#define __TTB_SIZE 0x00005000
|
||||
|
||||
#endif /* __MEM_ARMCA9_H */
|
@ -1,232 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file mmu_ARMCA9.c
|
||||
* @brief MMU Configuration for Arm Cortex-A9 Device Series
|
||||
* @version V1.2.0
|
||||
* @date 15. May 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* Memory map description from: DUI0447G_v2m_p1_trm.pdf 4.2.2 Arm Cortex-A Series memory map
|
||||
|
||||
Memory Type
|
||||
0xffffffff |--------------------------| ------------
|
||||
| FLAG SYNC | Device Memory
|
||||
0xfffff000 |--------------------------| ------------
|
||||
| Fault | Fault
|
||||
0xfff00000 |--------------------------| ------------
|
||||
| | Normal
|
||||
| |
|
||||
| Daughterboard |
|
||||
| memory |
|
||||
| |
|
||||
0x80505000 |--------------------------| ------------
|
||||
|TTB (L2 Sync Flags ) 4k | Normal
|
||||
0x80504C00 |--------------------------| ------------
|
||||
|TTB (L2 Peripherals-B) 16k| Normal
|
||||
0x80504800 |--------------------------| ------------
|
||||
|TTB (L2 Peripherals-A) 16k| Normal
|
||||
0x80504400 |--------------------------| ------------
|
||||
|TTB (L2 Priv Periphs) 4k | Normal
|
||||
0x80504000 |--------------------------| ------------
|
||||
| TTB (L1 Descriptors) | Normal
|
||||
0x80500000 |--------------------------| ------------
|
||||
| Stack | Normal
|
||||
|--------------------------| ------------
|
||||
| Heap | Normal
|
||||
0x80400000 |--------------------------| ------------
|
||||
| ZI Data | Normal
|
||||
0x80300000 |--------------------------| ------------
|
||||
| RW Data | Normal
|
||||
0x80200000 |--------------------------| ------------
|
||||
| RO Data | Normal
|
||||
|--------------------------| ------------
|
||||
| RO Code | USH Normal
|
||||
0x80000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| HSB AXI buses |
|
||||
0x40000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| test chips peripherals |
|
||||
0x2c002000 |--------------------------| ------------
|
||||
| Private Address | Device Memory
|
||||
0x2c000000 |--------------------------| ------------
|
||||
| Daughterboard | Fault
|
||||
| test chips peripherals |
|
||||
0x20000000 |--------------------------| ------------
|
||||
| Peripherals | Device Memory RW/RO
|
||||
| | & Fault
|
||||
0x00000000 |--------------------------|
|
||||
*/
|
||||
|
||||
// L1 Cache info and restrictions about architecture of the caches (CCSIR register):
|
||||
// Write-Through support *not* available
|
||||
// Write-Back support available.
|
||||
// Read allocation support available.
|
||||
// Write allocation support available.
|
||||
|
||||
//Note: You should use the Shareable attribute carefully.
|
||||
//For cores without coherency logic (such as SCU) marking a region as shareable forces the processor to not cache that region regardless of the inner cache settings.
|
||||
//Cortex-A versions of RTX use LDREX/STREX instructions relying on Local monitors. Local monitors will be used only when the region gets cached, regions that are not cached will use the Global Monitor.
|
||||
//Some Cortex-A implementations do not include Global Monitors, so wrongly setting the attribute Shareable may cause STREX to fail.
|
||||
|
||||
//Recall: When the Shareable attribute is applied to a memory region that is not Write-Back, Normal memory, data held in this region is treated as Non-cacheable.
|
||||
//When SMP bit = 0, Inner WB/WA Cacheable Shareable attributes are treated as Non-cacheable.
|
||||
//When SMP bit = 1, Inner WB/WA Cacheable Shareable attributes are treated as Cacheable.
|
||||
|
||||
|
||||
//Following MMU configuration is expected
|
||||
//SCTLR.AFE == 1 (Simplified access permissions model - AP[2:1] define access permissions, AP[0] is an access flag)
|
||||
//SCTLR.TRE == 0 (TEX remap disabled, so memory type and attributes are described directly by bits in the descriptor)
|
||||
//Domain 0 is always the Client domain
|
||||
//Descriptors should place all memory in domain 0
|
||||
|
||||
#include "ARMCA9.h"
|
||||
#include "mem_ARMCA9.h"
|
||||
|
||||
// TTB base address
|
||||
#define TTB_BASE ((uint32_t*)__TTB_BASE)
|
||||
|
||||
// L2 table pointers
|
||||
//----------------------------------------
|
||||
#define TTB_L1_SIZE (0x00004000) // The L1 translation table divides the full 4GB address space of a 32-bit core
|
||||
// into 4096 equally sized sections, each of which describes 1MB of virtual memory space.
|
||||
// The L1 translation table therefore contains 4096 32-bit (word-sized) entries.
|
||||
|
||||
#define PRIVATE_TABLE_L2_BASE_4k (__TTB_BASE + TTB_L1_SIZE) // Map 4k Private Address space
|
||||
#define PERIPHERAL_A_TABLE_L2_BASE_64k (__TTB_BASE + TTB_L1_SIZE + 0x400) // Map 64k Peripheral #1 0x1C000000 - 0x1C00FFFFF
|
||||
#define PERIPHERAL_B_TABLE_L2_BASE_64k (__TTB_BASE + TTB_L1_SIZE + 0x800) // Map 64k Peripheral #2 0x1C100000 - 0x1C1FFFFFF
|
||||
#define SYNC_FLAGS_TABLE_L2_BASE_4k (__TTB_BASE + TTB_L1_SIZE + 0xC00) // Map 4k Flag synchronization
|
||||
|
||||
//--------------------- PERIPHERALS -------------------
|
||||
#define PERIPHERAL_A_FAULT (0x00000000 + 0x1c000000) //0x1C000000-0x1C00FFFF (1M)
|
||||
#define PERIPHERAL_B_FAULT (0x00100000 + 0x1c000000) //0x1C100000-0x1C10FFFF (1M)
|
||||
|
||||
//--------------------- SYNC FLAGS --------------------
|
||||
#define FLAG_SYNC 0xFFFFF000
|
||||
#define F_SYNC_BASE 0xFFF00000 //1M aligned
|
||||
|
||||
static uint32_t Sect_Normal; //outer & inner wb/wa, non-shareable, executable, rw, domain 0, base addr 0
|
||||
static uint32_t Sect_Normal_Cod; //outer & inner wb/wa, non-shareable, executable, ro, domain 0, base addr 0
|
||||
static uint32_t Sect_Normal_RO; //as Sect_Normal_Cod, but not executable
|
||||
static uint32_t Sect_Normal_RW; //as Sect_Normal_Cod, but writeable and not executable
|
||||
static uint32_t Sect_Device_RO; //device, non-shareable, non-executable, ro, domain 0, base addr 0
|
||||
static uint32_t Sect_Device_RW; //as Sect_Device_RO, but writeable
|
||||
|
||||
/* Define global descriptors */
|
||||
static uint32_t Page_L1_4k = 0x0; //generic
|
||||
static uint32_t Page_L1_64k = 0x0; //generic
|
||||
static uint32_t Page_4k_Device_RW; //Shared device, not executable, rw, domain 0
|
||||
static uint32_t Page_64k_Device_RW; //Shared device, not executable, rw, domain 0
|
||||
|
||||
void MMU_CreateTranslationTable(void)
|
||||
{
|
||||
mmu_region_attributes_Type region;
|
||||
|
||||
//Create 4GB of faulting entries
|
||||
MMU_TTSection (TTB_BASE, 0, 4096, DESCRIPTOR_FAULT);
|
||||
|
||||
/*
|
||||
* Generate descriptors. Refer to core_ca.h to get information about attributes
|
||||
*
|
||||
*/
|
||||
//Create descriptors for Vectors, RO, RW, ZI sections
|
||||
section_normal(Sect_Normal, region);
|
||||
section_normal_cod(Sect_Normal_Cod, region);
|
||||
section_normal_ro(Sect_Normal_RO, region);
|
||||
section_normal_rw(Sect_Normal_RW, region);
|
||||
//Create descriptors for peripherals
|
||||
section_device_ro(Sect_Device_RO, region);
|
||||
section_device_rw(Sect_Device_RW, region);
|
||||
//Create descriptors for 64k pages
|
||||
page64k_device_rw(Page_L1_64k, Page_64k_Device_RW, region);
|
||||
//Create descriptors for 4k pages
|
||||
page4k_device_rw(Page_L1_4k, Page_4k_Device_RW, region);
|
||||
|
||||
|
||||
/*
|
||||
* Define MMU flat-map regions and attributes
|
||||
*
|
||||
*/
|
||||
|
||||
//Define Image
|
||||
MMU_TTSection (TTB_BASE, __ROM_BASE, __ROM_SIZE/0x100000, Sect_Normal_Cod); // multiple of 1MB sections
|
||||
MMU_TTSection (TTB_BASE, __RAM_BASE, __RAM_SIZE/0x100000, Sect_Normal_RW); // multiple of 1MB sections
|
||||
|
||||
//--------------------- PERIPHERALS -------------------
|
||||
MMU_TTSection (TTB_BASE, VE_A9_MP_FLASH_BASE0 , 64, Sect_Device_RO); // 64MB NOR
|
||||
MMU_TTSection (TTB_BASE, VE_A9_MP_FLASH_BASE1 , 64, Sect_Device_RO); // 64MB NOR
|
||||
MMU_TTSection (TTB_BASE, VE_A9_MP_SRAM_BASE , 32, Sect_Device_RW); // 32MB RAM
|
||||
MMU_TTSection (TTB_BASE, VE_A9_MP_VRAM_BASE , 32, Sect_Device_RW); // 32MB RAM
|
||||
MMU_TTSection (TTB_BASE, VE_A9_MP_ETHERNET_BASE , 16, Sect_Device_RW);
|
||||
MMU_TTSection (TTB_BASE, VE_A9_MP_USB_BASE , 16, Sect_Device_RW);
|
||||
|
||||
// Create (16 * 64k)=1MB faulting entries to cover peripheral range 0x1C000000-0x1C00FFFF
|
||||
MMU_TTPage64k(TTB_BASE, PERIPHERAL_A_FAULT , 16, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, DESCRIPTOR_FAULT);
|
||||
// Define peripheral range 0x1C000000-0x1C00FFFF
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_DAP_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_SYSTEM_REG_BASE, 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_SERIAL_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_AACI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_MMCI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_KMI0_BASE , 2, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_UART_BASE , 4, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_WDT_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_A_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
|
||||
// Create (16 * 64k)=1MB faulting entries to cover peripheral range 0x1C100000-0x1C10FFFF
|
||||
MMU_TTPage64k(TTB_BASE, PERIPHERAL_B_FAULT , 16, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, DESCRIPTOR_FAULT);
|
||||
// Define peripheral range 0x1C100000-0x1C10FFFF
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_TIMER_BASE , 2, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_DVI_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_RTC_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_UART4_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
MMU_TTPage64k(TTB_BASE, VE_A9_MP_CLCD_BASE , 1, Page_L1_64k, (uint32_t *)PERIPHERAL_B_TABLE_L2_BASE_64k, Page_64k_Device_RW);
|
||||
|
||||
// Create (256 * 4k)=1MB faulting entries to cover private address space. Needs to be marked as Device memory
|
||||
MMU_TTPage4k (TTB_BASE, __get_CBAR() ,256, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, DESCRIPTOR_FAULT);
|
||||
// Define private address space entry.
|
||||
MMU_TTPage4k (TTB_BASE, __get_CBAR() , 2, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
// Define L2CC entry. Uncomment if PL310 is present
|
||||
// MMU_TTPage4k (TTB_BASE, VE_A5_MP_PL310_BASE , 1, Page_L1_4k, (uint32_t *)PRIVATE_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
|
||||
// Create (256 * 4k)=1MB faulting entries to synchronization space (Useful if some non-cacheable DMA agent is present in the SoC)
|
||||
MMU_TTPage4k (TTB_BASE, F_SYNC_BASE , 256, Page_L1_4k, (uint32_t *)SYNC_FLAGS_TABLE_L2_BASE_4k, DESCRIPTOR_FAULT);
|
||||
// Define synchronization space entry.
|
||||
MMU_TTPage4k (TTB_BASE, FLAG_SYNC , 1, Page_L1_4k, (uint32_t *)SYNC_FLAGS_TABLE_L2_BASE_4k, Page_4k_Device_RW);
|
||||
|
||||
/* Set location of level 1 page table
|
||||
; 31:14 - Translation table base addr (31:14-TTBCR.N, TTBCR.N is 0 out of reset)
|
||||
; 13:7 - 0x0
|
||||
; 6 - IRGN[0] 0x1 (Inner WB WA)
|
||||
; 5 - NOS 0x0 (Non-shared)
|
||||
; 4:3 - RGN 0x01 (Outer WB WA)
|
||||
; 2 - IMP 0x0 (Implementation Defined)
|
||||
; 1 - S 0x0 (Non-shared)
|
||||
; 0 - IRGN[1] 0x0 (Inner WB WA) */
|
||||
__set_TTBR0(__TTB_BASE | 0x48);
|
||||
__ISB();
|
||||
|
||||
/* Set up domain access control register
|
||||
; We set domain 0 to Client and all other domains to No Access.
|
||||
; All translation table entries specify domain 0 */
|
||||
__set_DACR(1);
|
||||
__ISB();
|
||||
}
|
@ -1,148 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA9.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A9 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2021
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <ARMCA9.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define USR_MODE 0x10 // User mode
|
||||
#define FIQ_MODE 0x11 // Fast Interrupt Request mode
|
||||
#define IRQ_MODE 0x12 // Interrupt Request mode
|
||||
#define SVC_MODE 0x13 // Supervisor mode
|
||||
#define ABT_MODE 0x17 // Abort mode
|
||||
#define UND_MODE 0x1B // Undefined Instruction mode
|
||||
#define SYS_MODE 0x1F // System mode
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors (void) __attribute__ ((naked, section("RESET")));
|
||||
void Reset_Handler (void) __attribute__ ((naked));
|
||||
void Default_Handler(void) __attribute__ ((noreturn));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Undef_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void DAbt_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void IRQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void FIQ_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Vectors(void) {
|
||||
__ASM volatile(
|
||||
"LDR PC, =Reset_Handler \n"
|
||||
"LDR PC, =Undef_Handler \n"
|
||||
"LDR PC, =SVC_Handler \n"
|
||||
"LDR PC, =PAbt_Handler \n"
|
||||
"LDR PC, =DAbt_Handler \n"
|
||||
"NOP \n"
|
||||
"LDR PC, =IRQ_Handler \n"
|
||||
"LDR PC, =FIQ_Handler \n"
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Reset_Handler(void) {
|
||||
__ASM volatile(
|
||||
|
||||
// Mask interrupts
|
||||
"CPSID if \n"
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
"MRC p15, 0, R0, c0, c0, 5 \n" // Read MPIDR
|
||||
"ANDS R0, R0, #3 \n"
|
||||
"goToSleep: \n"
|
||||
"WFINE \n"
|
||||
"BNE goToSleep \n"
|
||||
|
||||
// Reset SCTLR Settings
|
||||
"MRC p15, 0, R0, c1, c0, 0 \n" // Read CP15 System Control register
|
||||
"BIC R0, R0, #(0x1 << 12) \n" // Clear I bit 12 to disable I Cache
|
||||
"BIC R0, R0, #(0x1 << 2) \n" // Clear C bit 2 to disable D Cache
|
||||
"BIC R0, R0, #0x1 \n" // Clear M bit 0 to disable MMU
|
||||
"BIC R0, R0, #(0x1 << 11) \n" // Clear Z bit 11 to disable branch prediction
|
||||
"BIC R0, R0, #(0x1 << 13) \n" // Clear V bit 13 to disable hivecs
|
||||
"MCR p15, 0, R0, c1, c0, 0 \n" // Write value back to CP15 System Control register
|
||||
"ISB \n"
|
||||
|
||||
// Configure ACTLR
|
||||
"MRC p15, 0, r0, c1, c0, 1 \n" // Read CP15 Auxiliary Control Register
|
||||
"ORR r0, r0, #(1 << 1) \n" // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
"MCR p15, 0, r0, c1, c0, 1 \n" // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
"LDR R0, =Vectors \n"
|
||||
"MCR p15, 0, R0, c12, c0, 0 \n"
|
||||
|
||||
// Setup Stack for each exceptional mode
|
||||
"CPS #0x11 \n"
|
||||
"LDR SP, =Image$$FIQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x12 \n"
|
||||
"LDR SP, =Image$$IRQ_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x13 \n"
|
||||
"LDR SP, =Image$$SVC_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x17 \n"
|
||||
"LDR SP, =Image$$ABT_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1B \n"
|
||||
"LDR SP, =Image$$UND_STACK$$ZI$$Limit \n"
|
||||
"CPS #0x1F \n"
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||
"LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit \n"
|
||||
#elif defined ( __GNUC__ )
|
||||
"LDR SP, =Image$$SYS_STACK$$ZI$$Limit \n"
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
|
||||
// Call SystemInit
|
||||
"BL SystemInit \n"
|
||||
|
||||
// Unmask interrupts
|
||||
"CPSIE if \n"
|
||||
|
||||
// Call __main
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||
"BL __main \n"
|
||||
#elif defined ( __GNUC__ )
|
||||
"BL _start \n"
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void) {
|
||||
while(1);
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA9.s
|
||||
* @brief CMSIS Device System Source File for ARM Cortex-A9 Device Series
|
||||
* @version V1.00
|
||||
* @date 01 Nov 2017
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MODULE ?startup_ARMCA9
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
PUBLIC Reset_Handler
|
||||
PUBWEAK Undef_Handler
|
||||
PUBWEAK SVC_Handler
|
||||
PUBWEAK PAbt_Handler
|
||||
PUBWEAK DAbt_Handler
|
||||
PUBWEAK IRQ_Handler
|
||||
PUBWEAK FIQ_Handler
|
||||
|
||||
SECTION SVC_STACK:DATA:NOROOT(3)
|
||||
SECTION IRQ_STACK:DATA:NOROOT(3)
|
||||
SECTION FIQ_STACK:DATA:NOROOT(3)
|
||||
SECTION ABT_STACK:DATA:NOROOT(3)
|
||||
SECTION UND_STACK:DATA:NOROOT(3)
|
||||
SECTION USR_STACK:DATA:NOROOT(3)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
section RESET:CODE:NOROOT(2)
|
||||
PUBLIC Vectors
|
||||
|
||||
Vectors:
|
||||
LDR PC, =Reset_Handler
|
||||
LDR PC, =Undef_Handler
|
||||
LDR PC, =SVC_Handler
|
||||
LDR PC, =PAbt_Handler
|
||||
LDR PC, =DAbt_Handler
|
||||
NOP
|
||||
LDR PC, =IRQ_Handler
|
||||
LDR PC, =FIQ_Handler
|
||||
|
||||
|
||||
section .text:CODE:NOROOT(2)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_program_start
|
||||
|
||||
Reset_Handler:
|
||||
|
||||
// Mask interrupts
|
||||
CPSID if
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
MRC p15, 0, R0, c0, c0, 5
|
||||
ANDS R0, R0, #3
|
||||
goToSleep:
|
||||
WFINE
|
||||
BNE goToSleep
|
||||
|
||||
// Reset SCTLR Settings
|
||||
MRC p15, 0, R0, c1, c0, 0 // Read CP15 System Control register
|
||||
BIC R0, R0, #(0x1 << 12) // Clear I bit 12 to disable I Cache
|
||||
BIC R0, R0, #(0x1 << 2) // Clear C bit 2 to disable D Cache
|
||||
BIC R0, R0, #0x1 // Clear M bit 0 to disable MMU
|
||||
BIC R0, R0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction
|
||||
BIC R0, R0, #(0x1 << 13) // Clear V bit 13 to disable hivecs
|
||||
MCR p15, 0, R0, c1, c0, 0 // Write value back to CP15 System Control register
|
||||
ISB
|
||||
|
||||
// Configure ACTLR
|
||||
MRC p15, 0, r0, c1, c0, 1 // Read CP15 Auxiliary Control Register
|
||||
ORR r0, r0, #(1 << 1) // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
MCR p15, 0, r0, c1, c0, 1 // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
LDR R0, =Vectors
|
||||
MCR p15, 0, R0, c12, c0, 0
|
||||
|
||||
// Setup Stack for each exception mode
|
||||
CPS #0x11
|
||||
LDR SP, =SFE(FIQ_STACK)
|
||||
CPS #0x12
|
||||
LDR SP, =SFE(IRQ_STACK)
|
||||
CPS #0x13
|
||||
LDR SP, =SFE(SVC_STACK)
|
||||
CPS #0x17
|
||||
LDR SP, =SFE(ABT_STACK)
|
||||
CPS #0x1B
|
||||
LDR SP, =SFE(UND_STACK)
|
||||
CPS #0x1F
|
||||
LDR SP, =SFE(USR_STACK)
|
||||
|
||||
// Call SystemInit
|
||||
BL SystemInit
|
||||
|
||||
// Unmask interrupts
|
||||
CPSIE if
|
||||
|
||||
// Call __iar_program_start
|
||||
BL __iar_program_start
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
Undef_Handler:
|
||||
SVC_Handler:
|
||||
PAbt_Handler:
|
||||
DAbt_Handler:
|
||||
IRQ_Handler:
|
||||
FIQ_Handler:
|
||||
Default_Handler:
|
||||
B .
|
||||
|
||||
END
|
@ -1,140 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCA9.s
|
||||
* @brief CMSIS Device System Source File for ARM Cortex-A9 Device Series
|
||||
* @version V1.00
|
||||
* @date 01 Nov 2017
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MODULE ?startup_ARMCA9
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
PUBLIC Reset_Handler
|
||||
PUBWEAK Undef_Handler
|
||||
PUBWEAK SVC_Handler
|
||||
PUBWEAK PAbt_Handler
|
||||
PUBWEAK DAbt_Handler
|
||||
PUBWEAK IRQ_Handler
|
||||
PUBWEAK FIQ_Handler
|
||||
|
||||
SECTION SVC_STACK:DATA:NOROOT(3)
|
||||
SECTION IRQ_STACK:DATA:NOROOT(3)
|
||||
SECTION FIQ_STACK:DATA:NOROOT(3)
|
||||
SECTION ABT_STACK:DATA:NOROOT(3)
|
||||
SECTION UND_STACK:DATA:NOROOT(3)
|
||||
SECTION USR_STACK:DATA:NOROOT(3)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector Table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
section RESET:CODE:NOROOT(2)
|
||||
PUBLIC Vectors
|
||||
|
||||
Vectors:
|
||||
LDR PC, =Reset_Handler
|
||||
LDR PC, =Undef_Handler
|
||||
LDR PC, =SVC_Handler
|
||||
LDR PC, =PAbt_Handler
|
||||
LDR PC, =DAbt_Handler
|
||||
NOP
|
||||
LDR PC, =IRQ_Handler
|
||||
LDR PC, =FIQ_Handler
|
||||
|
||||
|
||||
section .text:CODE:NOROOT(2)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_program_start
|
||||
|
||||
Reset_Handler:
|
||||
|
||||
// Mask interrupts
|
||||
CPSID if
|
||||
|
||||
// Put any cores other than 0 to sleep
|
||||
MRC p15, 0, R0, c0, c0, 5
|
||||
ANDS R0, R0, #3
|
||||
goToSleep:
|
||||
WFINE
|
||||
BNE goToSleep
|
||||
|
||||
// Reset SCTLR Settings
|
||||
MRC p15, 0, R0, c1, c0, 0 // Read CP15 System Control register
|
||||
BIC R0, R0, #(0x1 << 12) // Clear I bit 12 to disable I Cache
|
||||
BIC R0, R0, #(0x1 << 2) // Clear C bit 2 to disable D Cache
|
||||
BIC R0, R0, #0x1 // Clear M bit 0 to disable MMU
|
||||
BIC R0, R0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction
|
||||
BIC R0, R0, #(0x1 << 13) // Clear V bit 13 to disable hivecs
|
||||
MCR p15, 0, R0, c1, c0, 0 // Write value back to CP15 System Control register
|
||||
ISB
|
||||
|
||||
// Configure ACTLR
|
||||
MRC p15, 0, r0, c1, c0, 1 // Read CP15 Auxiliary Control Register
|
||||
ORR r0, r0, #(1 << 1) // Enable L2 prefetch hint (UNK/WI since r4p1)
|
||||
MCR p15, 0, r0, c1, c0, 1 // Write CP15 Auxiliary Control Register
|
||||
|
||||
// Set Vector Base Address Register (VBAR) to point to this application's vector table
|
||||
LDR R0, =Vectors
|
||||
MCR p15, 0, R0, c12, c0, 0
|
||||
|
||||
// Setup Stack for each exception mode
|
||||
CPS #0x11
|
||||
LDR SP, =SFE(FIQ_STACK)
|
||||
CPS #0x12
|
||||
LDR SP, =SFE(IRQ_STACK)
|
||||
CPS #0x13
|
||||
LDR SP, =SFE(SVC_STACK)
|
||||
CPS #0x17
|
||||
LDR SP, =SFE(ABT_STACK)
|
||||
CPS #0x1B
|
||||
LDR SP, =SFE(UND_STACK)
|
||||
CPS #0x1F
|
||||
LDR SP, =SFE(USR_STACK)
|
||||
|
||||
// Call SystemInit
|
||||
BL SystemInit
|
||||
|
||||
// Unmask interrupts
|
||||
CPSIE if
|
||||
|
||||
// Call __iar_program_start
|
||||
BL __iar_program_start
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
Undef_Handler:
|
||||
SVC_Handler:
|
||||
PAbt_Handler:
|
||||
DAbt_Handler:
|
||||
IRQ_Handler:
|
||||
FIQ_Handler:
|
||||
Default_Handler:
|
||||
B .
|
||||
|
||||
END
|
@ -1,93 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA9.c
|
||||
* @brief CMSIS Device System Source File for Arm Cortex-A9 Device Series
|
||||
* @version V1.0.1
|
||||
* @date 13. February 2019
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RTE_Components.h"
|
||||
#include CMSIS_device_header
|
||||
#include "irq_ctrl.h"
|
||||
|
||||
#define SYSTEM_CLOCK 12000000U
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Initialization
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
/* do not use global variables because this function is called before
|
||||
reaching pre-main. RW section may be overwritten afterwards. */
|
||||
|
||||
// Invalidate entire Unified TLB
|
||||
__set_TLBIALL(0);
|
||||
|
||||
// Invalidate entire branch predictor array
|
||||
__set_BPIALL(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate instruction cache and flush branch target cache
|
||||
__set_ICIALLU(0);
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Invalidate data cache
|
||||
L1C_InvalidateDCacheAll();
|
||||
|
||||
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
|
||||
// Enable FPU
|
||||
__FPU_Enable();
|
||||
#endif
|
||||
|
||||
// Create Translation Table
|
||||
MMU_CreateTranslationTable();
|
||||
|
||||
// Enable MMU
|
||||
MMU_Enable();
|
||||
|
||||
// Enable Caches
|
||||
L1C_EnableCaches();
|
||||
L1C_EnableBTAC();
|
||||
|
||||
#if (__L2C_PRESENT == 1)
|
||||
// Enable GIC
|
||||
L2C_Enable();
|
||||
#endif
|
||||
|
||||
// IRQ Initialize
|
||||
IRQ_Initialize();
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA9.h
|
||||
* @brief CMSIS Device System Header File for Arm Cortex-A9 Device Series
|
||||
* @version V1.00
|
||||
* @date 10. January 2018
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEM_ARMCA9_H
|
||||
#define __SYSTEM_ARMCA9_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
/**
|
||||
\brief Setup the microcontroller system.
|
||||
|
||||
Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
|
||||
/**
|
||||
\brief Update SystemCoreClock variable.
|
||||
|
||||
Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
/**
|
||||
\brief Create Translation Table.
|
||||
|
||||
Creates Memory Management Unit Translation Table.
|
||||
*/
|
||||
extern void MMU_CreateTranslationTable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_ARMCA9_H */
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file system_ARMCA9.h
|
||||
* @brief CMSIS Device System Header File for Arm Cortex-A9 Device Series
|
||||
* @version V1.00
|
||||
* @date 10. January 2018
|
||||
*
|
||||
* @note
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEM_ARMCA9_H
|
||||
#define __SYSTEM_ARMCA9_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
/**
|
||||
\brief Setup the microcontroller system.
|
||||
|
||||
Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
|
||||
/**
|
||||
\brief Update SystemCoreClock variable.
|
||||
|
||||
Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
/**
|
||||
\brief Create Translation Table.
|
||||
|
||||
Creates Memory Management Unit Translation Table.
|
||||
*/
|
||||
extern void MMU_CreateTranslationTable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_ARMCA9_H */
|
@ -1,23 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup
|
||||
- component: Device:IRQ Controller:GIC
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,21 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#----------------------------------------------------------------------------------------------
|
||||
motherboard.vis.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
cluster.cpu0.vfp-present=1 # (bool , init-time) default = '1' : Set whether the model has VFP support
|
||||
cluster.cpu0.ase-present=0 # (bool , init-time) default = '1' : Set whether model has NEON support
|
||||
cluster.cpu0.semihosting-enable=1 # (bool , init-time) default = '1' : Enable semihosting SVC traps. Applications that do not use semihosting must set this parameter to false
|
||||
cluster.cpu0.semihosting-hlt-enable=0 # (bool , init-time) default = '0' : Enable semihosting HLT traps. Applications that use HLT semihosting must set this parameter to true and the semihosting-enable parameter to true
|
||||
cluster.cpu0.semihosting-ARM_SVC=0x123456 # (int , init-time) default = '0x123456' : ARM SVC number for semihosting : [0x0..0xFFFFFF]
|
||||
cluster.cpu0.semihosting-Thumb_SVC=0xAB # (int , init-time) default = '0xAB' : Thumb SVC number for semihosting : [0x0..0xFF]
|
||||
cluster.cpu0.semihosting-ARM_HLT=0xF000 # (int , init-time) default = '0xF000' : ARM HLT number for semihosting : [0x0..0xFFFF]
|
||||
cluster.cpu0.semihosting-Thumb_HLT=0x3C # (int , init-time) default = '0x3C' : Thumb HLT number for semihosting : [0x0..0x3F]
|
||||
cluster.cpu0.semihosting-cmd_line="" # (string, init-time) default = '' : Command line available to semihosting SVC calls
|
||||
cluster.cpu0.semihosting-heap_base=0x0 # (int , init-time) default = '0x0' : Virtual address of heap base : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-heap_limit=0x0 # (int , init-time) default = '0xFF000000' : Virtual address of top of heap : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-stack_base=0x0 # (int , init-time) default = '0xFFFF0000' : Virtual address of base of descending stack : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-stack_limit=0x0 # (int , init-time) default = '0xFF000000' : Virtual address of stack limit : [0x0..0xFFFFFFFF]
|
||||
cluster.cpu0.semihosting-cwd="" # (string, init-time) default = '' : Base directory for semihosting file access.
|
||||
cluster.dcache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether D-cache has stateful implementation
|
||||
cluster.icache-state_modelled=1 # (bool , run-time ) default = '0' : Set whether I-cache has stateful implementation
|
||||
#----------------------------------------------------------------------------------------------
|
@ -1,80 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
|
||||
/*
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*--------------------- Flash Configuration ----------------------------------
|
||||
; <h> Flash Configuration
|
||||
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x00000000
|
||||
#define __ROM_SIZE 0x00080000
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ---------------------------
|
||||
; <h> RAM Configuration
|
||||
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x20000000
|
||||
#define __RAM_SIZE 0x00040000
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ---------------------------
|
||||
; <h> Stack / Heap Configuration
|
||||
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_SIZE 0x00000200
|
||||
#define __HEAP_SIZE 0x00000C00
|
||||
|
||||
/*
|
||||
;------------- <<< end of configuration section >>> ---------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap boundary definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) /* starts at end of RAM */
|
||||
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Scatter File Definitions definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RO_BASE __ROM_BASE
|
||||
#define __RO_SIZE __ROM_SIZE
|
||||
|
||||
#define __RW_BASE __RAM_BASE
|
||||
#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
|
||||
|
||||
|
||||
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
|
||||
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
|
||||
*(.bss.noinit)
|
||||
}
|
||||
|
||||
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
|
||||
*(+RW +ZI)
|
||||
}
|
||||
|
||||
#if __HEAP_SIZE > 0
|
||||
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
|
||||
}
|
||||
#endif
|
||||
|
||||
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
|
||||
}
|
||||
}
|
@ -1,296 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file gcc_arm.ld
|
||||
* @brief GNU Linker Script for Cortex-M based device
|
||||
* @version V2.1.0
|
||||
* @date 04. August 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*---------------------- Flash Configuration ----------------------------------
|
||||
<h> Flash Configuration
|
||||
<o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__ROM_BASE = 0x00000000;
|
||||
__ROM_SIZE = 0x00040000;
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ----------------------------
|
||||
<h> RAM Configuration
|
||||
<o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__RAM_BASE = 0x20000000;
|
||||
__RAM_SIZE = 0x00020000;
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ----------------------------
|
||||
<h> Stack / Heap Configuration
|
||||
<o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
<o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__STACK_SIZE = 0x00000400;
|
||||
__HEAP_SIZE = 0x00000C00;
|
||||
|
||||
/*
|
||||
*-------------------- <<< end of configuration section >>> -------------------
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
/*
|
||||
* SG veneers:
|
||||
* All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
|
||||
* must be set, either with the command line option ‘--section-start’ or in a linker script,
|
||||
* to indicate where to place these veneers in memory.
|
||||
*/
|
||||
/*
|
||||
.gnu.sgstubs :
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > FLASH
|
||||
*/
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG ((__data_end__ - __data_start__) / 4)
|
||||
|
||||
/* Add each additional data section here */
|
||||
/*
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG ((__data2_end__ - __data2_start__) / 4)
|
||||
*/
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
/* Add each additional bss section here */
|
||||
/*
|
||||
LONG (__bss2_start__)
|
||||
LONG ((__bss2_end__ - __bss2_start__) / 4)
|
||||
*/
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
/**
|
||||
* Location counter can end up 2byte aligned with narrow Thumb code but
|
||||
* __etext is assumed by startup code to be the LMA of a section in RAM
|
||||
* which must be 4byte aligned
|
||||
*/
|
||||
__etext = ALIGN (4);
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
/*
|
||||
* Secondary data section, optional
|
||||
*
|
||||
* Remember to add each additional data section
|
||||
* to the .copy.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
__etext2 = ALIGN (4);
|
||||
|
||||
.data2 : AT (__etext2)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__data2_start__ = .;
|
||||
*(.data2)
|
||||
*(.data2.*)
|
||||
. = ALIGN(4);
|
||||
__data2_end__ = .;
|
||||
|
||||
} > RAM2
|
||||
*/
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM AT > RAM
|
||||
|
||||
/*
|
||||
* Secondary bss section, optional
|
||||
*
|
||||
* Remember to add each additional bss section
|
||||
* to the .zero.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
.bss2 :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss2_start__ = .;
|
||||
*(.bss2)
|
||||
*(.bss2.*)
|
||||
. = ALIGN(4);
|
||||
__bss2_end__ = .;
|
||||
} > RAM2 AT > RAM2
|
||||
*/
|
||||
|
||||
.heap (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
. = . + __HEAP_SIZE;
|
||||
. = ALIGN(8);
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
.stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackLimit = .;
|
||||
. = . + __STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
__StackTop = .;
|
||||
} > RAM
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
@ -1,146 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM0.c
|
||||
* @brief CMSIS-Core(M) Device Startup File for a Cortex-M0 Device
|
||||
* @version V2.0.3
|
||||
* @date 31. March 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM0)
|
||||
#include "ARMCM0.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[48];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[48] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10..31 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,146 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM0.c
|
||||
* @brief CMSIS-Core(M) Device Startup File for a Cortex-M0 Device
|
||||
* @version V2.0.3
|
||||
* @date 31. March 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM0)
|
||||
#include "ARMCM0.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[48];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[48] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10..31 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,56 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_ARMCM0.c
|
||||
* @brief CMSIS Device System Source File for
|
||||
* ARMCM0 Device
|
||||
* @version V1.0.0
|
||||
* @date 09. July 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ARMCM0.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define XTAL (50000000UL) /* Oscillator frequency */
|
||||
|
||||
#define SYSTEM_CLOCK (XTAL / 2U)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System initialization function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/****************************************************************************/
|
||||
/* tiac_arm.cmd - COMMAND FILE FOR LINKING ARM C PROGRAMS */
|
||||
/* */
|
||||
/* Description: This file is a sample command file that can be used */
|
||||
/* for linking programs built with the TI Arm Clang */
|
||||
/* Compiler. Use it as a guideline; you may want to change */
|
||||
/* the allocation scheme according to the size of your */
|
||||
/* program and the memory layout of your target system. */
|
||||
/* */
|
||||
/****************************************************************************/
|
||||
-c /* LINK USING C CONVENTIONS */
|
||||
-stack 0x4000 /* SOFTWARE STACK SIZE */
|
||||
-heap 0x4000 /* HEAP AREA SIZE */
|
||||
--args 0x1000
|
||||
|
||||
/* SPECIFY THE SYSTEM MEMORY MAP */
|
||||
MEMORY
|
||||
{
|
||||
V_MEM : org = 0x00000000 len = 0x00001000 /* INT VECTOR */
|
||||
P_MEM : org = 0x00001000 len = 0x20000000 /* PROGRAM MEMORY (ROM) */
|
||||
D_MEM : org = 0x20001000 len = 0x20000000 /* DATA MEMORY (RAM) */
|
||||
}
|
||||
|
||||
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs : {} > 0x0 /* INTERRUPT VECTORS */
|
||||
.bss : {} > D_MEM /* GLOBAL & STATIC VARS */
|
||||
.data : {} > D_MEM
|
||||
.sysmem : {} > D_MEM /* DYNAMIC MEMORY ALLOCATION AREA */
|
||||
.stack : {} > D_MEM /* SOFTWARE SYSTEM STACK */
|
||||
|
||||
.text : {} > P_MEM /* CODE */
|
||||
.cinit : {} > P_MEM /* INITIALIZATION TABLES */
|
||||
.const : {} > P_MEM /* CONSTANT DATA */
|
||||
.rodata : {} > P_MEM, palign(4)
|
||||
.init_array : {} > P_MEM /* C++ CONSTRUCTOR TABLES */
|
||||
|
||||
|
||||
.TI.ramfunc : {} load=P_MEM, run=D_MEM, table(BINIT)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup&C Startup
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,8 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#------------------------------------------------------------------------------
|
||||
fvp_mps2.UART0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout)
|
||||
fvp_mps2.UART0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available)
|
||||
fvp_mps2.UART0.unbuffered_output=1 # (bool , init-time) default = '0' : Unbuffered output
|
||||
fvp_mps2.mps2_visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
#------------------------------------------------------------------------------
|
@ -1,80 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0+ -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
|
||||
/*
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*--------------------- Flash Configuration ----------------------------------
|
||||
; <h> Flash Configuration
|
||||
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x00000000
|
||||
#define __ROM_SIZE 0x00080000
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ---------------------------
|
||||
; <h> RAM Configuration
|
||||
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x20000000
|
||||
#define __RAM_SIZE 0x00040000
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ---------------------------
|
||||
; <h> Stack / Heap Configuration
|
||||
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_SIZE 0x00000200
|
||||
#define __HEAP_SIZE 0x00000C00
|
||||
|
||||
/*
|
||||
;------------- <<< end of configuration section >>> ---------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap boundary definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) /* starts at end of RAM */
|
||||
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Scatter File Definitions definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RO_BASE __ROM_BASE
|
||||
#define __RO_SIZE __ROM_SIZE
|
||||
|
||||
#define __RW_BASE __RAM_BASE
|
||||
#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
|
||||
|
||||
|
||||
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
|
||||
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
|
||||
*(.bss.noinit)
|
||||
}
|
||||
|
||||
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
|
||||
*(+RW +ZI)
|
||||
}
|
||||
|
||||
#if __HEAP_SIZE > 0
|
||||
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
|
||||
}
|
||||
#endif
|
||||
|
||||
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
|
||||
}
|
||||
}
|
@ -1,296 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file gcc_arm.ld
|
||||
* @brief GNU Linker Script for Cortex-M based device
|
||||
* @version V2.1.0
|
||||
* @date 04. August 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*---------------------- Flash Configuration ----------------------------------
|
||||
<h> Flash Configuration
|
||||
<o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__ROM_BASE = 0x00000000;
|
||||
__ROM_SIZE = 0x00040000;
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ----------------------------
|
||||
<h> RAM Configuration
|
||||
<o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__RAM_BASE = 0x20000000;
|
||||
__RAM_SIZE = 0x00020000;
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ----------------------------
|
||||
<h> Stack / Heap Configuration
|
||||
<o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
<o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__STACK_SIZE = 0x00000400;
|
||||
__HEAP_SIZE = 0x00000C00;
|
||||
|
||||
/*
|
||||
*-------------------- <<< end of configuration section >>> -------------------
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
/*
|
||||
* SG veneers:
|
||||
* All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
|
||||
* must be set, either with the command line option ‘--section-start’ or in a linker script,
|
||||
* to indicate where to place these veneers in memory.
|
||||
*/
|
||||
/*
|
||||
.gnu.sgstubs :
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > FLASH
|
||||
*/
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG ((__data_end__ - __data_start__) / 4)
|
||||
|
||||
/* Add each additional data section here */
|
||||
/*
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG ((__data2_end__ - __data2_start__) / 4)
|
||||
*/
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
/* Add each additional bss section here */
|
||||
/*
|
||||
LONG (__bss2_start__)
|
||||
LONG ((__bss2_end__ - __bss2_start__) / 4)
|
||||
*/
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
/**
|
||||
* Location counter can end up 2byte aligned with narrow Thumb code but
|
||||
* __etext is assumed by startup code to be the LMA of a section in RAM
|
||||
* which must be 4byte aligned
|
||||
*/
|
||||
__etext = ALIGN (4);
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
/*
|
||||
* Secondary data section, optional
|
||||
*
|
||||
* Remember to add each additional data section
|
||||
* to the .copy.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
__etext2 = ALIGN (4);
|
||||
|
||||
.data2 : AT (__etext2)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__data2_start__ = .;
|
||||
*(.data2)
|
||||
*(.data2.*)
|
||||
. = ALIGN(4);
|
||||
__data2_end__ = .;
|
||||
|
||||
} > RAM2
|
||||
*/
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM AT > RAM
|
||||
|
||||
/*
|
||||
* Secondary bss section, optional
|
||||
*
|
||||
* Remember to add each additional bss section
|
||||
* to the .zero.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
.bss2 :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss2_start__ = .;
|
||||
*(.bss2)
|
||||
*(.bss2.*)
|
||||
. = ALIGN(4);
|
||||
__bss2_end__ = .;
|
||||
} > RAM2 AT > RAM2
|
||||
*/
|
||||
|
||||
.heap (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
. = . + __HEAP_SIZE;
|
||||
. = ALIGN(8);
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
.stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackLimit = .;
|
||||
. = . + __STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
__StackTop = .;
|
||||
} > RAM
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
@ -1,148 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM0plus.c
|
||||
* @brief CMSIS-Core(M) Device Startup File for a Cortex-M0+ Device
|
||||
* @version V2.0.3
|
||||
* @date 31. March 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM0P)
|
||||
#include "ARMCM0plus.h"
|
||||
#elif defined (ARMCM0P_MPU)
|
||||
#include "ARMCM0plus_MPU.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[48];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[48] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10..31 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,148 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM0plus.c
|
||||
* @brief CMSIS-Core(M) Device Startup File for a Cortex-M0+ Device
|
||||
* @version V2.0.3
|
||||
* @date 31. March 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM0P)
|
||||
#include "ARMCM0plus.h"
|
||||
#elif defined (ARMCM0P_MPU)
|
||||
#include "ARMCM0plus_MPU.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[48];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[48] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10..31 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,65 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_ARMCM0plus.c
|
||||
* @brief CMSIS Device System Source File for
|
||||
* ARMCM0plus Device
|
||||
* @version V1.0.1
|
||||
* @date 05. September 2022
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2022 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ARMCM0plus.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define XTAL (50000000UL) /* Oscillator frequency */
|
||||
|
||||
#define SYSTEM_CLOCK (XTAL / 2U)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[48];
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System initialization function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
|
||||
#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
|
||||
SCB->VTOR = (uint32_t) &(__VECTOR_TABLE[0]);
|
||||
#endif
|
||||
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/****************************************************************************/
|
||||
/* tiac_arm.cmd - COMMAND FILE FOR LINKING ARM C PROGRAMS */
|
||||
/* */
|
||||
/* Description: This file is a sample command file that can be used */
|
||||
/* for linking programs built with the TI Arm Clang */
|
||||
/* Compiler. Use it as a guideline; you may want to change */
|
||||
/* the allocation scheme according to the size of your */
|
||||
/* program and the memory layout of your target system. */
|
||||
/* */
|
||||
/****************************************************************************/
|
||||
-c /* LINK USING C CONVENTIONS */
|
||||
-stack 0x4000 /* SOFTWARE STACK SIZE */
|
||||
-heap 0x4000 /* HEAP AREA SIZE */
|
||||
--args 0x1000
|
||||
|
||||
/* SPECIFY THE SYSTEM MEMORY MAP */
|
||||
MEMORY
|
||||
{
|
||||
V_MEM : org = 0x00000000 len = 0x00001000 /* INT VECTOR */
|
||||
P_MEM : org = 0x00001000 len = 0x20000000 /* PROGRAM MEMORY (ROM) */
|
||||
D_MEM : org = 0x20001000 len = 0x20000000 /* DATA MEMORY (RAM) */
|
||||
}
|
||||
|
||||
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs : {} > 0x0 /* INTERRUPT VECTORS */
|
||||
.bss : {} > D_MEM /* GLOBAL & STATIC VARS */
|
||||
.data : {} > D_MEM
|
||||
.sysmem : {} > D_MEM /* DYNAMIC MEMORY ALLOCATION AREA */
|
||||
.stack : {} > D_MEM /* SOFTWARE SYSTEM STACK */
|
||||
|
||||
.text : {} > P_MEM /* CODE */
|
||||
.cinit : {} > P_MEM /* INITIALIZATION TABLES */
|
||||
.const : {} > P_MEM /* CONSTANT DATA */
|
||||
.rodata : {} > P_MEM, palign(4)
|
||||
.init_array : {} > P_MEM /* C++ CONSTRUCTOR TABLES */
|
||||
|
||||
|
||||
.TI.ramfunc : {} load=P_MEM, run=D_MEM, table(BINIT)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup&C Startup
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,8 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#------------------------------------------------------------------------------
|
||||
fvp_mps2.UART0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout)
|
||||
fvp_mps2.UART0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available)
|
||||
fvp_mps2.UART0.unbuffered_output=1 # (bool , init-time) default = '0' : Unbuffered output
|
||||
fvp_mps2.mps2_visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
#------------------------------------------------------------------------------
|
@ -1,123 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
|
||||
;Note: Add '-mcmse' to first line if your software model is "Secure Mode".
|
||||
; #! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc -mcmse
|
||||
|
||||
|
||||
/*
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*--------------------- Flash Configuration ----------------------------------
|
||||
; <h> Flash Configuration
|
||||
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x00000000
|
||||
#define __ROM_SIZE 0x00080000
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ---------------------------
|
||||
; <h> RAM Configuration
|
||||
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x20000000
|
||||
#define __RAM_SIZE 0x00040000
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ---------------------------
|
||||
; <h> Stack / Heap Configuration
|
||||
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_SIZE 0x00000200
|
||||
#define __HEAP_SIZE 0x00000C00
|
||||
|
||||
/*--------------------- CMSE Veneer Configuration ---------------------------
|
||||
; <h> CMSE Veneer Configuration
|
||||
; <o0> CMSE Veneer Size (in Bytes) <0x0-0xFFFFFFFF:32>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __CMSEVENEER_SIZE 0x200
|
||||
|
||||
/*
|
||||
;------------- <<< end of configuration section >>> ---------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap boundary definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE - __STACKSEAL_SIZE) /* starts at end of RAM - 8 byte stack seal */
|
||||
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Stack seal size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __STACKSEAL_SIZE ( 8 )
|
||||
#else
|
||||
#define __STACKSEAL_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Region base & size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __CV_BASE ( __ROM_BASE + __ROM_SIZE - __CMSEVENEER_SIZE )
|
||||
#define __CV_SIZE ( __CMSEVENEER_SIZE )
|
||||
#else
|
||||
#define __CV_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
#define __RO_BASE ( __ROM_BASE )
|
||||
#define __RO_SIZE ( __ROM_SIZE - __CV_SIZE )
|
||||
|
||||
#define __RW_BASE ( __RAM_BASE )
|
||||
#define __RW_SIZE ( __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE - __STACKSEAL_SIZE)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Scatter Region definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
|
||||
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
|
||||
*(.bss.noinit)
|
||||
}
|
||||
|
||||
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
|
||||
*(+RW +ZI)
|
||||
}
|
||||
|
||||
#if __HEAP_SIZE > 0
|
||||
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
|
||||
}
|
||||
#endif
|
||||
|
||||
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
STACKSEAL +0 EMPTY __STACKSEAL_SIZE { ; Reserve empty region for stack seal immediately after stack
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
LR_CMSE_VENEER __CV_BASE ALIGN 32 __CV_SIZE { ; own load/execution region for CMSE Veneers
|
||||
ER_CMSE_VENEER __CV_BASE __CV_SIZE {
|
||||
*(Veneer$$CMSE)
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,316 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file gcc_arm.ld
|
||||
* @brief GNU Linker Script for Cortex-M based device
|
||||
* @version V2.2.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*---------------------- Flash Configuration ----------------------------------
|
||||
<h> Flash Configuration
|
||||
<o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__ROM_BASE = 0x00000000;
|
||||
__ROM_SIZE = 0x00200000;
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ----------------------------
|
||||
<h> RAM Configuration
|
||||
<o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__RAM_BASE = 0x20000000;
|
||||
__RAM_SIZE = 0x00200000;
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ----------------------------
|
||||
<h> Stack / Heap Configuration
|
||||
<o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
<o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__STACK_SIZE = 0x00000400;
|
||||
__HEAP_SIZE = 0x00000C00;
|
||||
|
||||
/*
|
||||
*-------------------- <<< end of configuration section >>> -------------------
|
||||
*/
|
||||
|
||||
/* ARMv8-M stack sealing:
|
||||
to use ARMv8-M stack sealing set __STACKSEAL_SIZE to 8 otherwise keep 0
|
||||
*/
|
||||
__STACKSEAL_SIZE = 0;
|
||||
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __StackSeal (only if ARMv8-M stack sealing is used)
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
/*
|
||||
* SG veneers:
|
||||
* All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
|
||||
* must be set, either with the command line option --section-start or in a linker script,
|
||||
* to indicate where to place these veneers in memory.
|
||||
*/
|
||||
/*
|
||||
.gnu.sgstubs :
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > FLASH
|
||||
*/
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG ((__data_end__ - __data_start__) / 4)
|
||||
|
||||
/* Add each additional data section here */
|
||||
/*
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG ((__data2_end__ - __data2_start__) / 4)
|
||||
*/
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
/* Add each additional bss section here */
|
||||
/*
|
||||
LONG (__bss2_start__)
|
||||
LONG ((__bss2_end__ - __bss2_start__) / 4)
|
||||
*/
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
/**
|
||||
* Location counter can end up 2byte aligned with narrow Thumb code but
|
||||
* __etext is assumed by startup code to be the LMA of a section in RAM
|
||||
* which must be 4byte aligned
|
||||
*/
|
||||
__etext = ALIGN (4);
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
/*
|
||||
* Secondary data section, optional
|
||||
*
|
||||
* Remember to add each additional data section
|
||||
* to the .copy.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
__etext2 = ALIGN (4);
|
||||
|
||||
.data2 : AT (__etext2)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__data2_start__ = .;
|
||||
*(.data2)
|
||||
*(.data2.*)
|
||||
. = ALIGN(4);
|
||||
__data2_end__ = .;
|
||||
|
||||
} > RAM2
|
||||
*/
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM AT > RAM
|
||||
|
||||
/*
|
||||
* Secondary bss section, optional
|
||||
*
|
||||
* Remember to add each additional bss section
|
||||
* to the .zero.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
.bss2 :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss2_start__ = .;
|
||||
*(.bss2)
|
||||
*(.bss2.*)
|
||||
. = ALIGN(4);
|
||||
__bss2_end__ = .;
|
||||
} > RAM2 AT > RAM2
|
||||
*/
|
||||
|
||||
.heap (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
. = . + __HEAP_SIZE;
|
||||
. = ALIGN(8);
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
.stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE - __STACKSEAL_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackLimit = .;
|
||||
. = . + __STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
__StackTop = .;
|
||||
} > RAM
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* ARMv8-M stack sealing:
|
||||
to use ARMv8-M stack sealing uncomment '.stackseal' section
|
||||
*/
|
||||
/*
|
||||
.stackseal (ORIGIN(RAM) + LENGTH(RAM) - __STACKSEAL_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackSeal = .;
|
||||
. = . + 8;
|
||||
. = ALIGN(8);
|
||||
} > RAM
|
||||
*/
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM23.c
|
||||
* @brief CMSIS-Core Device Startup File for a Cortex-M23 Device
|
||||
* @version V2.1.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
extern uint32_t __STACK_LIMIT;
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
extern uint32_t __STACK_SEAL;
|
||||
#endif
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10 .. 223 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
__set_PSP((uint32_t)(&__INITIAL_SP));
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
__set_MSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
|
||||
__TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
|
||||
#endif
|
||||
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,161 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM23.c
|
||||
* @brief CMSIS-Core Device Startup File for a Cortex-M23 Device
|
||||
* @version V2.1.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
extern uint32_t __STACK_LIMIT;
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
extern uint32_t __STACK_SEAL;
|
||||
#endif
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10 .. 223 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
__set_PSP((uint32_t)(&__INITIAL_SP));
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
__set_MSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
|
||||
__TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
|
||||
#endif
|
||||
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,80 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_ARMCM23.c
|
||||
* @brief CMSIS Device System Source File for
|
||||
* ARMCM23 Device
|
||||
* @version V1.0.1
|
||||
* @date 15. November 2019
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#include "partition_ARMCM23.h"
|
||||
#endif
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define XTAL (50000000UL) /* Oscillator frequency */
|
||||
|
||||
#define SYSTEM_CLOCK (XTAL / 2U)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System initialization function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
|
||||
#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
|
||||
SCB->VTOR = (uint32_t) &(__VECTOR_TABLE[0]);
|
||||
#endif
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
TZ_SAU_Setup();
|
||||
#endif
|
||||
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup&C Startup
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,16 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#----------------------------------------------------------------------------------------------
|
||||
fvp_mps2.mps2_visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
cpu0.semihosting-enable=1 # (bool , init-time) default = '1' : Enable semihosting SVC traps. Applications that do not use semihosting must set this parameter to false.
|
||||
cpu0.semihosting-Thumb_SVC=0xAB # (int , init-time) default = '0xAB' : T32 SVC number for semihosting : [0x0..0xFF]
|
||||
cpu0.semihosting-cmd_line="" # (string, init-time) default = '' : Command line available to semihosting SVC calls
|
||||
cpu0.semihosting-heap_base=0x0 # (int , init-time) default = '0x0' : Virtual address of heap base : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-heap_limit=0x0 # (int , init-time) default = '0x10700000' : Virtual address of top of heap : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-stack_base=0x0 # (int , init-time) default = '0x10700000' : Virtual address of base of descending stack : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-stack_limit=0x0 # (int , init-time) default = '0x10800000' : Virtual address of stack limit : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-cwd="" # (string, init-time) default = '' : Base directory for semihosting file access.
|
||||
idau.NUM_IDAU_REGION=0x0 # (int , init-time) default = '0xA' :
|
||||
cpu0.SECEXT=0 # (bool , init-time) default = '1' : Whether the ARMv8-M Security Extensions are included
|
||||
fvp_mps2.DISABLE_GATING=1 # (bool , init-time) default = '0' : Disable Memory gating logic
|
||||
#----------------------------------------------------------------------------------------------
|
@ -1,123 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
|
||||
;Note: Add '-mcmse' to first line if your software model is "Secure Mode".
|
||||
; #! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc -mcmse
|
||||
|
||||
|
||||
/*
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*--------------------- Flash Configuration ----------------------------------
|
||||
; <h> Flash Configuration
|
||||
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x00200000
|
||||
#define __ROM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ---------------------------
|
||||
; <h> RAM Configuration
|
||||
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x20200000
|
||||
#define __RAM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ---------------------------
|
||||
; <h> Stack / Heap Configuration
|
||||
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_SIZE 0x00000400
|
||||
#define __HEAP_SIZE 0x00000C00
|
||||
|
||||
/*--------------------- CMSE Veneer Configuration ---------------------------
|
||||
; <h> CMSE Veneer Configuration
|
||||
; <o0> CMSE Veneer Size (in Bytes) <0x0-0xFFFFFFFF:32>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __CMSEVENEER_SIZE 0x200
|
||||
|
||||
/*
|
||||
;------------- <<< end of configuration section >>> ---------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap boundary definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE - __STACKSEAL_SIZE) /* starts at end of RAM - 8 byte stack seal */
|
||||
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Stack seal size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __STACKSEAL_SIZE ( 8 )
|
||||
#else
|
||||
#define __STACKSEAL_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Region base & size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __CV_BASE ( __ROM_BASE + __ROM_SIZE - __CMSEVENEER_SIZE )
|
||||
#define __CV_SIZE ( __CMSEVENEER_SIZE )
|
||||
#else
|
||||
#define __CV_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
#define __RO_BASE ( __ROM_BASE )
|
||||
#define __RO_SIZE ( __ROM_SIZE - __CV_SIZE )
|
||||
|
||||
#define __RW_BASE ( __RAM_BASE )
|
||||
#define __RW_SIZE ( __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE - __STACKSEAL_SIZE)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Scatter Region definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
|
||||
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
|
||||
*(.bss.noinit)
|
||||
}
|
||||
|
||||
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
|
||||
*(+RW +ZI)
|
||||
}
|
||||
|
||||
#if __HEAP_SIZE > 0
|
||||
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
|
||||
}
|
||||
#endif
|
||||
|
||||
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
STACKSEAL +0 EMPTY __STACKSEAL_SIZE { ; Reserve empty region for stack seal immediately after stack
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
LR_CMSE_VENEER __CV_BASE ALIGN 32 __CV_SIZE { ; own load/execution region for CMSE Veneers
|
||||
ER_CMSE_VENEER __CV_BASE __CV_SIZE {
|
||||
*(Veneer$$CMSE)
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,316 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file gcc_arm.ld
|
||||
* @brief GNU Linker Script for Cortex-M based device
|
||||
* @version V2.2.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*---------------------- Flash Configuration ----------------------------------
|
||||
<h> Flash Configuration
|
||||
<o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__ROM_BASE = 0x00200000;
|
||||
__ROM_SIZE = 0x00200000;
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ----------------------------
|
||||
<h> RAM Configuration
|
||||
<o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__RAM_BASE = 0x20200000;
|
||||
__RAM_SIZE = 0x00200000;
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ----------------------------
|
||||
<h> Stack / Heap Configuration
|
||||
<o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
<o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__STACK_SIZE = 0x00000400;
|
||||
__HEAP_SIZE = 0x00000C00;
|
||||
|
||||
/*
|
||||
*-------------------- <<< end of configuration section >>> -------------------
|
||||
*/
|
||||
|
||||
/* ARMv8-M stack sealing:
|
||||
to use ARMv8-M stack sealing set __STACKSEAL_SIZE to 8 otherwise keep 0
|
||||
*/
|
||||
__STACKSEAL_SIZE = 0;
|
||||
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __StackSeal (only if ARMv8-M stack sealing is used)
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
/*
|
||||
* SG veneers:
|
||||
* All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
|
||||
* must be set, either with the command line option --section-start or in a linker script,
|
||||
* to indicate where to place these veneers in memory.
|
||||
*/
|
||||
/*
|
||||
.gnu.sgstubs :
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > FLASH
|
||||
*/
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG ((__data_end__ - __data_start__) / 4)
|
||||
|
||||
/* Add each additional data section here */
|
||||
/*
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG ((__data2_end__ - __data2_start__) / 4)
|
||||
*/
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
/* Add each additional bss section here */
|
||||
/*
|
||||
LONG (__bss2_start__)
|
||||
LONG ((__bss2_end__ - __bss2_start__) / 4)
|
||||
*/
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
/**
|
||||
* Location counter can end up 2byte aligned with narrow Thumb code but
|
||||
* __etext is assumed by startup code to be the LMA of a section in RAM
|
||||
* which must be 4byte aligned
|
||||
*/
|
||||
__etext = ALIGN (4);
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
/*
|
||||
* Secondary data section, optional
|
||||
*
|
||||
* Remember to add each additional data section
|
||||
* to the .copy.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
__etext2 = ALIGN (4);
|
||||
|
||||
.data2 : AT (__etext2)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__data2_start__ = .;
|
||||
*(.data2)
|
||||
*(.data2.*)
|
||||
. = ALIGN(4);
|
||||
__data2_end__ = .;
|
||||
|
||||
} > RAM2
|
||||
*/
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM AT > RAM
|
||||
|
||||
/*
|
||||
* Secondary bss section, optional
|
||||
*
|
||||
* Remember to add each additional bss section
|
||||
* to the .zero.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
.bss2 :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss2_start__ = .;
|
||||
*(.bss2)
|
||||
*(.bss2.*)
|
||||
. = ALIGN(4);
|
||||
__bss2_end__ = .;
|
||||
} > RAM2 AT > RAM2
|
||||
*/
|
||||
|
||||
.heap (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
. = . + __HEAP_SIZE;
|
||||
. = ALIGN(8);
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
.stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE - __STACKSEAL_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackLimit = .;
|
||||
. = . + __STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
__StackTop = .;
|
||||
} > RAM
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* ARMv8-M stack sealing:
|
||||
to use ARMv8-M stack sealing uncomment '.stackseal' section
|
||||
*/
|
||||
/*
|
||||
.stackseal (ORIGIN(RAM) + LENGTH(RAM) - __STACKSEAL_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackSeal = .;
|
||||
. = . + 8;
|
||||
. = ALIGN(8);
|
||||
} > RAM
|
||||
*/
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM23.c
|
||||
* @brief CMSIS-Core Device Startup File for a Cortex-M23 Device
|
||||
* @version V2.1.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
extern uint32_t __STACK_LIMIT;
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
extern uint32_t __STACK_SEAL;
|
||||
#endif
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10 .. 223 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
__set_PSP((uint32_t)(&__INITIAL_SP));
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
__set_MSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
|
||||
__TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
|
||||
#endif
|
||||
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,161 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM23.c
|
||||
* @brief CMSIS-Core Device Startup File for a Cortex-M23 Device
|
||||
* @version V2.1.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
extern uint32_t __STACK_LIMIT;
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
extern uint32_t __STACK_SEAL;
|
||||
#endif
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10 .. 223 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
__set_PSP((uint32_t)(&__INITIAL_SP));
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
__set_MSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
|
||||
__TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
|
||||
#endif
|
||||
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,80 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_ARMCM23.c
|
||||
* @brief CMSIS Device System Source File for
|
||||
* ARMCM23 Device
|
||||
* @version V1.0.1
|
||||
* @date 15. November 2019
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#include "partition_ARMCM23.h"
|
||||
#endif
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define XTAL (50000000UL) /* Oscillator frequency */
|
||||
|
||||
#define SYSTEM_CLOCK (XTAL / 2U)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System initialization function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
|
||||
#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
|
||||
SCB->VTOR = (uint32_t) &(__VECTOR_TABLE[0]);
|
||||
#endif
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
TZ_SAU_Setup();
|
||||
#endif
|
||||
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup&C Startup
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,16 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#----------------------------------------------------------------------------------------------
|
||||
fvp_mps2.mps2_visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
cpu0.semihosting-enable=1 # (bool , init-time) default = '1' : Enable semihosting SVC traps. Applications that do not use semihosting must set this parameter to false.
|
||||
cpu0.semihosting-Thumb_SVC=0xAB # (int , init-time) default = '0xAB' : T32 SVC number for semihosting : [0x0..0xFF]
|
||||
cpu0.semihosting-cmd_line="" # (string, init-time) default = '' : Command line available to semihosting SVC calls
|
||||
cpu0.semihosting-heap_base=0x0 # (int , init-time) default = '0x0' : Virtual address of heap base : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-heap_limit=0x0 # (int , init-time) default = '0x10700000' : Virtual address of top of heap : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-stack_base=0x0 # (int , init-time) default = '0x10700000' : Virtual address of base of descending stack : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-stack_limit=0x0 # (int , init-time) default = '0x10800000' : Virtual address of stack limit : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-cwd="" # (string, init-time) default = '' : Base directory for semihosting file access.
|
||||
idau.NUM_IDAU_REGION=0x0 # (int , init-time) default = '0xA' :
|
||||
cpu0.SECEXT=1 # (bool , init-time) default = '1' : Whether the ARMv8-M Security Extensions are included
|
||||
fvp_mps2.DISABLE_GATING=1 # (bool , init-time) default = '0' : Disable Memory gating logic
|
||||
#----------------------------------------------------------------------------------------------
|
@ -1,123 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc -mcmse
|
||||
; command above MUST be in first line (no comment above!)
|
||||
|
||||
;Note: Add '-mcmse' to first line if your software model is "Secure Mode".
|
||||
; #! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc -mcmse
|
||||
|
||||
|
||||
/*
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*--------------------- Flash Configuration ----------------------------------
|
||||
; <h> Flash Configuration
|
||||
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x00000000
|
||||
#define __ROM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ---------------------------
|
||||
; <h> RAM Configuration
|
||||
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x20000000
|
||||
#define __RAM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ---------------------------
|
||||
; <h> Stack / Heap Configuration
|
||||
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_SIZE 0x00000400
|
||||
#define __HEAP_SIZE 0x00000C00
|
||||
|
||||
/*--------------------- CMSE Veneer Configuration ---------------------------
|
||||
; <h> CMSE Veneer Configuration
|
||||
; <o0> CMSE Veneer Size (in Bytes) <0x0-0xFFFFFFFF:32>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __CMSEVENEER_SIZE 0x200
|
||||
|
||||
/*
|
||||
;------------- <<< end of configuration section >>> ---------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap boundary definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE - __STACKSEAL_SIZE) /* starts at end of RAM - 8 byte stack seal */
|
||||
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Stack seal size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __STACKSEAL_SIZE ( 8 )
|
||||
#else
|
||||
#define __STACKSEAL_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Region base & size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __CV_BASE ( __ROM_BASE + __ROM_SIZE - __CMSEVENEER_SIZE )
|
||||
#define __CV_SIZE ( __CMSEVENEER_SIZE )
|
||||
#else
|
||||
#define __CV_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
#define __RO_BASE ( __ROM_BASE )
|
||||
#define __RO_SIZE ( __ROM_SIZE - __CV_SIZE )
|
||||
|
||||
#define __RW_BASE ( __RAM_BASE )
|
||||
#define __RW_SIZE ( __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE - __STACKSEAL_SIZE )
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Scatter Region definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
|
||||
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
|
||||
*(.bss.noinit)
|
||||
}
|
||||
|
||||
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
|
||||
*(+RW +ZI)
|
||||
}
|
||||
|
||||
#if __HEAP_SIZE > 0
|
||||
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
|
||||
}
|
||||
#endif
|
||||
|
||||
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
STACKSEAL +0 EMPTY __STACKSEAL_SIZE { ; Reserve empty region for stack seal immediately after stack
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
LR_CMSE_VENEER __CV_BASE ALIGN 32 __CV_SIZE { ; own load/execution region for CMSE Veneers
|
||||
ER_CMSE_VENEER __CV_BASE __CV_SIZE {
|
||||
*(Veneer$$CMSE)
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,316 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file gcc_arm.ld
|
||||
* @brief GNU Linker Script for Cortex-M based device
|
||||
* @version V2.2.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*---------------------- Flash Configuration ----------------------------------
|
||||
<h> Flash Configuration
|
||||
<o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__ROM_BASE = 0x00000000;
|
||||
__ROM_SIZE = 0x00200000;
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ----------------------------
|
||||
<h> RAM Configuration
|
||||
<o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
<o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__RAM_BASE = 0x20000000;
|
||||
__RAM_SIZE = 0x00200000;
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ----------------------------
|
||||
<h> Stack / Heap Configuration
|
||||
<o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
<o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
</h>
|
||||
-----------------------------------------------------------------------------*/
|
||||
__STACK_SIZE = 0x00000400;
|
||||
__HEAP_SIZE = 0x00000C00;
|
||||
|
||||
/*
|
||||
*-------------------- <<< end of configuration section >>> -------------------
|
||||
*/
|
||||
|
||||
/* ARMv8-M stack sealing:
|
||||
to use ARMv8-M stack sealing set __STACKSEAL_SIZE to 8 otherwise keep 0
|
||||
*/
|
||||
__STACKSEAL_SIZE = 8;
|
||||
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
|
||||
RAM (rwx) : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __StackSeal (only if ARMv8-M stack sealing is used)
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
/*
|
||||
* SG veneers:
|
||||
* All SG veneers are placed in the special output section .gnu.sgstubs. Its start address
|
||||
* must be set, either with the command line option --section-start or in a linker script,
|
||||
* to indicate where to place these veneers in memory.
|
||||
*/
|
||||
|
||||
.gnu.sgstubs :
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG ((__data_end__ - __data_start__) / 4)
|
||||
|
||||
/* Add each additional data section here */
|
||||
/*
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG ((__data2_end__ - __data2_start__) / 4)
|
||||
*/
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
/* Add each additional bss section here */
|
||||
/*
|
||||
LONG (__bss2_start__)
|
||||
LONG ((__bss2_end__ - __bss2_start__) / 4)
|
||||
*/
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
|
||||
/**
|
||||
* Location counter can end up 2byte aligned with narrow Thumb code but
|
||||
* __etext is assumed by startup code to be the LMA of a section in RAM
|
||||
* which must be 4byte aligned
|
||||
*/
|
||||
__etext = ALIGN (4);
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
/*
|
||||
* Secondary data section, optional
|
||||
*
|
||||
* Remember to add each additional data section
|
||||
* to the .copy.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
__etext2 = ALIGN (4);
|
||||
|
||||
.data2 : AT (__etext2)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__data2_start__ = .;
|
||||
*(.data2)
|
||||
*(.data2.*)
|
||||
. = ALIGN(4);
|
||||
__data2_end__ = .;
|
||||
|
||||
} > RAM2
|
||||
*/
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM AT > RAM
|
||||
|
||||
/*
|
||||
* Secondary bss section, optional
|
||||
*
|
||||
* Remember to add each additional bss section
|
||||
* to the .zero.table above to asure proper
|
||||
* initialization during startup.
|
||||
*/
|
||||
/*
|
||||
.bss2 :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss2_start__ = .;
|
||||
*(.bss2)
|
||||
*(.bss2.*)
|
||||
. = ALIGN(4);
|
||||
__bss2_end__ = .;
|
||||
} > RAM2 AT > RAM2
|
||||
*/
|
||||
|
||||
.heap (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
. = . + __HEAP_SIZE;
|
||||
. = ALIGN(8);
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
.stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE - __STACKSEAL_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackLimit = .;
|
||||
. = . + __STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
__StackTop = .;
|
||||
} > RAM
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* ARMv8-M stack sealing:
|
||||
to use ARMv8-M stack sealing uncomment '.stackseal' section
|
||||
*/
|
||||
|
||||
.stackseal (ORIGIN(RAM) + LENGTH(RAM) - __STACKSEAL_SIZE) (COPY) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__StackSeal = .;
|
||||
. = . + 8;
|
||||
. = ALIGN(8);
|
||||
} > RAM
|
||||
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
@ -1,832 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file partition_ARMCM23.h
|
||||
* @brief CMSIS-CORE Initial Setup for Secure / Non-Secure Zones for ARMCM23
|
||||
* @version V5.3.1
|
||||
* @date 09. July 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef PARTITION_ARMCM23_H
|
||||
#define PARTITION_ARMCM23_H
|
||||
|
||||
/*
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize Security Attribution Unit (SAU) CTRL register
|
||||
*/
|
||||
#define SAU_INIT_CTRL 1
|
||||
|
||||
/*
|
||||
// <q> Enable SAU
|
||||
// <i> Value for SAU->CTRL register bit ENABLE
|
||||
*/
|
||||
#define SAU_INIT_CTRL_ENABLE 1
|
||||
|
||||
/*
|
||||
// <o> When SAU is disabled
|
||||
// <0=> All Memory is Secure
|
||||
// <1=> All Memory is Non-Secure
|
||||
// <i> Value for SAU->CTRL register bit ALLNS
|
||||
// <i> When all Memory is Non-Secure (ALLNS is 1), IDAU can override memory map configuration.
|
||||
*/
|
||||
#define SAU_INIT_CTRL_ALLNS 0
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <h>Initialize Security Attribution Unit (SAU) Address Regions
|
||||
// <i>SAU configuration specifies regions to be one of:
|
||||
// <i> - Secure and Non-Secure Callable
|
||||
// <i> - Non-Secure
|
||||
// <i>Note: All memory regions not configured by SAU are Secure
|
||||
*/
|
||||
#define SAU_REGIONS_MAX 8 /* Max. number of SAU regions */
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 0
|
||||
// <i> Setup SAU Region 0 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION0 1
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START0 0x00000000 /* start address of SAU region 0 */
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END0 0x001FFFFF /* end address of SAU region 0 */
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC0 1
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 1
|
||||
// <i> Setup SAU Region 1 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION1 1
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START1 0x00200000
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END1 0x003FFFFF
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC1 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 2
|
||||
// <i> Setup SAU Region 2 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION2 1
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START2 0x20200000
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END2 0x203FFFFF
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC2 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 3
|
||||
// <i> Setup SAU Region 3 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION3 1
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START3 0x40000000
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END3 0x40040000
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC3 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 4
|
||||
// <i> Setup SAU Region 4 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION4 0
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START4 0x00000000 /* start address of SAU region 4 */
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END4 0x00000000 /* end address of SAU region 4 */
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC4 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 5
|
||||
// <i> Setup SAU Region 5 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION5 0
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START5 0x00000000
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END5 0x00000000
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC5 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 6
|
||||
// <i> Setup SAU Region 6 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION6 0
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START6 0x00000000
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END6 0x00000000
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC6 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize SAU Region 7
|
||||
// <i> Setup SAU Region 7 memory attributes
|
||||
*/
|
||||
#define SAU_INIT_REGION7 0
|
||||
|
||||
/*
|
||||
// <o>Start Address <0-0xFFFFFFE0>
|
||||
*/
|
||||
#define SAU_INIT_START7 0x00000000
|
||||
|
||||
/*
|
||||
// <o>End Address <0x1F-0xFFFFFFFF>
|
||||
*/
|
||||
#define SAU_INIT_END7 0x00000000
|
||||
|
||||
/*
|
||||
// <o>Region is
|
||||
// <0=>Non-Secure
|
||||
// <1=>Secure, Non-Secure Callable
|
||||
*/
|
||||
#define SAU_INIT_NSC7 0
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// </h>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Setup behaviour of Sleep and Exception Handling
|
||||
*/
|
||||
#define SCB_CSR_AIRCR_INIT 1
|
||||
|
||||
/*
|
||||
// <o> Deep Sleep can be enabled by
|
||||
// <0=>Secure and Non-Secure state
|
||||
// <1=>Secure state only
|
||||
// <i> Value for SCB->CSR register bit DEEPSLEEPS
|
||||
*/
|
||||
#define SCB_CSR_DEEPSLEEPS_VAL 1
|
||||
|
||||
/*
|
||||
// <o>System reset request accessible from
|
||||
// <0=> Secure and Non-Secure state
|
||||
// <1=> Secure state only
|
||||
// <i> Value for SCB->AIRCR register bit SYSRESETREQS
|
||||
*/
|
||||
#define SCB_AIRCR_SYSRESETREQS_VAL 1
|
||||
|
||||
/*
|
||||
// <o>Priority of Non-Secure exceptions is
|
||||
// <0=> Not altered
|
||||
// <1=> Lowered to 0x80-0xFF
|
||||
// <i> Value for SCB->AIRCR register bit PRIS
|
||||
*/
|
||||
#define SCB_AIRCR_PRIS_VAL 1
|
||||
|
||||
/*
|
||||
// <o>BusFault, HardFault, and NMI target
|
||||
// <0=> Secure state
|
||||
// <1=> Non-Secure state
|
||||
// <i> Value for SCB->AIRCR register bit BFHFNMINS
|
||||
*/
|
||||
#define SCB_AIRCR_BFHFNMINS_VAL 0
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// <e>Setup behaviour of single SysTick
|
||||
*/
|
||||
#define SCB_ICSR_INIT 0
|
||||
|
||||
/*
|
||||
// <o> in a single SysTick implementation, SysTick is
|
||||
// <0=>Secure
|
||||
// <1=>Non-Secure
|
||||
// <i> Value for SCB->ICSR register bit STTNS
|
||||
// <i> only for single SysTick implementation
|
||||
*/
|
||||
#define SCB_ICSR_STTNS_VAL 0
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// <h>Setup Interrupt Target
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 0 (Interrupts 0..31)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS0 1
|
||||
|
||||
/*
|
||||
// Interrupts 0..31
|
||||
// <o.0> Interrupt 0 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 1 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 2 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 3 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 4 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 5 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 6 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 7 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 8 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 9 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 10 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 11 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 12 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 13 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 14 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 15 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 16 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 17 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 18 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 19 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 20 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 21 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 22 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 23 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 24 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 25 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 26 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 27 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 28 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 29 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 30 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 31 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS0_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 1 (Interrupts 32..63)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS1 1
|
||||
|
||||
/*
|
||||
// Interrupts 32..63
|
||||
// <o.0> Interrupt 32 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 33 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 34 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 35 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 36 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 37 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 38 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 39 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 40 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 41 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 42 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 43 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 44 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 45 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 46 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 47 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 48 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 49 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 50 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 51 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 52 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 53 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 54 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 55 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 56 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 57 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 58 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 59 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 60 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 61 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 62 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 63 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS1_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 2 (Interrupts 64..95)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS2 0
|
||||
|
||||
/*
|
||||
// Interrupts 64..95
|
||||
// <o.0> Interrupt 64 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 65 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 66 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 67 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 68 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 69 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 70 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 71 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 72 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 73 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 74 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 75 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 76 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 77 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 78 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 79 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 80 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 81 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 82 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 83 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 84 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 85 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 86 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 87 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 88 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 89 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 90 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 91 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 92 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 93 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 94 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 95 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS2_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 3 (Interrupts 96..127)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS3 0
|
||||
|
||||
/*
|
||||
// Interrupts 96..127
|
||||
// <o.0> Interrupt 96 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 97 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 98 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 99 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 100 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 101 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 102 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 103 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 104 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 105 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 106 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 107 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 108 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 109 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 110 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 111 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 112 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 113 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 114 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 115 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 116 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 117 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 118 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 119 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 120 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 121 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 122 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 123 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 124 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 125 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 126 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 127 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS3_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 4 (Interrupts 128..159)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS4 0
|
||||
|
||||
/*
|
||||
// Interrupts 128..159
|
||||
// <o.0> Interrupt 128 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 129 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 130 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 131 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 132 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 133 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 134 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 135 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 136 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 137 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 138 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 139 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 140 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 141 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 142 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 143 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 144 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 145 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 146 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 147 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 148 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 149 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 150 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 151 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 152 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 153 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 154 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 155 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 156 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 157 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 158 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 159 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS4_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 5 (Interrupts 160..191)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS5 0
|
||||
|
||||
/*
|
||||
// Interrupts 160..191
|
||||
// <o.0> Interrupt 160 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 161 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 162 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 163 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 164 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 165 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 166 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 167 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 168 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 169 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 170 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 171 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 172 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 173 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 174 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 175 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 176 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 177 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 178 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 179 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 180 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 181 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 182 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 183 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 184 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 185 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 186 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 187 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 188 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 189 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 190 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 191 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS5_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 6 (Interrupts 192..223)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS6 0
|
||||
|
||||
/*
|
||||
// Interrupts 192..223
|
||||
// <o.0> Interrupt 192 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 193 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 194 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 195 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 196 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 197 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 198 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 199 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 200 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 201 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 202 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 203 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 204 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 205 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 206 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 207 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 208 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 209 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 210 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 211 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 212 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 213 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 214 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 215 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 216 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 217 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 218 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 219 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 220 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 221 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 222 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 223 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS6_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// <e>Initialize ITNS 7 (Interrupts 224..255)
|
||||
*/
|
||||
#define NVIC_INIT_ITNS7 0
|
||||
|
||||
/*
|
||||
// Interrupts 224..255
|
||||
// <o.0> Interrupt 224 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.1> Interrupt 225 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.2> Interrupt 226 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.3> Interrupt 227 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.4> Interrupt 228 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.5> Interrupt 229 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.6> Interrupt 230 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.7> Interrupt 231 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.8> Interrupt 232 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.9> Interrupt 233 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.10> Interrupt 234 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.11> Interrupt 235 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.12> Interrupt 236 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.13> Interrupt 237 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.14> Interrupt 238 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.15> Interrupt 239 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.16> Interrupt 240 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.17> Interrupt 241 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.18> Interrupt 242 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.19> Interrupt 243 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.20> Interrupt 244 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.21> Interrupt 245 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.22> Interrupt 246 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.23> Interrupt 247 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.24> Interrupt 248 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.25> Interrupt 249 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.26> Interrupt 250 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.27> Interrupt 251 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.28> Interrupt 252 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.29> Interrupt 253 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.30> Interrupt 254 <0=> Secure state <1=> Non-Secure state
|
||||
// <o.31> Interrupt 255 <0=> Secure state <1=> Non-Secure state
|
||||
*/
|
||||
#define NVIC_INIT_ITNS7_VAL 0x00000000
|
||||
|
||||
/*
|
||||
// </e>
|
||||
*/
|
||||
|
||||
/*
|
||||
// </h>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
max 128 SAU regions.
|
||||
SAU regions are defined in partition.h
|
||||
*/
|
||||
|
||||
#define SAU_INIT_REGION(n) \
|
||||
SAU->RNR = (n & SAU_RNR_REGION_Msk); \
|
||||
SAU->RBAR = (SAU_INIT_START##n & SAU_RBAR_BADDR_Msk); \
|
||||
SAU->RLAR = (SAU_INIT_END##n & SAU_RLAR_LADDR_Msk) | \
|
||||
((SAU_INIT_NSC##n << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk) | 1U
|
||||
|
||||
/**
|
||||
\brief Setup a SAU Region
|
||||
\details Writes the region information contained in SAU_Region to the
|
||||
registers SAU_RNR, SAU_RBAR, and SAU_RLAR
|
||||
*/
|
||||
__STATIC_INLINE void TZ_SAU_Setup (void)
|
||||
{
|
||||
|
||||
#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
|
||||
|
||||
#if defined (SAU_INIT_REGION0) && (SAU_INIT_REGION0 == 1U)
|
||||
SAU_INIT_REGION(0);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION1) && (SAU_INIT_REGION1 == 1U)
|
||||
SAU_INIT_REGION(1);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION2) && (SAU_INIT_REGION2 == 1U)
|
||||
SAU_INIT_REGION(2);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION3) && (SAU_INIT_REGION3 == 1U)
|
||||
SAU_INIT_REGION(3);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION4) && (SAU_INIT_REGION4 == 1U)
|
||||
SAU_INIT_REGION(4);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION5) && (SAU_INIT_REGION5 == 1U)
|
||||
SAU_INIT_REGION(5);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION6) && (SAU_INIT_REGION6 == 1U)
|
||||
SAU_INIT_REGION(6);
|
||||
#endif
|
||||
|
||||
#if defined (SAU_INIT_REGION7) && (SAU_INIT_REGION7 == 1U)
|
||||
SAU_INIT_REGION(7);
|
||||
#endif
|
||||
|
||||
/* repeat this for all possible SAU regions */
|
||||
|
||||
#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */
|
||||
|
||||
|
||||
#if defined (SAU_INIT_CTRL) && (SAU_INIT_CTRL == 1U)
|
||||
SAU->CTRL = ((SAU_INIT_CTRL_ENABLE << SAU_CTRL_ENABLE_Pos) & SAU_CTRL_ENABLE_Msk) |
|
||||
((SAU_INIT_CTRL_ALLNS << SAU_CTRL_ALLNS_Pos) & SAU_CTRL_ALLNS_Msk) ;
|
||||
#endif
|
||||
|
||||
#if defined (SCB_CSR_AIRCR_INIT) && (SCB_CSR_AIRCR_INIT == 1U)
|
||||
SCB->SCR = (SCB->SCR & ~(SCB_SCR_SLEEPDEEPS_Msk )) |
|
||||
((SCB_CSR_DEEPSLEEPS_VAL << SCB_SCR_SLEEPDEEPS_Pos) & SCB_SCR_SLEEPDEEPS_Msk);
|
||||
|
||||
SCB->AIRCR = (SCB->AIRCR & ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_SYSRESETREQS_Msk |
|
||||
SCB_AIRCR_BFHFNMINS_Msk | SCB_AIRCR_PRIS_Msk) ) |
|
||||
((0x05FAU << SCB_AIRCR_VECTKEY_Pos) & SCB_AIRCR_VECTKEY_Msk) |
|
||||
((SCB_AIRCR_SYSRESETREQS_VAL << SCB_AIRCR_SYSRESETREQS_Pos) & SCB_AIRCR_SYSRESETREQS_Msk) |
|
||||
((SCB_AIRCR_PRIS_VAL << SCB_AIRCR_PRIS_Pos) & SCB_AIRCR_PRIS_Msk) |
|
||||
((SCB_AIRCR_BFHFNMINS_VAL << SCB_AIRCR_BFHFNMINS_Pos) & SCB_AIRCR_BFHFNMINS_Msk);
|
||||
#endif /* defined (SCB_CSR_AIRCR_INIT) && (SCB_CSR_AIRCR_INIT == 1U) */
|
||||
|
||||
#if defined (SCB_ICSR_INIT) && (SCB_ICSR_INIT == 1U)
|
||||
SCB->ICSR = (SCB->ICSR & ~(SCB_ICSR_STTNS_Msk )) |
|
||||
((SCB_ICSR_STTNS_VAL << SCB_ICSR_STTNS_Pos) & SCB_ICSR_STTNS_Msk);
|
||||
#endif /* defined (SCB_ICSR_INIT) && (SCB_ICSR_INIT == 1U) */
|
||||
|
||||
#if defined (NVIC_INIT_ITNS0) && (NVIC_INIT_ITNS0 == 1U)
|
||||
NVIC->ITNS[0] = NVIC_INIT_ITNS0_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS1) && (NVIC_INIT_ITNS1 == 1U)
|
||||
NVIC->ITNS[1] = NVIC_INIT_ITNS1_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS2) && (NVIC_INIT_ITNS2 == 1U)
|
||||
NVIC->ITNS[2] = NVIC_INIT_ITNS2_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS3) && (NVIC_INIT_ITNS3 == 1U)
|
||||
NVIC->ITNS[3] = NVIC_INIT_ITNS3_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS4) && (NVIC_INIT_ITNS4 == 1U)
|
||||
NVIC->ITNS[4] = NVIC_INIT_ITNS4_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS5) && (NVIC_INIT_ITNS5 == 1U)
|
||||
NVIC->ITNS[5] = NVIC_INIT_ITNS5_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS6) && (NVIC_INIT_ITNS6 == 1U)
|
||||
NVIC->ITNS[6] = NVIC_INIT_ITNS6_VAL;
|
||||
#endif
|
||||
|
||||
#if defined (NVIC_INIT_ITNS7) && (NVIC_INIT_ITNS7 == 1U)
|
||||
NVIC->ITNS[7] = NVIC_INIT_ITNS7_VAL;
|
||||
#endif
|
||||
|
||||
/* repeat this for all possible ITNS elements */
|
||||
|
||||
}
|
||||
|
||||
#endif /* PARTITION_ARMCM23_H */
|
@ -1,161 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM23.c
|
||||
* @brief CMSIS-Core Device Startup File for a Cortex-M23 Device
|
||||
* @version V2.1.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
extern uint32_t __STACK_LIMIT;
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
extern uint32_t __STACK_SEAL;
|
||||
#endif
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10 .. 223 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
__set_PSP((uint32_t)(&__INITIAL_SP));
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
__set_MSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
|
||||
__TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
|
||||
#endif
|
||||
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,161 +0,0 @@
|
||||
/******************************************************************************
|
||||
* @file startup_ARMCM23.c
|
||||
* @brief CMSIS-Core Device Startup File for a Cortex-M23 Device
|
||||
* @version V2.1.0
|
||||
* @date 16. December 2020
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
External References
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern uint32_t __INITIAL_SP;
|
||||
extern uint32_t __STACK_LIMIT;
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
extern uint32_t __STACK_SEAL;
|
||||
#endif
|
||||
|
||||
extern __NO_RETURN void __PROGRAM_START(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Internal References
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler (void);
|
||||
void Default_Handler(void);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* Exceptions */
|
||||
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void HardFault_Handler (void) __attribute__ ((weak));
|
||||
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
|
||||
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
|
||||
Reset_Handler, /* Reset Handler */
|
||||
NMI_Handler, /* -14 NMI Handler */
|
||||
HardFault_Handler, /* -13 Hard Fault Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
SVC_Handler, /* -5 SVCall Handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
PendSV_Handler, /* -2 PendSV Handler */
|
||||
SysTick_Handler, /* -1 SysTick Handler */
|
||||
|
||||
/* Interrupts */
|
||||
Interrupt0_Handler, /* 0 Interrupt 0 */
|
||||
Interrupt1_Handler, /* 1 Interrupt 1 */
|
||||
Interrupt2_Handler, /* 2 Interrupt 2 */
|
||||
Interrupt3_Handler, /* 3 Interrupt 3 */
|
||||
Interrupt4_Handler, /* 4 Interrupt 4 */
|
||||
Interrupt5_Handler, /* 5 Interrupt 5 */
|
||||
Interrupt6_Handler, /* 6 Interrupt 6 */
|
||||
Interrupt7_Handler, /* 7 Interrupt 7 */
|
||||
Interrupt8_Handler, /* 8 Interrupt 8 */
|
||||
Interrupt9_Handler /* 9 Interrupt 9 */
|
||||
/* Interrupts 10 .. 223 are left out */
|
||||
};
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Reset Handler called on controller reset
|
||||
*----------------------------------------------------------------------------*/
|
||||
__NO_RETURN void Reset_Handler(void)
|
||||
{
|
||||
__set_PSP((uint32_t)(&__INITIAL_SP));
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
__set_MSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));
|
||||
|
||||
__TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
|
||||
#endif
|
||||
|
||||
SystemInit(); /* CMSIS System Initialization */
|
||||
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
|
||||
}
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Hard Fault Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Default Handler for Exceptions / Interrupts
|
||||
*----------------------------------------------------------------------------*/
|
||||
void Default_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -1,80 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_ARMCM23.c
|
||||
* @brief CMSIS Device System Source File for
|
||||
* ARMCM23 Device
|
||||
* @version V1.0.1
|
||||
* @date 15. November 2019
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined (ARMCM23)
|
||||
#include "ARMCM23.h"
|
||||
#elif defined (ARMCM23_TZ)
|
||||
#include "ARMCM23_TZ.h"
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#include "partition_ARMCM23.h"
|
||||
#endif
|
||||
#else
|
||||
#error device not specified!
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define XTAL (50000000UL) /* Oscillator frequency */
|
||||
|
||||
#define SYSTEM_CLOCK (XTAL / 2U)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Exception / Interrupt Vector table
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock Variable
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System Core Clock update function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
System initialization function
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
|
||||
#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
|
||||
SCB->VTOR = (uint32_t) &(__VECTOR_TABLE[0]);
|
||||
#endif
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
TZ_SAU_Setup();
|
||||
#endif
|
||||
|
||||
SystemCoreClock = SYSTEM_CLOCK;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/1.3.0/tools/projmgr/schemas/clayer.schema.json
|
||||
|
||||
layer:
|
||||
# type: Target
|
||||
description: Target setup
|
||||
|
||||
# packs:
|
||||
# - pack: ARM::CMSIS
|
||||
|
||||
components:
|
||||
# [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]
|
||||
- component: ARM::CMSIS:CORE
|
||||
- component: Device:Startup&C Startup
|
||||
|
||||
misc:
|
||||
- for-compiler: IAR
|
||||
Link: [--config generic_cortex.icf]
|
||||
|
||||
groups:
|
||||
- group: VHT/FVP
|
||||
files:
|
||||
- file: ./model_config.txt
|
@ -1,16 +0,0 @@
|
||||
# Parameters:
|
||||
# instance.parameter=value #(type, mode) default = 'def value' : description : [min..max]
|
||||
#----------------------------------------------------------------------------------------------
|
||||
fvp_mps2.mps2_visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation
|
||||
cpu0.semihosting-enable=1 # (bool , init-time) default = '1' : Enable semihosting SVC traps. Applications that do not use semihosting must set this parameter to false.
|
||||
cpu0.semihosting-Thumb_SVC=0xAB # (int , init-time) default = '0xAB' : T32 SVC number for semihosting : [0x0..0xFF]
|
||||
cpu0.semihosting-cmd_line="" # (string, init-time) default = '' : Command line available to semihosting SVC calls
|
||||
cpu0.semihosting-heap_base=0x0 # (int , init-time) default = '0x0' : Virtual address of heap base : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-heap_limit=0x0 # (int , init-time) default = '0x10700000' : Virtual address of top of heap : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-stack_base=0x0 # (int , init-time) default = '0x10700000' : Virtual address of base of descending stack : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-stack_limit=0x0 # (int , init-time) default = '0x10800000' : Virtual address of stack limit : [0x0..0xFFFFFFFF]
|
||||
cpu0.semihosting-cwd="" # (string, init-time) default = '' : Base directory for semihosting file access.
|
||||
idau.NUM_IDAU_REGION=0x0 # (int , init-time) default = '0xA' :
|
||||
cpu0.SECEXT=1 # (bool , init-time) default = '1' : Whether the ARMv8-M Security Extensions are included
|
||||
fvp_mps2.DISABLE_GATING=1 # (bool , init-time) default = '0' : Disable Memory gating logic
|
||||
#----------------------------------------------------------------------------------------------
|
@ -1,123 +0,0 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc -mcmse
|
||||
; command above MUST be in first line (no comment above!)
|
||||
|
||||
;Note: Add '-mcmse' to first line if your software model is "Secure Mode".
|
||||
; #! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m23 -xc -mcmse
|
||||
|
||||
|
||||
/*
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
|
||||
*/
|
||||
|
||||
/*--------------------- Flash Configuration ----------------------------------
|
||||
; <h> Flash Configuration
|
||||
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __ROM_BASE 0x00000000
|
||||
#define __ROM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- Embedded RAM Configuration ---------------------------
|
||||
; <h> RAM Configuration
|
||||
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
|
||||
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __RAM_BASE 0x20000000
|
||||
#define __RAM_SIZE 0x00200000
|
||||
|
||||
/*--------------------- Stack / Heap Configuration ---------------------------
|
||||
; <h> Stack / Heap Configuration
|
||||
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_SIZE 0x00000400
|
||||
#define __HEAP_SIZE 0x00000C00
|
||||
|
||||
/*--------------------- CMSE Veneer Configuration ---------------------------
|
||||
; <h> CMSE Veneer Configuration
|
||||
; <o0> CMSE Veneer Size (in Bytes) <0x0-0xFFFFFFFF:32>
|
||||
; </h>
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __CMSEVENEER_SIZE 0x200
|
||||
|
||||
/*
|
||||
;------------- <<< end of configuration section >>> ---------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
User Stack & Heap boundary definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE - __STACKSEAL_SIZE) /* starts at end of RAM - 8 byte stack seal */
|
||||
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Stack seal size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __STACKSEAL_SIZE ( 8 )
|
||||
#else
|
||||
#define __STACKSEAL_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Region base & size definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
#define __CV_BASE ( __ROM_BASE + __ROM_SIZE - __CMSEVENEER_SIZE )
|
||||
#define __CV_SIZE ( __CMSEVENEER_SIZE )
|
||||
#else
|
||||
#define __CV_SIZE ( 0 )
|
||||
#endif
|
||||
|
||||
#define __RO_BASE ( __ROM_BASE )
|
||||
#define __RO_SIZE ( __ROM_SIZE - __CV_SIZE )
|
||||
|
||||
#define __RW_BASE ( __RAM_BASE )
|
||||
#define __RW_SIZE ( __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE - __STACKSEAL_SIZE )
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Scatter Region definition
|
||||
*----------------------------------------------------------------------------*/
|
||||
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
|
||||
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
|
||||
*(.bss.noinit)
|
||||
}
|
||||
|
||||
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
|
||||
*(+RW +ZI)
|
||||
}
|
||||
|
||||
#if __HEAP_SIZE > 0
|
||||
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
|
||||
}
|
||||
#endif
|
||||
|
||||
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
STACKSEAL +0 EMPTY __STACKSEAL_SIZE { ; Reserve empty region for stack seal immediately after stack
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
||||
LR_CMSE_VENEER __CV_BASE ALIGN 32 __CV_SIZE { ; own load/execution region for CMSE Veneers
|
||||
ER_CMSE_VENEER __CV_BASE __CV_SIZE {
|
||||
*(Veneer$$CMSE)
|
||||
}
|
||||
}
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user