mirror of https://github.com/ARMmbed/mbed-os.git
commit
d2e9fde701
|
@ -1,129 +0,0 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm0plus_flash_init.c
|
||||
* \version 2.30
|
||||
*
|
||||
* The source for Flash initialization function.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "system_psoc6.h"
|
||||
#include "cy_ipc_sema.h"
|
||||
#include "cy_ipc_pipe.h"
|
||||
#include "cy_flash.h"
|
||||
|
||||
#include "system_psoc6_cm0plus_flash_init.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysIpcPipeIsrCm0Local
|
||||
****************************************************************************//**
|
||||
*
|
||||
* This is the interrupt service routine for the system pipe.
|
||||
* Copy of Cy_SysIpcPipeIsrCm0
|
||||
*
|
||||
*******************************************************************************/
|
||||
static void Cy_SysIpcPipeIsrCm0Local(void)
|
||||
{
|
||||
Cy_IPC_Pipe_ExecuteCallback(CY_IPC_EP_CYPIPE_CM0_ADDR);
|
||||
}
|
||||
|
||||
/* Structure containing semaphores control data */
|
||||
__attribute__((section(".cy_pub_ram"))) static cy_stc_ipc_sema_t cy_semaData;
|
||||
|
||||
static cy_en_ipcsema_status_t Cy_IPC_SemaInitLocal(uint32_t ipcChannel,
|
||||
uint32_t count, uint32_t memPtr[])
|
||||
{
|
||||
cy_en_ipcsema_status_t retStatus = CY_IPC_SEMA_BAD_PARAM;
|
||||
|
||||
/* Check for non Null pointers and count value */
|
||||
if ((NULL != memPtr) && (0u != count))
|
||||
{
|
||||
cy_semaData.maxSema = count;
|
||||
cy_semaData.arrayPtr = memPtr;
|
||||
|
||||
retStatus = Cy_IPC_Sema_InitExt(ipcChannel, &cy_semaData);
|
||||
}
|
||||
else
|
||||
{
|
||||
retStatus = CY_IPC_SEMA_BAD_PARAM;
|
||||
}
|
||||
|
||||
return(retStatus);
|
||||
}
|
||||
|
||||
__attribute__((section(".cy_pub_ram")))
|
||||
static uint32_t ipcSemaArray[CY_IPC_SEMA_COUNT / CY_IPC_SEMA_PER_WORD];
|
||||
__attribute__((section(".cy_pub_ram")))
|
||||
static cy_stc_ipc_pipe_ep_t systemIpcPipeEpArray[CY_IPC_MAX_ENDPOINTS];
|
||||
__attribute__((section(".cy_pub_ram")))
|
||||
static cy_ipc_pipe_callback_ptr_t systemIpcPipeSysCbArray[CY_SYS_CYPIPE_CLIENT_CNT];
|
||||
__attribute__((section(".cy_pub_ram")))
|
||||
CY_ALIGN(4) static cy_stc_flash_notify_t ipcWaitMessageStc;
|
||||
|
||||
void Cy_PubRamVariablesInit(void)
|
||||
{
|
||||
memset(&cy_semaData, 0, sizeof(cy_semaData));
|
||||
memset(&ipcSemaArray, 0, sizeof(ipcSemaArray));
|
||||
memset(&systemIpcPipeEpArray, 0, sizeof(systemIpcPipeEpArray));
|
||||
memset(&systemIpcPipeSysCbArray, 0, sizeof(systemIpcPipeSysCbArray));
|
||||
memset(&ipcWaitMessageStc, 0, sizeof(ipcWaitMessageStc));
|
||||
}
|
||||
|
||||
void Cy_SemaIpcFlashInit(void)
|
||||
{
|
||||
/* Initialize cy_pub_ram section variables */
|
||||
Cy_PubRamVariablesInit();
|
||||
|
||||
/* Allocate and initialize semaphores for the system operations. */
|
||||
(void) Cy_IPC_SemaInitLocal(CY_IPC_CHAN_SEMA, CY_IPC_SEMA_COUNT, ipcSemaArray);
|
||||
|
||||
/* Create an array of endpoint structures */
|
||||
Cy_IPC_Pipe_Config(systemIpcPipeEpArray);
|
||||
|
||||
static const cy_stc_ipc_pipe_config_t systemIpcPipeConfigCm0 =
|
||||
{
|
||||
/* .ep0ConfigData */
|
||||
{
|
||||
/* .ipcNotifierNumber */ CY_IPC_INTR_CYPIPE_EP0,
|
||||
/* .ipcNotifierPriority */ CY_SYS_INTR_CYPIPE_PRIOR_EP0,
|
||||
/* .ipcNotifierMuxNumber */ CY_SYS_INTR_CYPIPE_MUX_EP0,
|
||||
/* .epAddress */ CY_IPC_EP_CYPIPE_CM0_ADDR,
|
||||
/* .epConfig */ CY_SYS_CYPIPE_CONFIG_EP0
|
||||
},
|
||||
/* .ep1ConfigData */
|
||||
{
|
||||
/* .ipcNotifierNumber */ CY_IPC_INTR_CYPIPE_EP1,
|
||||
/* .ipcNotifierPriority */ CY_SYS_INTR_CYPIPE_PRIOR_EP1,
|
||||
/* .ipcNotifierMuxNumber */ 0u,
|
||||
/* .epAddress */ CY_IPC_EP_CYPIPE_CM4_ADDR,
|
||||
/* .epConfig */ CY_SYS_CYPIPE_CONFIG_EP1
|
||||
},
|
||||
/* .endpointClientsCount */ CY_SYS_CYPIPE_CLIENT_CNT,
|
||||
/* .endpointsCallbacksArray */ systemIpcPipeSysCbArray,
|
||||
/* .userPipeIsrHandler */ &Cy_SysIpcPipeIsrCm0Local
|
||||
};
|
||||
|
||||
if (cy_device->flashPipeRequired != 0u)
|
||||
{
|
||||
Cy_IPC_Pipe_Init(&systemIpcPipeConfigCm0);
|
||||
}
|
||||
|
||||
Cy_Flash_InitExt(&ipcWaitMessageStc);
|
||||
}
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,30 +0,0 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm0plus_flash_init.c
|
||||
* \version 2.30
|
||||
*
|
||||
* The header for Flash initialization function.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _SYSTEM_PSOC6_CM0PLUS_FLASH_INIT_H_
|
||||
#define _SYSTEM_PSOC6_CM0PLUS_FLASH_INIT_H_
|
||||
|
||||
void Cy_SemaIpcFlashInit(void);
|
||||
|
||||
#endif /* _SYSTEM_PSOC6_CM0PLUS_FLASH_INIT_H_ */
|
|
@ -1,10 +1,10 @@
|
|||
#! armcc -E
|
||||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xxa_cm4_dual.scat
|
||||
;* \version `$CY_MAJOR_VERSION`.`$CY_MINOR_VERSION`
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
|
@ -46,10 +46,26 @@
|
|||
#define MBED_ROM_START 0x10002000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_START is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
;* is equal to MBED_ROM_START
|
||||
;*
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x001FE000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
;* is equal to MBED_ROM_SIZE
|
||||
;*
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08002000
|
||||
#endif
|
||||
|
@ -69,7 +85,7 @@
|
|||
|
||||
; The following defines control RAM and flash memory allocation for the CM4 core.
|
||||
; You can change the memory allocation by editing RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for CM0+ core in 'xx_cm0plus.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.scat'.
|
||||
|
@ -77,8 +93,8 @@
|
|||
#define RAM_START MBED_RAM_START
|
||||
#define RAM_SIZE MBED_RAM_SIZE
|
||||
; Flash
|
||||
#define FLASH_START MBED_ROM_START
|
||||
#define FLASH_SIZE MBED_ROM_SIZE
|
||||
#define FLASH_START MBED_APP_START
|
||||
#define FLASH_SIZE MBED_APP_SIZE
|
||||
|
||||
; The following defines describe a 32K flash region used for EEPROM emulation.
|
||||
; This region can also be used as the general purpose flash.
|
||||
|
@ -252,5 +268,31 @@ CYMETA 0x90500000
|
|||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00200000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,5 +1,5 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_02_cm4.s
|
||||
; * @file startup_psoc6_02_cm4.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM4 Device Series
|
||||
; * @version V5.00
|
||||
|
@ -39,7 +39,6 @@ Stack_Size EQU 0x00000400
|
|||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
@ -82,7 +81,7 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External interrupts Power Mode Description
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
DCD ioss_interrupts_gpio_2_IRQHandler ; GPIO Port Interrupt #2
|
||||
|
@ -255,7 +254,6 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
EXPORT __ramVectors
|
||||
AREA RESET_RAM, READWRITE, NOINIT
|
||||
__ramVectors SPACE __Vectors_Size
|
||||
|
@ -276,7 +274,6 @@ Cy_OnResetUser PROC
|
|||
BX LR
|
||||
ENDP
|
||||
|
||||
|
||||
; Reset Handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
|
@ -738,7 +735,6 @@ sdhc_1_interrupt_general_IRQHandler
|
|||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xxa_cm4_dual.ld
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
|
@ -44,10 +44,26 @@ ENTRY(Reset_Handler)
|
|||
#define MBED_ROM_START 0x10002000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x001FE000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08002000
|
||||
#endif
|
||||
|
@ -77,13 +93,13 @@ MEMORY
|
|||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for CM0+ core in 'xx_cm0plus.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.ld'.
|
||||
*/
|
||||
ram (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_ROM_START, LENGTH = MBED_ROM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||
|
||||
/* This is a 32K flash region used for EEPROM emulation. This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xxa_cm4_dual.icf
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
|
@ -45,10 +45,26 @@ if (!isdefinedsymbol(MBED_ROM_START)) {
|
|||
define symbol MBED_ROM_START = 0x10002000;
|
||||
}
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = MBED_ROM_START;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x001FE000;
|
||||
}
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x08002000;
|
||||
}
|
||||
|
@ -67,7 +83,7 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
|||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM0+ core in 'xx_cm0plus.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.icf'.
|
||||
|
@ -76,8 +92,8 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
|||
define symbol __ICFEDIT_region_IRAM1_start__ = MBED_RAM_START;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = (MBED_RAM_START + MBED_RAM_SIZE);
|
||||
/* Flash */
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_ROM_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_ROM_START + MBED_ROM_SIZE);
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_APP_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_APP_START + MBED_APP_SIZE);
|
||||
|
||||
/* The following symbols define a 32K flash region used for EEPROM emulation.
|
||||
* This region can also be used as the general purpose flash.
|
||||
|
|
|
@ -79,7 +79,6 @@ __vector_table_0x1c
|
|||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6.h
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* \brief Device system header file.
|
||||
*
|
||||
|
@ -320,8 +320,13 @@
|
|||
* <th>Reason for Change</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.40</td>
|
||||
* <td>Updated assembler files, C files, linker scripts.</td>
|
||||
* <td>Added Arm Compiler 6 support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2">2.30</td>
|
||||
* <td>Added assembler files, linker skripts for Mbed OS.</td>
|
||||
* <td>Added assembler files, linker scripts for Mbed OS.</td>
|
||||
* <td>Added Arm Mbed OS embedded operating system support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm4.c
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
|
@ -43,6 +43,10 @@
|
|||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
|
@ -277,6 +281,11 @@ void SystemInit(void)
|
|||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
|
@ -284,6 +293,10 @@ void mbed_sdk_init(void)
|
|||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
|
||||
/* Set up the device based on configurator selections */
|
||||
init_cycfg_all();
|
||||
|
||||
|
@ -513,6 +526,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
|
@ -522,7 +536,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION)
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
|
@ -575,8 +589,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
|
|||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
|
||||
#endif /* defined (__ARMCC_VERSION) */
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#! armcc -E
|
||||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xx7_cm4_dual.scat
|
||||
;* \version `$CY_MAJOR_VERSION`.`$CY_MINOR_VERSION`
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
|
@ -85,7 +85,7 @@
|
|||
|
||||
; The following defines control RAM and flash memory allocation for the CM4 core.
|
||||
; You can change the memory allocation by editing RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for CM0+ core in 'xx_cm0plus.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.scat'.
|
||||
|
@ -268,5 +268,31 @@ CYMETA 0x90500000
|
|||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00100000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,5 +1,5 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm4.s
|
||||
; * @file startup_psoc6_01_cm4.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM4 Device Series
|
||||
; * @version V5.00
|
||||
|
@ -39,7 +39,6 @@ Stack_Size EQU 0x00000400
|
|||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
@ -82,7 +81,7 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External interrupts Power Mode Description
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
DCD ioss_interrupts_gpio_2_IRQHandler ; GPIO Port Interrupt #2
|
||||
|
@ -234,7 +233,6 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
EXPORT __ramVectors
|
||||
AREA RESET_RAM, READWRITE, NOINIT
|
||||
__ramVectors SPACE __Vectors_Size
|
||||
|
@ -255,7 +253,6 @@ Cy_OnResetUser PROC
|
|||
BX LR
|
||||
ENDP
|
||||
|
||||
|
||||
; Reset Handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
|
@ -675,7 +672,6 @@ pass_interrupt_dacs_IRQHandler
|
|||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm4_dual.ld
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
|
@ -93,7 +93,7 @@ MEMORY
|
|||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for CM0+ core in 'xx_cm0plus.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.ld'.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm4_dual.icf
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
|||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM0+ core in 'xx_cm0plus.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.icf'.
|
||||
|
|
|
@ -79,7 +79,6 @@ __vector_table_0x1c
|
|||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6.h
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* \brief Device system header file.
|
||||
*
|
||||
|
@ -320,8 +320,13 @@
|
|||
* <th>Reason for Change</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.40</td>
|
||||
* <td>Updated assembler files, C files, linker scripts.</td>
|
||||
* <td>Added Arm Compiler 6 support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2">2.30</td>
|
||||
* <td>Added assembler files, linker skripts for Mbed OS.</td>
|
||||
* <td>Added assembler files, linker scripts for Mbed OS.</td>
|
||||
* <td>Added Arm Mbed OS embedded operating system support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm4.c
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
|
@ -43,6 +43,10 @@
|
|||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
|
@ -277,6 +281,11 @@ void SystemInit(void)
|
|||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
|
@ -284,6 +293,10 @@ void mbed_sdk_init(void)
|
|||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
|
||||
/* Set up the device based on configurator selections */
|
||||
init_cycfg_all();
|
||||
|
||||
|
@ -513,6 +526,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
|
@ -522,7 +536,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION)
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
|
@ -575,8 +589,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
|
|||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
|
||||
#endif /* defined (__ARMCC_VERSION) */
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#! armcc -E
|
||||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xx7_cm0plus.scat
|
||||
;* \version 2.30
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
|
@ -46,16 +46,32 @@
|
|||
#define MBED_ROM_START 0x10000000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_START is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
;* is equal to MBED_ROM_START
|
||||
;*
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
;* is equal to MBED_ROM_SIZE
|
||||
;*
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x10000
|
||||
#define MBED_RAM_SIZE 0x00010000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_PUBLIC_RAM_START)
|
||||
|
@ -77,19 +93,19 @@
|
|||
|
||||
; The following defines control RAM and flash memory allocation for the CM0+ core.
|
||||
; You can change the memory allocation by editing the RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for the CM4 core in 'xx_cm4_dual.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.scat'.
|
||||
; RAM
|
||||
; RAM
|
||||
#define RAM_START MBED_RAM_START
|
||||
#define RAM_SIZE MBED_RAM_SIZE
|
||||
; Public RAM
|
||||
#define PUBLIC_RAM_START MBED_PUBLIC_RAM_START
|
||||
#define PUBLIC_RAM_SIZE MBED_PUBLIC_RAM_SIZE
|
||||
; Flash
|
||||
; Flash
|
||||
#define FLASH_START MBED_ROM_START
|
||||
#define FLASH_SIZE MBED_ROM_SIZE
|
||||
#define FLASH_START MBED_APP_START
|
||||
#define FLASH_SIZE MBED_APP_SIZE
|
||||
|
||||
; The following defines describe a 32K flash region used for EEPROM emulation.
|
||||
; This region can also be used as the general purpose flash.
|
||||
|
@ -165,13 +181,21 @@ LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
|
|||
* (.noinit)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK RAM_START+RAM_SIZE EMPTY -Stack_Size
|
||||
{ ; Stack region growing down
|
||||
}
|
||||
|
||||
RW_IRAM2 PUBLIC_RAM_START UNINIT
|
||||
{
|
||||
* (.cy_pub_ram)
|
||||
* (.cy_sharedmem)
|
||||
}
|
||||
|
||||
; Application heap area (HEAP)
|
||||
ARM_LIB_HEAP +0
|
||||
{
|
||||
* (HEAP)
|
||||
}
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK RAM_START+RAM_SIZE -Stack_Size
|
||||
{
|
||||
* (STACK)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,5 +280,31 @@ CYMETA 0x90500000
|
|||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00100000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,5 +1,5 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm0plus.s
|
||||
; * @file startup_psoc6_01_cm0plus.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM0plus Device Series
|
||||
; * @version V5.00
|
||||
|
@ -33,13 +33,12 @@
|
|||
IF :DEF:__STACK_SIZE
|
||||
Stack_Size EQU __STACK_SIZE
|
||||
ELSE
|
||||
Stack_Size EQU 0x00001000
|
||||
Stack_Size EQU 0x00000400
|
||||
ENDIF
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
@ -82,7 +81,6 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
|
||||
; External interrupts Description
|
||||
DCD NvicMux0_IRQHandler ; CM0+ NVIC Mux input 0
|
||||
DCD NvicMux1_IRQHandler ; CM0+ NVIC Mux input 1
|
||||
|
@ -148,9 +146,6 @@ Reset_Handler PROC
|
|||
; Define strong function for startup customization
|
||||
BL Cy_OnResetUser
|
||||
|
||||
; Disable global interrupts
|
||||
;CPSID I
|
||||
|
||||
; Copy vectors from ROM to RAM
|
||||
LDR r1, =__Vectors
|
||||
LDR r0, =__ramVectors
|
||||
|
@ -300,7 +295,6 @@ NvicMux31_IRQHandler
|
|||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm0plus.ld
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
|
@ -44,16 +44,32 @@ ENTRY(Reset_Handler)
|
|||
#define MBED_ROM_START 0x10000000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x10000
|
||||
#define MBED_RAM_SIZE 0x00010000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_PUBLIC_RAM_START)
|
||||
|
@ -85,12 +101,14 @@ MEMORY
|
|||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM0+ core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for the CM4 core in 'xx_cm4_dual.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.ld'.
|
||||
*/
|
||||
ram (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||
public_ram (rw) : ORIGIN = MBED_PUBLIC_RAM_START, LENGTH = MBED_PUBLIC_RAM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_ROM_START, LENGTH = (MBED_ROM_SIZE - 0x8000)
|
||||
flash (rx) : ORIGIN = MBED_APP_START, LENGTH = (MBED_APP_SIZE - 0x8000)
|
||||
|
||||
/* This is a 32K flash region used for EEPROM emulation. This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
|
@ -338,11 +356,12 @@ SECTIONS
|
|||
KEEP(*(.stack*))
|
||||
} > ram
|
||||
|
||||
|
||||
/* Public RAM */
|
||||
.cy_pub_ram (NOLOAD):
|
||||
.cy_sharedmem (NOLOAD):
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.cy_pub_ram))
|
||||
KEEP(*(.cy_sharedmem))
|
||||
} > public_ram
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
|
@ -164,11 +164,6 @@ Cy_OnResetUser:
|
|||
|
||||
Reset_Handler:
|
||||
bl Cy_OnResetUser
|
||||
/*
|
||||
#ifndef TARGET_MBED_SPM
|
||||
cpsid i
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* Firstly it copies data from read only memory to RAM. There are two schemes
|
||||
* to copy. One can copy more than one sections. Another can only copy
|
||||
|
@ -303,19 +298,7 @@ Reset_Handler:
|
|||
str r0, [r1]
|
||||
dsb 0xF
|
||||
|
||||
/*
|
||||
#ifndef TARGET_MBED_SPM
|
||||
#ifndef __NO_SYSTEM_INIT
|
||||
bl SystemInit
|
||||
#endif
|
||||
|
||||
bl main
|
||||
#elif
|
||||
*/
|
||||
bl _start
|
||||
/*
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* Should never get here */
|
||||
b .
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm0plus.icf
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
|
@ -45,16 +45,32 @@ if (!isdefinedsymbol(MBED_ROM_START)) {
|
|||
define symbol MBED_ROM_START = 0x10000000;
|
||||
}
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = MBED_ROM_START;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x80000;
|
||||
}
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x08000000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x10000;
|
||||
define symbol MBED_RAM_SIZE = 0x00010000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_PUBLIC_RAM_START)) {
|
||||
|
@ -65,12 +81,18 @@ if (!isdefinedsymbol(MBED_PUBLIC_RAM_SIZE)) {
|
|||
define symbol MBED_PUBLIC_RAM_SIZE = 0x200;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
/* The symbols below define the location and size of blocks of memory in the target.
|
||||
* Use these symbols to specify the memory regions available for allocation.
|
||||
*/
|
||||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM0+ core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM4 core in 'xx_cm4_dual.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.icf'.
|
||||
*/
|
||||
|
@ -81,8 +103,8 @@ define symbol __ICFEDIT_region_IRAM1_end__ = (MBED_RAM_START + MBED_RAM_SIZE);
|
|||
define symbol __ICFEDIT_region_IRAM2_start__ = MBED_PUBLIC_RAM_START;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = (MBED_PUBLIC_RAM_START + MBED_PUBLIC_RAM_SIZE);
|
||||
/* Flash */
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_ROM_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_ROM_START + MBED_ROM_SIZE - 0x8000);
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_APP_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_APP_START + MBED_APP_SIZE - 0x8000);
|
||||
|
||||
/* The following symbols define a 32K flash region used for EEPROM emulation.
|
||||
* This region can also be used as the general purpose flash.
|
||||
|
@ -128,8 +150,6 @@ define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
|
|||
define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
|
||||
|
||||
|
||||
/*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;
|
||||
|
@ -137,17 +157,11 @@ define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
|
|||
define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
|
||||
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
|
||||
/*-Sizes-*/
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(__STACK_SIZE)) {
|
||||
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
|
||||
} else {
|
||||
define symbol __ICFEDIT_size_cstack__ = __STACK_SIZE;
|
||||
}
|
||||
|
||||
define symbol __ICFEDIT_size_proc_stack__ = 0x0;
|
||||
if (!isdefinedsymbol(__HEAP_SIZE)) {
|
||||
define symbol __ICFEDIT_size_heap__ = 0x4000;
|
||||
|
@ -170,6 +184,11 @@ define region EROM1_region = mem:[from __ICFEDIT_region_EROM1_start__ to __ICFED
|
|||
define region IRAM1_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__];
|
||||
define region IRAM2_region = mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
|
||||
define block RAM_DATA {readwrite section .data};
|
||||
define block RAM_OTHER {readwrite section * };
|
||||
define block RAM_NOINIT {readwrite section .noinit};
|
||||
define block RAM_BSS {readwrite section .bss};
|
||||
define block RAM with fixed order {block RAM_DATA, block RAM_OTHER, block RAM_NOINIT, block RAM_BSS};
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
|
@ -213,12 +232,12 @@ place in IROM1_region { block RO };
|
|||
|
||||
/* RAM */
|
||||
place at start of IRAM1_region { readwrite section .intvec_ram};
|
||||
place in IRAM1_region { readwrite };
|
||||
place in IRAM1_region { block RAM};
|
||||
place in IRAM1_region { readwrite section .cy_ramfunc };
|
||||
place at end of IRAM1_region { block HSTACK };
|
||||
|
||||
/* Public RAM */
|
||||
place at start of IRAM2_region { section .cy_pub_ram };
|
||||
place at start of IRAM2_region { section .cy_sharedmem };
|
||||
|
||||
/* These sections are used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage. */
|
||||
".cymeta" : place at address mem : 0x90500000 { readonly section .cymeta };
|
|
@ -1,5 +1,5 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm0plus.s
|
||||
; * @file startup_psoc6_01_cm0plus.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM0plus Device Series
|
||||
; * @version V5.00
|
||||
|
@ -78,7 +78,7 @@ __vector_table_0x1c
|
|||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
; External interrupts Power Mode Description
|
||||
; External interrupts Description
|
||||
DCD NvicMux0_IRQHandler ; CM0+ NVIC Mux input 0
|
||||
DCD NvicMux1_IRQHandler ; CM0+ NVIC Mux input 1
|
||||
DCD NvicMux2_IRQHandler ; CM0+ NVIC Mux input 2
|
||||
|
@ -173,9 +173,6 @@ Reset_Handler
|
|||
LDR R0, =Cy_OnResetUser
|
||||
BLX R0
|
||||
|
||||
; Disable global interrupts
|
||||
;CPSID I
|
||||
|
||||
; Copy vectors from ROM to RAM
|
||||
LDR r1, =__vector_table
|
||||
LDR r0, =__ramVectors
|
||||
|
@ -195,13 +192,6 @@ intvec_copy
|
|||
STR r0, [r1]
|
||||
dsb
|
||||
|
||||
; Initialize data sections
|
||||
;LDR R0, =__iar_data_init3
|
||||
;BLX R0
|
||||
|
||||
;LDR R0, =SystemInit
|
||||
;BLX R0
|
||||
|
||||
LDR R0, =__iar_program_start
|
||||
BLX R0
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm0plus.c
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
|
@ -22,14 +22,16 @@
|
|||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "system_psoc6.h"
|
||||
#include "cy_device.h"
|
||||
#include "device.h"
|
||||
#include "system_psoc6.h"
|
||||
#include "cy_device_headers.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "cy_syslib.h"
|
||||
#include "cy_wdt.h"
|
||||
#include "system_psoc6_cm0plus_flash_init.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "cycfg.h"
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
#include "cy_ipc_sema.h"
|
||||
|
@ -42,6 +44,10 @@
|
|||
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
|
@ -158,6 +164,7 @@ uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
|
|||
#define CY_SYS_CM4_PWR_CTL_KEY_CLOSE (0xFA05UL)
|
||||
#define CY_SYS_CM4_VECTOR_TABLE_VALID_ADDR (0x000003FFUL)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: mbed_sdk_init
|
||||
****************************************************************************//**
|
||||
|
@ -168,16 +175,27 @@ uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
|
|||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
/* Initialize system and clocks. */
|
||||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
}
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
/* Configure mailbox IPC interrupts */
|
||||
mailbox_init();
|
||||
#else
|
||||
/* Enable global interrupts */
|
||||
__enable_irq();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SystemInit
|
||||
|
@ -216,9 +234,6 @@ void SystemInit(void)
|
|||
Cy_SystemInit();
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2) && !defined(CY_PSOC6ABLE2_REV_0A_SUPPORT_DISABLE)
|
||||
if (CY_SYSLIB_DEVICE_REV_0A == Cy_SysLib_GetDeviceRevision())
|
||||
{
|
||||
|
@ -231,6 +246,7 @@ void SystemInit(void)
|
|||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
/* Allocate and initialize semaphores for the system operations. */
|
||||
CY_SECTION(".cy_sharedmem")
|
||||
static uint32_t ipcSemaArray[CY_IPC_SEMA_COUNT / CY_IPC_SEMA_PER_WORD];
|
||||
|
||||
(void) Cy_IPC_Sema_Init(CY_IPC_CHAN_SEMA, CY_IPC_SEMA_COUNT, ipcSemaArray);
|
||||
|
@ -289,8 +305,6 @@ void SystemInit(void)
|
|||
Cy_Flash_Init();
|
||||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
|
||||
#else/* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
Cy_SemaIpcFlashInit();
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
}
|
||||
|
||||
|
@ -667,6 +681,7 @@ void Cy_SysIpcPipeIsrCm0(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
|
@ -676,7 +691,7 @@ void Cy_SysIpcPipeIsrCm0(void)
|
|||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION)
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
|
@ -704,7 +719,6 @@ __asm void Cy_MemorySymbols(void)
|
|||
EXPORT __cy_memory_4_length
|
||||
EXPORT __cy_memory_4_row_size
|
||||
|
||||
|
||||
/* Flash */
|
||||
__cy_memory_0_start EQU __cpp(CY_FLASH_BASE)
|
||||
__cy_memory_0_length EQU __cpp(CY_FLASH_SIZE)
|
||||
|
@ -730,7 +744,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
|
|||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
#endif /* defined (__ARMCC_VERSION) */
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,10 +1,10 @@
|
|||
#! armcc -E
|
||||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xx7_cm4_dual.scat
|
||||
;* \version `$CY_MAJOR_VERSION`.`$CY_MINOR_VERSION`
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
|
@ -85,7 +85,7 @@
|
|||
|
||||
; The following defines control RAM and flash memory allocation for the CM4 core.
|
||||
; You can change the memory allocation by editing RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for CM0+ core in 'xx_cm0plus.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.scat'.
|
||||
|
@ -268,5 +268,31 @@ CYMETA 0x90500000
|
|||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00100000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,5 +1,5 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm4.s
|
||||
; * @file startup_psoc6_01_cm4.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM4 Device Series
|
||||
; * @version V5.00
|
||||
|
@ -39,7 +39,6 @@ Stack_Size EQU 0x00000400
|
|||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
@ -82,7 +81,7 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External interrupts Power Mode Description
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
DCD ioss_interrupts_gpio_2_IRQHandler ; GPIO Port Interrupt #2
|
||||
|
@ -234,7 +233,6 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
EXPORT __ramVectors
|
||||
AREA RESET_RAM, READWRITE, NOINIT
|
||||
__ramVectors SPACE __Vectors_Size
|
||||
|
@ -255,7 +253,6 @@ Cy_OnResetUser PROC
|
|||
BX LR
|
||||
ENDP
|
||||
|
||||
|
||||
; Reset Handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
|
@ -675,7 +672,6 @@ pass_interrupt_dacs_IRQHandler
|
|||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm4_dual.ld
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
|
@ -93,7 +93,7 @@ MEMORY
|
|||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for CM0+ core in 'xx_cm0plus.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.ld'.
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm4_dual.icf
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
|||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM0+ core in 'xx_cm0plus.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.icf'.
|
|
@ -79,7 +79,6 @@ __vector_table_0x1c
|
|||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm4.c
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
|
@ -43,6 +43,10 @@
|
|||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
|
@ -154,9 +158,6 @@ uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
|
|||
#define CY_ROOT_PATH_SRC_DSI_MUX_PILO (19UL)
|
||||
#endif /* (SRSS_PILO_PRESENT == 1U) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SystemInit
|
||||
|
@ -267,10 +268,6 @@ void SystemInit(void)
|
|||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -284,6 +281,11 @@ void SystemInit(void)
|
|||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
|
@ -291,6 +293,10 @@ void mbed_sdk_init(void)
|
|||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
|
||||
/* Set up the device based on configurator selections */
|
||||
init_cycfg_all();
|
||||
|
||||
|
@ -520,6 +526,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
|
@ -529,7 +536,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION)
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
|
@ -582,8 +589,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
|
|||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
|
||||
#endif /* defined (__ARMCC_VERSION) */
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6.h
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* \brief Device system header file.
|
||||
*
|
||||
|
@ -320,8 +320,13 @@
|
|||
* <th>Reason for Change</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.40</td>
|
||||
* <td>Updated assembler files, C files, linker scripts.</td>
|
||||
* <td>Added Arm Compiler 6 support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2">2.30</td>
|
||||
* <td>Added assembler files, linker skripts for Mbed OS.</td>
|
||||
* <td>Added assembler files, linker scripts for Mbed OS.</td>
|
||||
* <td>Added Arm Mbed OS embedded operating system support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
/* -------------------------------------- Includes ----------------------------------- */
|
||||
|
||||
#include "spm_api.h"
|
||||
#include "cy_sysint.h"
|
||||
#include "spm_internal.h"
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
/* -------------------------------------- Includes ----------------------------------- */
|
||||
|
||||
#include "spm_api.h"
|
||||
|
||||
#include "device.h"
|
||||
#include "cyip_ipc.h"
|
||||
#include "cy_ipc_drv.h"
|
||||
|
@ -28,6 +27,13 @@
|
|||
#include "psoc6_utils.h"
|
||||
#include "mbed_error.h"
|
||||
|
||||
#if (CY_CPU_CORTEX_M0P)
|
||||
#include "device.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "mbed_error.h"
|
||||
#endif /* (CY_CPU_CORTEX_M0P) */
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------ Definitions ---------------------------------- */
|
||||
|
||||
|
@ -60,23 +66,34 @@ void ipc_interrupt_handler(void)
|
|||
|
||||
void mailbox_init(void)
|
||||
{
|
||||
// Interrupts configuration for CM0+
|
||||
// Interrupts configuration
|
||||
// * See ce216795_common.h for occupied interrupts
|
||||
// -----------------------------------------------
|
||||
|
||||
// Configure interrupts ISR / MUX and priority
|
||||
cy_stc_sysint_t ipc_intr_Config;
|
||||
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
ipc_intr_Config.intrSrc = (IRQn_Type)cpuss_interrupts_ipc_0_IRQn + SPM_IPC_NOTIFY_CM4_INTR;
|
||||
ipc_intr_Config.intrPriority = 1;
|
||||
#else
|
||||
ipc_intr_Config.intrSrc = CY_M0_CORE_IRQ_CHANNEL_PSA_MAILBOX;
|
||||
ipc_intr_Config.cm0pSrc = (cy_en_intr_t)cpuss_interrupts_ipc_0_IRQn + SPM_IPC_NOTIFY_CM0P_INTR; // Must match the interrupt we trigger using NOTIFY on CM4
|
||||
ipc_intr_Config.intrPriority = 1;
|
||||
if (cy_m0_nvic_reserve_channel(CY_M0_CORE_IRQ_CHANNEL_PSA_MAILBOX, CY_PSA_MAILBOX_IRQN_ID) == (IRQn_Type)(-1)) {
|
||||
error("PSA SPM Mailbox NVIC channel reservation conflict.");
|
||||
}
|
||||
#endif /* (CY_CPU_CORTEX_M4) */
|
||||
|
||||
(void)Cy_SysInt_Init(&ipc_intr_Config, ipc_interrupt_handler);
|
||||
|
||||
// Set specific NOTIFY interrupt mask only.
|
||||
// Only the interrupt sources with their masks enabled can trigger the interrupt.
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
ipc_interrupt_ptr = Cy_IPC_Drv_GetIntrBaseAddr(SPM_IPC_NOTIFY_CM4_INTR);
|
||||
#else
|
||||
ipc_interrupt_ptr = Cy_IPC_Drv_GetIntrBaseAddr(SPM_IPC_NOTIFY_CM0P_INTR);
|
||||
#endif /* (CY_CPU_CORTEX_M4) */
|
||||
CY_ASSERT(ipc_interrupt_ptr != NULL);
|
||||
Cy_IPC_Drv_SetInterruptMask(ipc_interrupt_ptr, 0x0, 1 << SPM_IPC_CHANNEL);
|
||||
|
||||
|
@ -94,5 +111,9 @@ void mailbox_init(void)
|
|||
void spm_hal_mailbox_notify(void)
|
||||
{
|
||||
CY_ASSERT(ipc_channel_handle != NULL);
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
Cy_IPC_Drv_AcquireNotify(ipc_channel_handle, (1uL << SPM_IPC_NOTIFY_CM0P_INTR));
|
||||
#else
|
||||
Cy_IPC_Drv_AcquireNotify(ipc_channel_handle, (1uL << SPM_IPC_NOTIFY_CM4_INTR));
|
||||
#endif /* (CY_CPU_CORTEX_M4) */
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ Build by mbed-cli using GNU Arm Embedded - version 6.3.1
|
|||
These images were compiled by the following command:
|
||||
|
||||
```
|
||||
mbed compile -m CY8CKIT_062_WIFI_BT_M0_PSA -t GCC_ARM --profile release -N psa_release_1.0
|
||||
mbed test --compile -m CY8CKIT_062_WIFI_BT_M0_PSA -t GCC_ARM --profile debug -n *psa-spm*,*psa-crypto_access_control
|
||||
python tools/psa/release.py -m CY8CKIT_062_WIFI_BT_M0_PSA
|
||||
```
|
||||
|
||||
To update the prebuilt binaries run the previous commands.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -19,12 +19,19 @@
|
|||
/* -------------------------------------- Includes ----------------------------------- */
|
||||
|
||||
#include "spm_api.h"
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "device.h"
|
||||
#include "cyip_ipc.h"
|
||||
#include "cy_ipc_drv.h"
|
||||
#include "cy_syslib.h"
|
||||
#include "cy_sysint.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "mbed_error.h"
|
||||
|
||||
#if (CY_CPU_CORTEX_M0P)
|
||||
#include "device.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "mbed_error.h"
|
||||
#endif /* (CY_CPU_CORTEX_M0P) */
|
||||
|
||||
|
||||
|
||||
|
@ -59,19 +66,34 @@ void ipc_interrupt_handler(void)
|
|||
|
||||
void mailbox_init(void)
|
||||
{
|
||||
// Interrupts configuration for CM4
|
||||
// Interrupts configuration
|
||||
// * See ce216795_common.h for occupied interrupts
|
||||
// -----------------------------------------------
|
||||
|
||||
// Configure interrupts ISR / MUX and priority
|
||||
cy_stc_sysint_t ipc_intr_Config;
|
||||
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
ipc_intr_Config.intrSrc = (IRQn_Type)cpuss_interrupts_ipc_0_IRQn + SPM_IPC_NOTIFY_CM4_INTR;
|
||||
ipc_intr_Config.intrPriority = 1;
|
||||
#else
|
||||
ipc_intr_Config.intrSrc = CY_M0_CORE_IRQ_CHANNEL_PSA_MAILBOX;
|
||||
ipc_intr_Config.cm0pSrc = (cy_en_intr_t)cpuss_interrupts_ipc_0_IRQn + SPM_IPC_NOTIFY_CM0P_INTR; // Must match the interrupt we trigger using NOTIFY on CM4
|
||||
ipc_intr_Config.intrPriority = 1;
|
||||
if (cy_m0_nvic_reserve_channel(CY_M0_CORE_IRQ_CHANNEL_PSA_MAILBOX, CY_PSA_MAILBOX_IRQN_ID) == (IRQn_Type)(-1)) {
|
||||
error("PSA SPM Mailbox NVIC channel reservation conflict.");
|
||||
}
|
||||
#endif /* (CY_CPU_CORTEX_M4) */
|
||||
|
||||
(void)Cy_SysInt_Init(&ipc_intr_Config, ipc_interrupt_handler);
|
||||
|
||||
// Set specific NOTIFY interrupt mask only.
|
||||
// Only the interrupt sources with their masks enabled can trigger the interrupt.
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
ipc_interrupt_ptr = Cy_IPC_Drv_GetIntrBaseAddr(SPM_IPC_NOTIFY_CM4_INTR);
|
||||
#else
|
||||
ipc_interrupt_ptr = Cy_IPC_Drv_GetIntrBaseAddr(SPM_IPC_NOTIFY_CM0P_INTR);
|
||||
#endif /* (CY_CPU_CORTEX_M4) */
|
||||
CY_ASSERT(ipc_interrupt_ptr != NULL);
|
||||
Cy_IPC_Drv_SetInterruptMask(ipc_interrupt_ptr, 0x0, 1 << SPM_IPC_CHANNEL);
|
||||
|
||||
|
@ -89,5 +111,9 @@ void mailbox_init(void)
|
|||
void spm_hal_mailbox_notify(void)
|
||||
{
|
||||
CY_ASSERT(ipc_channel_handle != NULL);
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
Cy_IPC_Drv_AcquireNotify(ipc_channel_handle, (1uL << SPM_IPC_NOTIFY_CM0P_INTR));
|
||||
#else
|
||||
Cy_IPC_Drv_AcquireNotify(ipc_channel_handle, (1uL << SPM_IPC_NOTIFY_CM4_INTR));
|
||||
#endif /* (CY_CPU_CORTEX_M4) */
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#! armcc -E
|
||||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xxa_cm4_dual.scat
|
||||
;* \version `$CY_MAJOR_VERSION`.`$CY_MINOR_VERSION`
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
|
@ -46,10 +46,26 @@
|
|||
#define MBED_ROM_START 0x10002000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_START is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
;* is equal to MBED_ROM_START
|
||||
;*
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x001FE000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
;* is equal to MBED_ROM_SIZE
|
||||
;*
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08002000
|
||||
#endif
|
||||
|
@ -69,7 +85,7 @@
|
|||
|
||||
; The following defines control RAM and flash memory allocation for the CM4 core.
|
||||
; You can change the memory allocation by editing RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for CM0+ core in 'xx_cm0plus.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.scat'.
|
||||
|
@ -77,8 +93,8 @@
|
|||
#define RAM_START MBED_RAM_START
|
||||
#define RAM_SIZE MBED_RAM_SIZE
|
||||
; Flash
|
||||
#define FLASH_START MBED_ROM_START
|
||||
#define FLASH_SIZE MBED_ROM_SIZE
|
||||
#define FLASH_START MBED_APP_START
|
||||
#define FLASH_SIZE MBED_APP_SIZE
|
||||
|
||||
; The following defines describe a 32K flash region used for EEPROM emulation.
|
||||
; This region can also be used as the general purpose flash.
|
||||
|
@ -252,5 +268,31 @@ CYMETA 0x90500000
|
|||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00200000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,5 +1,5 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_02_cm4.s
|
||||
; * @file startup_psoc6_02_cm4.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM4 Device Series
|
||||
; * @version V5.00
|
||||
|
@ -39,7 +39,6 @@ Stack_Size EQU 0x00000400
|
|||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
@ -82,7 +81,7 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External interrupts Power Mode Description
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
DCD ioss_interrupts_gpio_2_IRQHandler ; GPIO Port Interrupt #2
|
||||
|
@ -255,7 +254,6 @@ __Vectors DCD __initial_sp ; Top of Stack
|
|||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
EXPORT __ramVectors
|
||||
AREA RESET_RAM, READWRITE, NOINIT
|
||||
__ramVectors SPACE __Vectors_Size
|
||||
|
@ -276,7 +274,6 @@ Cy_OnResetUser PROC
|
|||
BX LR
|
||||
ENDP
|
||||
|
||||
|
||||
; Reset Handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
|
@ -738,7 +735,6 @@ sdhc_1_interrupt_general_IRQHandler
|
|||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xxa_cm4_dual.ld
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
|
@ -44,10 +44,26 @@ ENTRY(Reset_Handler)
|
|||
#define MBED_ROM_START 0x10002000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x001FE000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08002000
|
||||
#endif
|
||||
|
@ -77,13 +93,13 @@ MEMORY
|
|||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for CM0+ core in 'xx_cm0plus.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.ld'.
|
||||
*/
|
||||
ram (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_ROM_START, LENGTH = MBED_ROM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||
|
||||
/* This is a 32K flash region used for EEPROM emulation. This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xxa_cm4_dual.icf
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
|
@ -45,10 +45,26 @@ if (!isdefinedsymbol(MBED_ROM_START)) {
|
|||
define symbol MBED_ROM_START = 0x10002000;
|
||||
}
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = MBED_ROM_START;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x001FE000;
|
||||
}
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x08002000;
|
||||
}
|
||||
|
@ -67,7 +83,7 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
|||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the RAM section) are reserved for system use.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM0+ core in 'xx_cm0plus.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.icf'.
|
||||
|
@ -76,8 +92,8 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
|||
define symbol __ICFEDIT_region_IRAM1_start__ = MBED_RAM_START;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = (MBED_RAM_START + MBED_RAM_SIZE);
|
||||
/* Flash */
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_ROM_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_ROM_START + MBED_ROM_SIZE);
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_APP_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_APP_START + MBED_APP_SIZE);
|
||||
|
||||
/* The following symbols define a 32K flash region used for EEPROM emulation.
|
||||
* This region can also be used as the general purpose flash.
|
||||
|
|
|
@ -79,7 +79,6 @@ __vector_table_0x1c
|
|||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6.h
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* \brief Device system header file.
|
||||
*
|
||||
|
@ -320,8 +320,13 @@
|
|||
* <th>Reason for Change</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.40</td>
|
||||
* <td>Updated assembler files, C files, linker scripts.</td>
|
||||
* <td>Added Arm Compiler 6 support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2">2.30</td>
|
||||
* <td>Added assembler files, linker skripts for Mbed OS.</td>
|
||||
* <td>Added assembler files, linker scripts for Mbed OS.</td>
|
||||
* <td>Added Arm Mbed OS embedded operating system support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm4.c
|
||||
* \version 2.30
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
|
@ -43,6 +43,10 @@
|
|||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
|
@ -277,6 +281,11 @@ void SystemInit(void)
|
|||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
|
@ -284,6 +293,10 @@ void mbed_sdk_init(void)
|
|||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
|
||||
/* Set up the device based on configurator selections */
|
||||
init_cycfg_all();
|
||||
|
||||
|
@ -513,6 +526,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
|
@ -522,7 +536,7 @@ void Cy_SysIpcPipeIsrCm4(void)
|
|||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION)
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
|
@ -575,8 +589,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
|
|||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
|
||||
#endif /* defined (__ARMCC_VERSION) */
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* mbed Microcontroller Library
|
||||
* Copyright (c) 2017-2018 Future Electronics
|
||||
* Copyright (c) 2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef MBED_PERIPHERALNAMES_H
|
||||
#define MBED_PERIPHERALNAMES_H
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "PinNames.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
UART_0 = (int)SCB0_BASE,
|
||||
UART_1 = (int)SCB1_BASE,
|
||||
UART_2 = (int)SCB2_BASE,
|
||||
UART_3 = (int)SCB3_BASE,
|
||||
UART_4 = (int)SCB4_BASE,
|
||||
UART_5 = (int)SCB5_BASE,
|
||||
UART_6 = (int)SCB6_BASE,
|
||||
UART_7 = (int)SCB7_BASE,
|
||||
} UARTName;
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPI_0 = (int)SCB0_BASE,
|
||||
SPI_1 = (int)SCB1_BASE,
|
||||
SPI_2 = (int)SCB2_BASE,
|
||||
SPI_3 = (int)SCB3_BASE,
|
||||
SPI_4 = (int)SCB4_BASE,
|
||||
SPI_5 = (int)SCB5_BASE,
|
||||
SPI_6 = (int)SCB6_BASE,
|
||||
SPI_7 = (int)SCB7_BASE,
|
||||
SPI_8 = (int)SCB8_BASE,
|
||||
} SPIName;
|
||||
|
||||
typedef enum {
|
||||
I2C_0 = (int)SCB0_BASE,
|
||||
I2C_1 = (int)SCB1_BASE,
|
||||
I2C_2 = (int)SCB2_BASE,
|
||||
I2C_3 = (int)SCB3_BASE,
|
||||
I2C_4 = (int)SCB4_BASE,
|
||||
I2C_5 = (int)SCB5_BASE,
|
||||
I2C_6 = (int)SCB6_BASE,
|
||||
I2C_7 = (int)SCB7_BASE,
|
||||
I2C_8 = (int)SCB8_BASE,
|
||||
} I2CName;
|
||||
|
||||
typedef enum {
|
||||
PWM_32b_0 = TCPWM0_BASE,
|
||||
PWM_32b_1,
|
||||
PWM_32b_2,
|
||||
PWM_32b_3,
|
||||
PWM_32b_4,
|
||||
PWM_32b_5,
|
||||
PWM_32b_6,
|
||||
PWM_32b_7,
|
||||
PWM_16b_0 = TCPWM1_BASE,
|
||||
PWM_16b_1,
|
||||
PWM_16b_2,
|
||||
PWM_16b_3,
|
||||
PWM_16b_4,
|
||||
PWM_16b_5,
|
||||
PWM_16b_6,
|
||||
PWM_16b_7,
|
||||
PWM_16b_8,
|
||||
PWM_16b_9,
|
||||
PWM_16b_10,
|
||||
PWM_16b_11,
|
||||
PWM_16b_12,
|
||||
PWM_16b_13,
|
||||
PWM_16b_14,
|
||||
PWM_16b_15,
|
||||
PWM_16b_16,
|
||||
PWM_16b_17,
|
||||
PWM_16b_18,
|
||||
PWM_16b_19,
|
||||
PWM_16b_20,
|
||||
PWM_16b_21,
|
||||
PWM_16b_22,
|
||||
PWM_16b_23,
|
||||
} PWMName;
|
||||
|
||||
typedef enum {
|
||||
ADC_0 = (int)SAR_BASE,
|
||||
} ADCName;
|
||||
|
||||
typedef enum {
|
||||
DAC_0 = (int)CTDAC0_BASE,
|
||||
} DACName;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,436 @@
|
|||
/*
|
||||
* mbed Microcontroller Library
|
||||
* Copyright (c) 2017-2018 Future Electronics
|
||||
* Copyright (c) 2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "PeripheralNames.h"
|
||||
#include "PeripheralPins.h"
|
||||
#include "pinmap.h"
|
||||
|
||||
#if DEVICE_SERIAL
|
||||
//*** SERIAL ***
|
||||
const PinMap PinMap_UART_RX[] = {
|
||||
{P0_2, UART_0, CY_PIN_IN_FUNCTION( P0_2_SCB0_UART_RX, PCLK_SCB0_CLOCK)},
|
||||
{P1_0, UART_7, CY_PIN_IN_FUNCTION( P1_0_SCB7_UART_RX, PCLK_SCB7_CLOCK)},
|
||||
{P2_0, UART_1, CY_PIN_IN_FUNCTION( P2_0_SCB1_UART_RX, PCLK_SCB1_CLOCK)},
|
||||
{P3_0, UART_2, CY_PIN_IN_FUNCTION( P3_0_SCB2_UART_RX, PCLK_SCB2_CLOCK)},
|
||||
{P4_0, UART_7, CY_PIN_IN_FUNCTION( P4_0_SCB7_UART_RX, PCLK_SCB7_CLOCK)},
|
||||
{P5_0, UART_5, CY_PIN_IN_FUNCTION( P5_0_SCB5_UART_RX, PCLK_SCB5_CLOCK)},
|
||||
{P6_0, UART_3, CY_PIN_IN_FUNCTION( P6_0_SCB3_UART_RX, PCLK_SCB3_CLOCK)},
|
||||
{P6_4, UART_6, CY_PIN_IN_FUNCTION( P6_4_SCB6_UART_RX, PCLK_SCB6_CLOCK)},
|
||||
{P7_0, UART_4, CY_PIN_IN_FUNCTION( P7_0_SCB4_UART_RX, PCLK_SCB4_CLOCK)},
|
||||
{P8_0, UART_4, CY_PIN_IN_FUNCTION( P8_0_SCB4_UART_RX, PCLK_SCB4_CLOCK)},
|
||||
{P9_0, UART_2, CY_PIN_IN_FUNCTION( P9_0_SCB2_UART_RX, PCLK_SCB2_CLOCK)},
|
||||
{P10_0, UART_1, CY_PIN_IN_FUNCTION( P10_0_SCB1_UART_RX, PCLK_SCB1_CLOCK)},
|
||||
{P11_0, UART_5, CY_PIN_IN_FUNCTION( P11_0_SCB5_UART_RX, PCLK_SCB5_CLOCK)},
|
||||
{P12_0, UART_6, CY_PIN_IN_FUNCTION( P12_0_SCB6_UART_RX, PCLK_SCB6_CLOCK)},
|
||||
{P13_0, UART_6, CY_PIN_IN_FUNCTION( P13_0_SCB6_UART_RX, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_UART_TX[] = {
|
||||
{P0_3, UART_0, CY_PIN_OUT_FUNCTION( P0_3_SCB0_UART_TX, PCLK_SCB0_CLOCK)},
|
||||
{P1_1, UART_7, CY_PIN_OUT_FUNCTION( P1_1_SCB7_UART_TX, PCLK_SCB7_CLOCK)},
|
||||
{P2_1, UART_1, CY_PIN_OUT_FUNCTION( P2_1_SCB1_UART_TX, PCLK_SCB1_CLOCK)},
|
||||
{P3_1, UART_2, CY_PIN_OUT_FUNCTION( P3_1_SCB2_UART_TX, PCLK_SCB2_CLOCK)},
|
||||
{P4_1, UART_7, CY_PIN_OUT_FUNCTION( P4_1_SCB7_UART_TX, PCLK_SCB7_CLOCK)},
|
||||
{P5_1, UART_5, CY_PIN_OUT_FUNCTION( P5_1_SCB5_UART_TX, PCLK_SCB5_CLOCK)},
|
||||
{P6_1, UART_3, CY_PIN_OUT_FUNCTION( P6_1_SCB3_UART_TX, PCLK_SCB3_CLOCK)},
|
||||
{P6_5, UART_6, CY_PIN_OUT_FUNCTION( P6_5_SCB6_UART_TX, PCLK_SCB6_CLOCK)},
|
||||
{P7_1, UART_4, CY_PIN_OUT_FUNCTION( P7_1_SCB4_UART_TX, PCLK_SCB4_CLOCK)},
|
||||
{P8_1, UART_4, CY_PIN_OUT_FUNCTION( P8_1_SCB4_UART_TX, PCLK_SCB4_CLOCK)},
|
||||
{P9_1, UART_2, CY_PIN_OUT_FUNCTION( P9_1_SCB2_UART_TX, PCLK_SCB2_CLOCK)},
|
||||
{P10_1, UART_1, CY_PIN_OUT_FUNCTION( P10_1_SCB1_UART_TX, PCLK_SCB1_CLOCK)},
|
||||
{P11_1, UART_5, CY_PIN_OUT_FUNCTION( P11_1_SCB5_UART_TX, PCLK_SCB5_CLOCK)},
|
||||
{P12_1, UART_6, CY_PIN_OUT_FUNCTION( P12_1_SCB6_UART_TX, PCLK_SCB6_CLOCK)},
|
||||
{P13_1, UART_6, CY_PIN_OUT_FUNCTION( P13_1_SCB6_UART_TX, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_UART_RTS[] = {
|
||||
{P0_4, UART_0, CY_PIN_OUT_FUNCTION( P0_4_SCB0_UART_RTS, PCLK_SCB0_CLOCK)},
|
||||
{P1_2, UART_7, CY_PIN_OUT_FUNCTION( P1_2_SCB7_UART_RTS, PCLK_SCB7_CLOCK)},
|
||||
{P2_2, UART_1, CY_PIN_OUT_FUNCTION( P2_2_SCB1_UART_RTS, PCLK_SCB1_CLOCK)},
|
||||
{P3_2, UART_2, CY_PIN_OUT_FUNCTION( P3_2_SCB2_UART_RTS, PCLK_SCB2_CLOCK)},
|
||||
{P5_2, UART_5, CY_PIN_OUT_FUNCTION( P5_2_SCB5_UART_RTS, PCLK_SCB5_CLOCK)},
|
||||
{P6_2, UART_3, CY_PIN_OUT_FUNCTION( P6_2_SCB3_UART_RTS, PCLK_SCB3_CLOCK)},
|
||||
{P6_6, UART_6, CY_PIN_OUT_FUNCTION( P6_6_SCB6_UART_RTS, PCLK_SCB6_CLOCK)},
|
||||
{P7_2, UART_4, CY_PIN_OUT_FUNCTION( P7_2_SCB4_UART_RTS, PCLK_SCB4_CLOCK)},
|
||||
{P8_2, UART_4, CY_PIN_OUT_FUNCTION( P8_2_SCB4_UART_RTS, PCLK_SCB4_CLOCK)},
|
||||
{P9_2, UART_2, CY_PIN_OUT_FUNCTION( P9_2_SCB2_UART_RTS, PCLK_SCB2_CLOCK)},
|
||||
{P10_2, UART_1, CY_PIN_OUT_FUNCTION( P10_2_SCB1_UART_RTS, PCLK_SCB1_CLOCK)},
|
||||
{P11_2, UART_5, CY_PIN_OUT_FUNCTION( P11_2_SCB5_UART_RTS, PCLK_SCB5_CLOCK)},
|
||||
{P12_2, UART_6, CY_PIN_OUT_FUNCTION( P12_2_SCB6_UART_RTS, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_UART_CTS[] = {
|
||||
{P0_5, UART_0, CY_PIN_IN_FUNCTION( P0_5_SCB0_UART_CTS, PCLK_SCB0_CLOCK)},
|
||||
{P1_3, UART_7, CY_PIN_IN_FUNCTION( P1_3_SCB7_UART_CTS, PCLK_SCB7_CLOCK)},
|
||||
{P2_3, UART_1, CY_PIN_IN_FUNCTION( P2_3_SCB1_UART_CTS, PCLK_SCB1_CLOCK)},
|
||||
{P3_3, UART_2, CY_PIN_IN_FUNCTION( P3_3_SCB2_UART_CTS, PCLK_SCB2_CLOCK)},
|
||||
{P5_3, UART_5, CY_PIN_IN_FUNCTION( P5_3_SCB5_UART_CTS, PCLK_SCB5_CLOCK)},
|
||||
{P6_3, UART_3, CY_PIN_IN_FUNCTION( P6_3_SCB3_UART_CTS, PCLK_SCB3_CLOCK)},
|
||||
{P6_7, UART_6, CY_PIN_IN_FUNCTION( P6_7_SCB6_UART_CTS, PCLK_SCB6_CLOCK)},
|
||||
{P7_3, UART_4, CY_PIN_IN_FUNCTION( P7_3_SCB4_UART_CTS, PCLK_SCB4_CLOCK)},
|
||||
{P8_3, UART_4, CY_PIN_IN_FUNCTION( P8_3_SCB4_UART_CTS, PCLK_SCB4_CLOCK)},
|
||||
{P9_3, UART_2, CY_PIN_IN_FUNCTION( P9_3_SCB2_UART_CTS, PCLK_SCB2_CLOCK)},
|
||||
{P10_3, UART_1, CY_PIN_IN_FUNCTION( P10_3_SCB1_UART_CTS, PCLK_SCB1_CLOCK)},
|
||||
{P11_3, UART_5, CY_PIN_IN_FUNCTION( P11_3_SCB5_UART_CTS, PCLK_SCB5_CLOCK)},
|
||||
{P12_3, UART_6, CY_PIN_IN_FUNCTION( P12_3_SCB6_UART_CTS, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
#endif // DEVICE_SERIAL
|
||||
|
||||
|
||||
#if DEVICE_I2C
|
||||
//*** I2C ***
|
||||
const PinMap PinMap_I2C_SCL[] = {
|
||||
{P0_2, I2C_0, CY_PIN_OD_FUNCTION( P0_2_SCB0_I2C_SCL, PCLK_SCB0_CLOCK)},
|
||||
{P1_0, I2C_7, CY_PIN_OD_FUNCTION( P1_0_SCB7_I2C_SCL, PCLK_SCB7_CLOCK)},
|
||||
{P2_0, I2C_1, CY_PIN_OD_FUNCTION( P2_0_SCB1_I2C_SCL, PCLK_SCB1_CLOCK)},
|
||||
{P3_0, I2C_2, CY_PIN_OD_FUNCTION( P3_0_SCB2_I2C_SCL, PCLK_SCB2_CLOCK)},
|
||||
{P4_0, I2C_7, CY_PIN_OD_FUNCTION( P4_0_SCB7_I2C_SCL, PCLK_SCB7_CLOCK)},
|
||||
{P5_0, I2C_5, CY_PIN_OD_FUNCTION( P5_0_SCB5_I2C_SCL, PCLK_SCB5_CLOCK)},
|
||||
{P6_0, I2C_3, CY_PIN_OD_FUNCTION( P6_0_SCB3_I2C_SCL, PCLK_SCB3_CLOCK)},
|
||||
{P6_4, I2C_6, CY_PIN_OD_FUNCTION( P6_4_SCB6_I2C_SCL, PCLK_SCB6_CLOCK)},
|
||||
{P7_0, I2C_4, CY_PIN_OD_FUNCTION( P7_0_SCB4_I2C_SCL, PCLK_SCB4_CLOCK)},
|
||||
{P8_0, I2C_4, CY_PIN_OD_FUNCTION( P8_0_SCB4_I2C_SCL, PCLK_SCB4_CLOCK)},
|
||||
{P9_0, I2C_2, CY_PIN_OD_FUNCTION( P9_0_SCB2_I2C_SCL, PCLK_SCB2_CLOCK)},
|
||||
{P10_0, I2C_1, CY_PIN_OD_FUNCTION( P10_0_SCB1_I2C_SCL, PCLK_SCB1_CLOCK)},
|
||||
{P11_0, I2C_5, CY_PIN_OD_FUNCTION( P11_0_SCB5_I2C_SCL, PCLK_SCB5_CLOCK)},
|
||||
{P12_0, I2C_6, CY_PIN_OD_FUNCTION( P12_0_SCB6_I2C_SCL, PCLK_SCB6_CLOCK)},
|
||||
{P13_0, I2C_6, CY_PIN_OD_FUNCTION( P13_0_SCB6_I2C_SCL, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_I2C_SDA[] = {
|
||||
{P0_3, I2C_0, CY_PIN_OD_FUNCTION( P0_3_SCB0_I2C_SDA, PCLK_SCB0_CLOCK)},
|
||||
{P1_1, I2C_7, CY_PIN_OD_FUNCTION( P1_1_SCB7_I2C_SDA, PCLK_SCB7_CLOCK)},
|
||||
{P2_1, I2C_1, CY_PIN_OD_FUNCTION( P2_1_SCB1_I2C_SDA, PCLK_SCB1_CLOCK)},
|
||||
{P3_1, I2C_2, CY_PIN_OD_FUNCTION( P3_1_SCB2_I2C_SDA, PCLK_SCB2_CLOCK)},
|
||||
{P4_1, I2C_7, CY_PIN_OD_FUNCTION( P4_1_SCB7_I2C_SDA, PCLK_SCB7_CLOCK)},
|
||||
{P5_1, I2C_5, CY_PIN_OD_FUNCTION( P5_1_SCB5_I2C_SDA, PCLK_SCB5_CLOCK)},
|
||||
{P6_1, I2C_3, CY_PIN_OD_FUNCTION( P6_1_SCB3_I2C_SDA, PCLK_SCB3_CLOCK)},
|
||||
{P6_5, I2C_6, CY_PIN_OD_FUNCTION( P6_5_SCB6_I2C_SDA, PCLK_SCB6_CLOCK)},
|
||||
{P7_1, I2C_4, CY_PIN_OD_FUNCTION( P7_1_SCB4_I2C_SDA, PCLK_SCB4_CLOCK)},
|
||||
{P8_1, I2C_4, CY_PIN_OD_FUNCTION( P8_1_SCB4_I2C_SDA, PCLK_SCB4_CLOCK)},
|
||||
{P9_1, I2C_2, CY_PIN_OD_FUNCTION( P9_1_SCB2_I2C_SDA, PCLK_SCB2_CLOCK)},
|
||||
{P10_1, I2C_1, CY_PIN_OD_FUNCTION( P10_1_SCB1_I2C_SDA, PCLK_SCB1_CLOCK)},
|
||||
{P11_1, I2C_5, CY_PIN_OD_FUNCTION( P11_1_SCB5_I2C_SDA, PCLK_SCB5_CLOCK)},
|
||||
{P12_1, I2C_6, CY_PIN_OD_FUNCTION( P12_1_SCB6_I2C_SDA, PCLK_SCB6_CLOCK)},
|
||||
{P13_1, I2C_6, CY_PIN_OD_FUNCTION( P13_1_SCB6_I2C_SDA, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
#endif // DEVICE_I2C
|
||||
|
||||
#if DEVICE_SPI
|
||||
//*** SPI ***
|
||||
const PinMap PinMap_SPI_MOSI[] = {
|
||||
{P0_2, SPI_0, CY_PIN_OUT_FUNCTION( P0_2_SCB0_SPI_MOSI, PCLK_SCB0_CLOCK)},
|
||||
{P1_0, SPI_7, CY_PIN_OUT_FUNCTION( P1_0_SCB7_SPI_MOSI, PCLK_SCB7_CLOCK)},
|
||||
{P2_0, SPI_1, CY_PIN_OUT_FUNCTION( P2_0_SCB1_SPI_MOSI, PCLK_SCB1_CLOCK)},
|
||||
{P3_0, SPI_2, CY_PIN_OUT_FUNCTION( P3_0_SCB2_SPI_MOSI, PCLK_SCB2_CLOCK)},
|
||||
{P4_0, SPI_7, CY_PIN_OUT_FUNCTION( P4_0_SCB7_SPI_MOSI, PCLK_SCB7_CLOCK)},
|
||||
{P5_0, SPI_5, CY_PIN_OUT_FUNCTION( P5_0_SCB5_SPI_MOSI, PCLK_SCB5_CLOCK)},
|
||||
{P6_0, SPI_3, CY_PIN_OUT_FUNCTION( P6_0_SCB3_SPI_MOSI, PCLK_SCB3_CLOCK)},
|
||||
{P6_4, SPI_6, CY_PIN_OUT_FUNCTION( P6_4_SCB6_SPI_MOSI, PCLK_SCB6_CLOCK)},
|
||||
{P7_0, SPI_4, CY_PIN_OUT_FUNCTION( P7_0_SCB4_SPI_MOSI, PCLK_SCB4_CLOCK)},
|
||||
{P8_0, SPI_4, CY_PIN_OUT_FUNCTION( P8_0_SCB4_SPI_MOSI, PCLK_SCB4_CLOCK)},
|
||||
{P9_0, SPI_2, CY_PIN_OUT_FUNCTION( P9_0_SCB2_SPI_MOSI, PCLK_SCB2_CLOCK)},
|
||||
{P10_0, SPI_1, CY_PIN_OUT_FUNCTION( P10_0_SCB1_SPI_MOSI, PCLK_SCB1_CLOCK)},
|
||||
{P11_0, SPI_5, CY_PIN_OUT_FUNCTION( P11_0_SCB5_SPI_MOSI, PCLK_SCB5_CLOCK)},
|
||||
{P12_0, SPI_6, CY_PIN_OUT_FUNCTION( P12_0_SCB6_SPI_MOSI, PCLK_SCB6_CLOCK)},
|
||||
{P13_0, SPI_6, CY_PIN_OUT_FUNCTION( P13_0_SCB6_SPI_MOSI, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_SPI_MISO[] = {
|
||||
{P0_3, SPI_0, CY_PIN_IN_FUNCTION( P0_3_SCB0_SPI_MISO, PCLK_SCB0_CLOCK)},
|
||||
{P1_1, SPI_7, CY_PIN_IN_FUNCTION( P1_1_SCB7_SPI_MISO, PCLK_SCB7_CLOCK)},
|
||||
{P2_1, SPI_1, CY_PIN_IN_FUNCTION( P2_1_SCB1_SPI_MISO, PCLK_SCB1_CLOCK)},
|
||||
{P3_1, SPI_2, CY_PIN_IN_FUNCTION( P3_1_SCB2_SPI_MISO, PCLK_SCB2_CLOCK)},
|
||||
{P4_1, SPI_7, CY_PIN_IN_FUNCTION( P4_1_SCB7_SPI_MISO, PCLK_SCB7_CLOCK)},
|
||||
{P5_1, SPI_5, CY_PIN_IN_FUNCTION( P5_1_SCB5_SPI_MISO, PCLK_SCB5_CLOCK)},
|
||||
{P6_1, SPI_3, CY_PIN_IN_FUNCTION( P6_1_SCB3_SPI_MISO, PCLK_SCB3_CLOCK)},
|
||||
{P6_5, SPI_6, CY_PIN_IN_FUNCTION( P6_5_SCB6_SPI_MISO, PCLK_SCB6_CLOCK)},
|
||||
{P7_1, SPI_4, CY_PIN_IN_FUNCTION( P7_1_SCB4_SPI_MISO, PCLK_SCB4_CLOCK)},
|
||||
{P8_1, SPI_4, CY_PIN_IN_FUNCTION( P8_1_SCB4_SPI_MISO, PCLK_SCB4_CLOCK)},
|
||||
{P9_1, SPI_2, CY_PIN_IN_FUNCTION( P9_1_SCB2_SPI_MISO, PCLK_SCB2_CLOCK)},
|
||||
{P10_1, SPI_1, CY_PIN_IN_FUNCTION( P10_1_SCB1_SPI_MISO, PCLK_SCB1_CLOCK)},
|
||||
{P11_1, SPI_5, CY_PIN_IN_FUNCTION( P11_1_SCB5_SPI_MISO, PCLK_SCB5_CLOCK)},
|
||||
{P12_1, SPI_6, CY_PIN_IN_FUNCTION( P12_1_SCB6_SPI_MISO, PCLK_SCB6_CLOCK)},
|
||||
{P13_1, SPI_6, CY_PIN_IN_FUNCTION( P13_1_SCB6_SPI_MISO, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_SPI_SCLK[] = {
|
||||
{P0_4, SPI_0, CY_PIN_OUT_FUNCTION( P0_4_SCB0_SPI_CLK, PCLK_SCB0_CLOCK)},
|
||||
{P1_2, SPI_7, CY_PIN_OUT_FUNCTION( P1_2_SCB7_SPI_CLK, PCLK_SCB7_CLOCK)},
|
||||
{P2_2, SPI_1, CY_PIN_OUT_FUNCTION( P2_2_SCB1_SPI_CLK, PCLK_SCB1_CLOCK)},
|
||||
{P3_2, SPI_2, CY_PIN_OUT_FUNCTION( P3_2_SCB2_SPI_CLK, PCLK_SCB2_CLOCK)},
|
||||
{P5_2, SPI_5, CY_PIN_OUT_FUNCTION( P5_2_SCB5_SPI_CLK, PCLK_SCB5_CLOCK)},
|
||||
{P6_2, SPI_3, CY_PIN_OUT_FUNCTION( P6_2_SCB3_SPI_CLK, PCLK_SCB3_CLOCK)},
|
||||
{P6_6, SPI_6, CY_PIN_OUT_FUNCTION( P6_6_SCB6_SPI_CLK, PCLK_SCB6_CLOCK)},
|
||||
{P7_2, SPI_4, CY_PIN_OUT_FUNCTION( P7_2_SCB4_SPI_CLK, PCLK_SCB4_CLOCK)},
|
||||
{P8_2, SPI_4, CY_PIN_OUT_FUNCTION( P8_2_SCB4_SPI_CLK, PCLK_SCB4_CLOCK)},
|
||||
{P9_2, SPI_2, CY_PIN_OUT_FUNCTION( P9_2_SCB2_SPI_CLK, PCLK_SCB2_CLOCK)},
|
||||
{P10_2, SPI_1, CY_PIN_OUT_FUNCTION( P10_2_SCB1_SPI_CLK, PCLK_SCB1_CLOCK)},
|
||||
{P11_2, SPI_5, CY_PIN_OUT_FUNCTION( P11_2_SCB5_SPI_CLK, PCLK_SCB5_CLOCK)},
|
||||
{P12_2, SPI_6, CY_PIN_OUT_FUNCTION( P12_2_SCB6_SPI_CLK, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
const PinMap PinMap_SPI_SSEL[] = {
|
||||
{P0_5, SPI_0, CY_PIN_OUT_FUNCTION( P0_5_SCB0_SPI_SELECT0, PCLK_SCB0_CLOCK)},
|
||||
{P1_3, SPI_7, CY_PIN_OUT_FUNCTION( P1_3_SCB7_SPI_SELECT0, PCLK_SCB7_CLOCK)},
|
||||
{P2_3, SPI_1, CY_PIN_OUT_FUNCTION( P2_3_SCB1_SPI_SELECT0, PCLK_SCB1_CLOCK)},
|
||||
{P3_3, SPI_2, CY_PIN_OUT_FUNCTION( P3_3_SCB2_SPI_SELECT0, PCLK_SCB2_CLOCK)},
|
||||
{P5_3, SPI_5, CY_PIN_OUT_FUNCTION( P5_3_SCB5_SPI_SELECT0, PCLK_SCB5_CLOCK)},
|
||||
{P6_3, SPI_3, CY_PIN_OUT_FUNCTION( P6_3_SCB3_SPI_SELECT0, PCLK_SCB3_CLOCK)},
|
||||
{P6_7, SPI_6, CY_PIN_OUT_FUNCTION( P6_7_SCB6_SPI_SELECT0, PCLK_SCB6_CLOCK)},
|
||||
{P7_3, SPI_4, CY_PIN_OUT_FUNCTION( P7_3_SCB4_SPI_SELECT0, PCLK_SCB4_CLOCK)},
|
||||
{P8_3, SPI_4, CY_PIN_OUT_FUNCTION( P8_3_SCB4_SPI_SELECT0, PCLK_SCB4_CLOCK)},
|
||||
{P9_3, SPI_2, CY_PIN_OUT_FUNCTION( P9_3_SCB2_SPI_SELECT0, PCLK_SCB2_CLOCK)},
|
||||
{P10_3, SPI_1, CY_PIN_OUT_FUNCTION( P10_3_SCB1_SPI_SELECT0, PCLK_SCB1_CLOCK)},
|
||||
{P11_3, SPI_5, CY_PIN_OUT_FUNCTION( P11_3_SCB5_SPI_SELECT0, PCLK_SCB5_CLOCK)},
|
||||
{P12_3, SPI_6, CY_PIN_OUT_FUNCTION( P12_3_SCB6_SPI_SELECT0, PCLK_SCB6_CLOCK)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
#endif // DEVICE_SPI
|
||||
|
||||
#if DEVICE_PWMOUT
|
||||
//*** PWM ***
|
||||
const PinMap PinMap_PWM_OUT[] = {
|
||||
// 16-bit PWM outputs
|
||||
{P0_0, PWM_16b_0, CY_PIN_OUT_FUNCTION(P0_0_TCPWM1_LINE0, PCLK_TCPWM1_CLOCKS0)},
|
||||
{P0_2, PWM_16b_1, CY_PIN_OUT_FUNCTION(P0_2_TCPWM1_LINE1, PCLK_TCPWM1_CLOCKS1)},
|
||||
{P0_4, PWM_16b_2, CY_PIN_OUT_FUNCTION(P0_4_TCPWM1_LINE2, PCLK_TCPWM1_CLOCKS2)},
|
||||
{P1_0, PWM_16b_3, CY_PIN_OUT_FUNCTION(P1_0_TCPWM1_LINE3, PCLK_TCPWM1_CLOCKS3)},
|
||||
{P1_2, PWM_16b_12, CY_PIN_OUT_FUNCTION(P1_2_TCPWM1_LINE12, PCLK_TCPWM1_CLOCKS12)},
|
||||
{P1_4, PWM_16b_13, CY_PIN_OUT_FUNCTION(P1_4_TCPWM1_LINE13, PCLK_TCPWM1_CLOCKS13)},
|
||||
{P2_0, PWM_16b_15, CY_PIN_OUT_FUNCTION(P2_0_TCPWM1_LINE15, PCLK_TCPWM1_CLOCKS15)},
|
||||
{P2_2, PWM_16b_16, CY_PIN_OUT_FUNCTION(P2_2_TCPWM1_LINE16, PCLK_TCPWM1_CLOCKS16)},
|
||||
{P2_4, PWM_16b_17, CY_PIN_OUT_FUNCTION(P2_4_TCPWM1_LINE17, PCLK_TCPWM1_CLOCKS17)},
|
||||
{P2_6, PWM_16b_18, CY_PIN_OUT_FUNCTION(P2_6_TCPWM1_LINE18, PCLK_TCPWM1_CLOCKS18)},
|
||||
{P3_0, PWM_16b_19, CY_PIN_OUT_FUNCTION(P3_0_TCPWM1_LINE19, PCLK_TCPWM1_CLOCKS19)},
|
||||
{P3_2, PWM_16b_20, CY_PIN_OUT_FUNCTION(P3_2_TCPWM1_LINE20, PCLK_TCPWM1_CLOCKS20)},
|
||||
{P3_4, PWM_16b_21, CY_PIN_OUT_FUNCTION(P3_4_TCPWM1_LINE21, PCLK_TCPWM1_CLOCKS21)},
|
||||
{P4_0, PWM_16b_22, CY_PIN_OUT_FUNCTION(P4_0_TCPWM1_LINE22, PCLK_TCPWM1_CLOCKS22)},
|
||||
{P5_0, PWM_16b_4, CY_PIN_OUT_FUNCTION(P5_0_TCPWM1_LINE4, PCLK_TCPWM1_CLOCKS4)},
|
||||
{P5_2, PWM_16b_5, CY_PIN_OUT_FUNCTION(P5_2_TCPWM1_LINE5, PCLK_TCPWM1_CLOCKS5)},
|
||||
{P5_4, PWM_16b_6, CY_PIN_OUT_FUNCTION(P5_4_TCPWM1_LINE6, PCLK_TCPWM1_CLOCKS6)},
|
||||
{P5_6, PWM_16b_7, CY_PIN_OUT_FUNCTION(P5_6_TCPWM1_LINE7, PCLK_TCPWM1_CLOCKS7)},
|
||||
{P6_0, PWM_16b_8, CY_PIN_OUT_FUNCTION(P6_0_TCPWM1_LINE8, PCLK_TCPWM1_CLOCKS8)},
|
||||
{P6_2, PWM_16b_9, CY_PIN_OUT_FUNCTION(P6_2_TCPWM1_LINE9, PCLK_TCPWM1_CLOCKS9)},
|
||||
{P6_4, PWM_16b_10, CY_PIN_OUT_FUNCTION(P6_4_TCPWM1_LINE10, PCLK_TCPWM1_CLOCKS10)},
|
||||
{P6_6, PWM_16b_11, CY_PIN_OUT_FUNCTION(P6_6_TCPWM1_LINE11, PCLK_TCPWM1_CLOCKS11)},
|
||||
{P7_0, PWM_16b_12, CY_PIN_OUT_FUNCTION(P7_0_TCPWM1_LINE12, PCLK_TCPWM1_CLOCKS12)},
|
||||
{P7_2, PWM_16b_13, CY_PIN_OUT_FUNCTION(P7_2_TCPWM1_LINE13, PCLK_TCPWM1_CLOCKS13)},
|
||||
{P7_4, PWM_16b_14, CY_PIN_OUT_FUNCTION(P7_4_TCPWM1_LINE14, PCLK_TCPWM1_CLOCKS14)},
|
||||
{P7_6, PWM_16b_15, CY_PIN_OUT_FUNCTION(P7_6_TCPWM1_LINE15, PCLK_TCPWM1_CLOCKS15)},
|
||||
{P8_0, PWM_16b_16, CY_PIN_OUT_FUNCTION(P8_0_TCPWM1_LINE16, PCLK_TCPWM1_CLOCKS16)},
|
||||
{P8_2, PWM_16b_17, CY_PIN_OUT_FUNCTION(P8_2_TCPWM1_LINE17, PCLK_TCPWM1_CLOCKS17)},
|
||||
{P8_4, PWM_16b_18, CY_PIN_OUT_FUNCTION(P8_4_TCPWM1_LINE18, PCLK_TCPWM1_CLOCKS18)},
|
||||
{P8_6, PWM_16b_19, CY_PIN_OUT_FUNCTION(P8_6_TCPWM1_LINE19, PCLK_TCPWM1_CLOCKS19)},
|
||||
{P9_0, PWM_16b_20, CY_PIN_OUT_FUNCTION(P9_0_TCPWM1_LINE20, PCLK_TCPWM1_CLOCKS20)},
|
||||
{P9_2, PWM_16b_21, CY_PIN_OUT_FUNCTION(P9_2_TCPWM1_LINE21, PCLK_TCPWM1_CLOCKS21)},
|
||||
{P9_4, PWM_16b_0, CY_PIN_OUT_FUNCTION(P9_4_TCPWM1_LINE0, PCLK_TCPWM1_CLOCKS0)},
|
||||
{P9_6, PWM_16b_1, CY_PIN_OUT_FUNCTION(P9_6_TCPWM1_LINE1, PCLK_TCPWM1_CLOCKS1)},
|
||||
{P10_0, PWM_16b_22, CY_PIN_OUT_FUNCTION(P10_0_TCPWM1_LINE22, PCLK_TCPWM1_CLOCKS22)},
|
||||
{P10_2, PWM_16b_23, CY_PIN_OUT_FUNCTION(P10_2_TCPWM1_LINE23, PCLK_TCPWM1_CLOCKS23)},
|
||||
{P10_4, PWM_16b_0, CY_PIN_OUT_FUNCTION(P10_4_TCPWM1_LINE0, PCLK_TCPWM1_CLOCKS0)},
|
||||
{P10_6, PWM_16b_2, CY_PIN_OUT_FUNCTION(P10_6_TCPWM1_LINE2, PCLK_TCPWM1_CLOCKS2)},
|
||||
{P11_0, PWM_16b_1, CY_PIN_OUT_FUNCTION(P11_0_TCPWM1_LINE1, PCLK_TCPWM1_CLOCKS1)},
|
||||
{P11_2, PWM_16b_2, CY_PIN_OUT_FUNCTION(P11_2_TCPWM1_LINE2, PCLK_TCPWM1_CLOCKS2)},
|
||||
{P11_4, PWM_16b_3, CY_PIN_OUT_FUNCTION(P11_4_TCPWM1_LINE3, PCLK_TCPWM1_CLOCKS3)},
|
||||
{P12_0, PWM_16b_4, CY_PIN_OUT_FUNCTION(P12_0_TCPWM1_LINE4, PCLK_TCPWM1_CLOCKS4)},
|
||||
{P12_2, PWM_16b_5, CY_PIN_OUT_FUNCTION(P12_2_TCPWM1_LINE5, PCLK_TCPWM1_CLOCKS5)},
|
||||
{P12_4, PWM_16b_6, CY_PIN_OUT_FUNCTION(P12_4_TCPWM1_LINE6, PCLK_TCPWM1_CLOCKS6)},
|
||||
{P12_6, PWM_16b_7, CY_PIN_OUT_FUNCTION(P12_6_TCPWM1_LINE7, PCLK_TCPWM1_CLOCKS7)},
|
||||
{P13_0, PWM_16b_8, CY_PIN_OUT_FUNCTION(P13_0_TCPWM1_LINE8, PCLK_TCPWM1_CLOCKS8)},
|
||||
{P13_2, PWM_16b_9, CY_PIN_OUT_FUNCTION(P13_2_TCPWM1_LINE9, PCLK_TCPWM1_CLOCKS9)},
|
||||
{P13_4, PWM_16b_10, CY_PIN_OUT_FUNCTION(P13_4_TCPWM1_LINE10, PCLK_TCPWM1_CLOCKS10)},
|
||||
{P13_6, PWM_16b_11, CY_PIN_OUT_FUNCTION(P13_6_TCPWM1_LINE11, PCLK_TCPWM1_CLOCKS11)},
|
||||
// 16-bit PWM inverted outputs
|
||||
{P0_1, PWM_16b_0, CY_PIN_OUT_FUNCTION(P0_1_TCPWM1_LINE_COMPL0, PCLK_TCPWM1_CLOCKS0)},
|
||||
{P0_3, PWM_16b_1, CY_PIN_OUT_FUNCTION(P0_3_TCPWM1_LINE_COMPL1, PCLK_TCPWM1_CLOCKS1)},
|
||||
{P0_5, PWM_16b_2, CY_PIN_OUT_FUNCTION(P0_5_TCPWM1_LINE_COMPL2, PCLK_TCPWM1_CLOCKS2)},
|
||||
{P1_1, PWM_16b_3, CY_PIN_OUT_FUNCTION(P1_1_TCPWM1_LINE_COMPL3, PCLK_TCPWM1_CLOCKS3)},
|
||||
{P1_3, PWM_16b_12, CY_PIN_OUT_FUNCTION(P1_3_TCPWM1_LINE_COMPL12, PCLK_TCPWM1_CLOCKS12)},
|
||||
{P1_5, PWM_16b_14, CY_PIN_OUT_FUNCTION(P1_5_TCPWM1_LINE_COMPL14, PCLK_TCPWM1_CLOCKS14)},
|
||||
{P2_1, PWM_16b_15, CY_PIN_OUT_FUNCTION(P2_1_TCPWM1_LINE_COMPL15, PCLK_TCPWM1_CLOCKS15)},
|
||||
{P2_3, PWM_16b_16, CY_PIN_OUT_FUNCTION(P2_3_TCPWM1_LINE_COMPL16, PCLK_TCPWM1_CLOCKS16)},
|
||||
{P2_5, PWM_16b_17, CY_PIN_OUT_FUNCTION(P2_5_TCPWM1_LINE_COMPL17, PCLK_TCPWM1_CLOCKS17)},
|
||||
{P2_7, PWM_16b_18, CY_PIN_OUT_FUNCTION(P2_7_TCPWM1_LINE_COMPL18, PCLK_TCPWM1_CLOCKS18)},
|
||||
{P3_1, PWM_16b_19, CY_PIN_OUT_FUNCTION(P3_1_TCPWM1_LINE_COMPL19, PCLK_TCPWM1_CLOCKS19)},
|
||||
{P3_3, PWM_16b_20, CY_PIN_OUT_FUNCTION(P3_3_TCPWM1_LINE_COMPL20, PCLK_TCPWM1_CLOCKS20)},
|
||||
{P3_5, PWM_16b_21, CY_PIN_OUT_FUNCTION(P3_5_TCPWM1_LINE_COMPL21, PCLK_TCPWM1_CLOCKS21)},
|
||||
{P4_1, PWM_16b_22, CY_PIN_OUT_FUNCTION(P4_1_TCPWM1_LINE_COMPL22, PCLK_TCPWM1_CLOCKS22)},
|
||||
{P5_1, PWM_16b_4, CY_PIN_OUT_FUNCTION(P5_1_TCPWM1_LINE_COMPL4, PCLK_TCPWM1_CLOCKS4)},
|
||||
{P5_3, PWM_16b_5, CY_PIN_OUT_FUNCTION(P5_3_TCPWM1_LINE_COMPL5, PCLK_TCPWM1_CLOCKS5)},
|
||||
{P5_5, PWM_16b_6, CY_PIN_OUT_FUNCTION(P5_5_TCPWM1_LINE_COMPL6, PCLK_TCPWM1_CLOCKS6)},
|
||||
{P5_7, PWM_16b_7, CY_PIN_OUT_FUNCTION(P5_7_TCPWM1_LINE_COMPL7, PCLK_TCPWM1_CLOCKS7)},
|
||||
{P6_1, PWM_16b_8, CY_PIN_OUT_FUNCTION(P6_1_TCPWM1_LINE_COMPL8, PCLK_TCPWM1_CLOCKS8)},
|
||||
{P6_3, PWM_16b_9, CY_PIN_OUT_FUNCTION(P6_3_TCPWM1_LINE_COMPL9, PCLK_TCPWM1_CLOCKS9)},
|
||||
{P6_5, PWM_16b_10, CY_PIN_OUT_FUNCTION(P6_5_TCPWM1_LINE_COMPL10, PCLK_TCPWM1_CLOCKS10)},
|
||||
{P6_7, PWM_16b_11, CY_PIN_OUT_FUNCTION(P6_7_TCPWM1_LINE_COMPL11, PCLK_TCPWM1_CLOCKS11)},
|
||||
{P7_1, PWM_16b_12, CY_PIN_OUT_FUNCTION(P7_1_TCPWM1_LINE_COMPL12, PCLK_TCPWM1_CLOCKS12)},
|
||||
{P7_3, PWM_16b_13, CY_PIN_OUT_FUNCTION(P7_3_TCPWM1_LINE_COMPL13, PCLK_TCPWM1_CLOCKS13)},
|
||||
{P7_5, PWM_16b_14, CY_PIN_OUT_FUNCTION(P7_5_TCPWM1_LINE_COMPL14, PCLK_TCPWM1_CLOCKS14)},
|
||||
{P7_7, PWM_16b_15, CY_PIN_OUT_FUNCTION(P7_7_TCPWM1_LINE_COMPL15, PCLK_TCPWM1_CLOCKS15)},
|
||||
{P8_1, PWM_16b_16, CY_PIN_OUT_FUNCTION(P8_1_TCPWM1_LINE_COMPL16, PCLK_TCPWM1_CLOCKS16)},
|
||||
{P8_3, PWM_16b_17, CY_PIN_OUT_FUNCTION(P8_3_TCPWM1_LINE_COMPL17, PCLK_TCPWM1_CLOCKS17)},
|
||||
{P8_5, PWM_16b_18, CY_PIN_OUT_FUNCTION(P8_5_TCPWM1_LINE_COMPL18, PCLK_TCPWM1_CLOCKS18)},
|
||||
{P8_7, PWM_16b_19, CY_PIN_OUT_FUNCTION(P8_7_TCPWM1_LINE_COMPL19, PCLK_TCPWM1_CLOCKS19)},
|
||||
{P9_1, PWM_16b_20, CY_PIN_OUT_FUNCTION(P9_1_TCPWM1_LINE_COMPL20, PCLK_TCPWM1_CLOCKS20)},
|
||||
{P9_3, PWM_16b_21, CY_PIN_OUT_FUNCTION(P9_3_TCPWM1_LINE_COMPL21, PCLK_TCPWM1_CLOCKS21)},
|
||||
{P9_5, PWM_16b_0, CY_PIN_OUT_FUNCTION(P9_5_TCPWM1_LINE_COMPL0, PCLK_TCPWM1_CLOCKS0)},
|
||||
{P9_7, PWM_16b_1, CY_PIN_OUT_FUNCTION(P9_7_TCPWM1_LINE_COMPL1, PCLK_TCPWM1_CLOCKS1)},
|
||||
{P10_1, PWM_16b_22, CY_PIN_OUT_FUNCTION(P10_1_TCPWM1_LINE_COMPL22, PCLK_TCPWM1_CLOCKS22)},
|
||||
{P10_3, PWM_16b_23, CY_PIN_OUT_FUNCTION(P10_3_TCPWM1_LINE_COMPL23, PCLK_TCPWM1_CLOCKS23)},
|
||||
{P10_5, PWM_16b_0, CY_PIN_OUT_FUNCTION(P10_5_TCPWM1_LINE_COMPL0, PCLK_TCPWM1_CLOCKS0)},
|
||||
{P10_7, PWM_16b_2, CY_PIN_OUT_FUNCTION(P10_7_TCPWM1_LINE_COMPL2, PCLK_TCPWM1_CLOCKS2)},
|
||||
{P11_1, PWM_16b_1, CY_PIN_OUT_FUNCTION(P11_1_TCPWM1_LINE_COMPL1, PCLK_TCPWM1_CLOCKS1)},
|
||||
{P11_3, PWM_16b_2, CY_PIN_OUT_FUNCTION(P11_3_TCPWM1_LINE_COMPL2, PCLK_TCPWM1_CLOCKS2)},
|
||||
{P11_5, PWM_16b_3, CY_PIN_OUT_FUNCTION(P11_5_TCPWM1_LINE_COMPL3, PCLK_TCPWM1_CLOCKS3)},
|
||||
{P12_1, PWM_16b_4, CY_PIN_OUT_FUNCTION(P12_1_TCPWM1_LINE_COMPL4, PCLK_TCPWM1_CLOCKS4)},
|
||||
{P12_3, PWM_16b_5, CY_PIN_OUT_FUNCTION(P12_3_TCPWM1_LINE_COMPL5, PCLK_TCPWM1_CLOCKS5)},
|
||||
{P12_5, PWM_16b_6, CY_PIN_OUT_FUNCTION(P12_5_TCPWM1_LINE_COMPL6, PCLK_TCPWM1_CLOCKS6)},
|
||||
{P12_7, PWM_16b_7, CY_PIN_OUT_FUNCTION(P12_7_TCPWM1_LINE_COMPL7, PCLK_TCPWM1_CLOCKS7)},
|
||||
{P13_1, PWM_16b_8, CY_PIN_OUT_FUNCTION(P13_1_TCPWM1_LINE_COMPL8, PCLK_TCPWM1_CLOCKS8)},
|
||||
{P13_3, PWM_16b_9, CY_PIN_OUT_FUNCTION(P13_3_TCPWM1_LINE_COMPL9, PCLK_TCPWM1_CLOCKS9)},
|
||||
{P13_5, PWM_16b_10, CY_PIN_OUT_FUNCTION(P13_5_TCPWM1_LINE_COMPL10, PCLK_TCPWM1_CLOCKS10)},
|
||||
{P13_7, PWM_16b_11, CY_PIN_OUT_FUNCTION(P13_7_TCPWM1_LINE_COMPL11, PCLK_TCPWM1_CLOCKS11)},
|
||||
// 32-bit PWM outputs
|
||||
{PWM32(P0_0), PWM_32b_0, CY_PIN_OUT_FUNCTION(P0_0_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P0_2), PWM_32b_1, CY_PIN_OUT_FUNCTION(P0_2_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P0_4), PWM_32b_2, CY_PIN_OUT_FUNCTION(P0_4_TCPWM0_LINE2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P1_0), PWM_32b_3, CY_PIN_OUT_FUNCTION(P1_0_TCPWM0_LINE3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P1_2), PWM_32b_4, CY_PIN_OUT_FUNCTION(P1_2_TCPWM0_LINE4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P1_4), PWM_32b_5, CY_PIN_OUT_FUNCTION(P1_4_TCPWM0_LINE5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P2_0), PWM_32b_6, CY_PIN_OUT_FUNCTION(P2_0_TCPWM0_LINE6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P2_2), PWM_32b_7, CY_PIN_OUT_FUNCTION(P2_2_TCPWM0_LINE7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P2_4), PWM_32b_0, CY_PIN_OUT_FUNCTION(P2_4_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P2_6), PWM_32b_1, CY_PIN_OUT_FUNCTION(P2_6_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P3_0), PWM_32b_2, CY_PIN_OUT_FUNCTION(P3_0_TCPWM0_LINE2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P3_2), PWM_32b_3, CY_PIN_OUT_FUNCTION(P3_2_TCPWM0_LINE3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P3_4), PWM_32b_4, CY_PIN_OUT_FUNCTION(P3_4_TCPWM0_LINE4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P4_0), PWM_32b_5, CY_PIN_OUT_FUNCTION(P4_0_TCPWM0_LINE5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P5_0), PWM_32b_4, CY_PIN_OUT_FUNCTION(P5_0_TCPWM0_LINE4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P5_2), PWM_32b_5, CY_PIN_OUT_FUNCTION(P5_2_TCPWM0_LINE5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P5_4), PWM_32b_6, CY_PIN_OUT_FUNCTION(P5_4_TCPWM0_LINE6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P5_6), PWM_32b_7, CY_PIN_OUT_FUNCTION(P5_6_TCPWM0_LINE7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P6_0), PWM_32b_0, CY_PIN_OUT_FUNCTION(P6_0_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P6_2), PWM_32b_1, CY_PIN_OUT_FUNCTION(P6_2_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P6_4), PWM_32b_2, CY_PIN_OUT_FUNCTION(P6_4_TCPWM0_LINE2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P6_6), PWM_32b_3, CY_PIN_OUT_FUNCTION(P6_6_TCPWM0_LINE3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P7_0), PWM_32b_4, CY_PIN_OUT_FUNCTION(P7_0_TCPWM0_LINE4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P7_2), PWM_32b_5, CY_PIN_OUT_FUNCTION(P7_2_TCPWM0_LINE5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P7_4), PWM_32b_6, CY_PIN_OUT_FUNCTION(P7_4_TCPWM0_LINE6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P7_6), PWM_32b_7, CY_PIN_OUT_FUNCTION(P7_6_TCPWM0_LINE7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P8_0), PWM_32b_0, CY_PIN_OUT_FUNCTION(P8_0_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P8_2), PWM_32b_1, CY_PIN_OUT_FUNCTION(P8_2_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P8_4), PWM_32b_2, CY_PIN_OUT_FUNCTION(P8_4_TCPWM0_LINE2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P8_6), PWM_32b_3, CY_PIN_OUT_FUNCTION(P8_6_TCPWM0_LINE3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P9_0), PWM_32b_4, CY_PIN_OUT_FUNCTION(P9_0_TCPWM0_LINE4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P9_2), PWM_32b_5, CY_PIN_OUT_FUNCTION(P9_2_TCPWM0_LINE5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P9_4), PWM_32b_7, CY_PIN_OUT_FUNCTION(P9_4_TCPWM0_LINE7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P9_6), PWM_32b_0, CY_PIN_OUT_FUNCTION(P9_6_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P10_0), PWM_32b_6, CY_PIN_OUT_FUNCTION(P10_0_TCPWM0_LINE6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P10_2), PWM_32b_7, CY_PIN_OUT_FUNCTION(P10_2_TCPWM0_LINE7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P10_4), PWM_32b_0, CY_PIN_OUT_FUNCTION(P10_4_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P10_6), PWM_32b_1, CY_PIN_OUT_FUNCTION(P10_6_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P11_0), PWM_32b_1, CY_PIN_OUT_FUNCTION(P11_0_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P11_2), PWM_32b_2, CY_PIN_OUT_FUNCTION(P11_2_TCPWM0_LINE2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P11_4), PWM_32b_3, CY_PIN_OUT_FUNCTION(P11_4_TCPWM0_LINE3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P12_0), PWM_32b_4, CY_PIN_OUT_FUNCTION(P12_0_TCPWM0_LINE4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P12_2), PWM_32b_5, CY_PIN_OUT_FUNCTION(P12_2_TCPWM0_LINE5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P12_4), PWM_32b_6, CY_PIN_OUT_FUNCTION(P12_4_TCPWM0_LINE6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P12_6), PWM_32b_7, CY_PIN_OUT_FUNCTION(P12_6_TCPWM0_LINE7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P13_0), PWM_32b_0, CY_PIN_OUT_FUNCTION(P13_0_TCPWM0_LINE0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P13_2), PWM_32b_1, CY_PIN_OUT_FUNCTION(P13_2_TCPWM0_LINE1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P13_4), PWM_32b_2, CY_PIN_OUT_FUNCTION(P13_4_TCPWM0_LINE2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P13_6), PWM_32b_3, CY_PIN_OUT_FUNCTION(P13_6_TCPWM0_LINE3, PCLK_TCPWM0_CLOCKS3)},
|
||||
// 32-bit PWM inverted outputs
|
||||
{PWM32(P0_1), PWM_32b_0, CY_PIN_OUT_FUNCTION(P0_1_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P0_3), PWM_32b_1, CY_PIN_OUT_FUNCTION(P0_3_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P0_5), PWM_32b_2, CY_PIN_OUT_FUNCTION(P0_5_TCPWM0_LINE_COMPL2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P1_1), PWM_32b_3, CY_PIN_OUT_FUNCTION(P1_1_TCPWM0_LINE_COMPL3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P1_3), PWM_32b_4, CY_PIN_OUT_FUNCTION(P1_3_TCPWM0_LINE_COMPL4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P1_5), PWM_32b_5, CY_PIN_OUT_FUNCTION(P1_5_TCPWM0_LINE_COMPL5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P2_1), PWM_32b_6, CY_PIN_OUT_FUNCTION(P2_1_TCPWM0_LINE_COMPL6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P2_3), PWM_32b_7, CY_PIN_OUT_FUNCTION(P2_3_TCPWM0_LINE_COMPL7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P2_5), PWM_32b_0, CY_PIN_OUT_FUNCTION(P2_5_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P2_7), PWM_32b_1, CY_PIN_OUT_FUNCTION(P2_7_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P3_1), PWM_32b_2, CY_PIN_OUT_FUNCTION(P3_1_TCPWM0_LINE_COMPL2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P3_3), PWM_32b_3, CY_PIN_OUT_FUNCTION(P3_3_TCPWM0_LINE_COMPL3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P3_5), PWM_32b_4, CY_PIN_OUT_FUNCTION(P3_5_TCPWM0_LINE_COMPL4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P4_1), PWM_32b_5, CY_PIN_OUT_FUNCTION(P4_1_TCPWM0_LINE_COMPL5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P5_1), PWM_32b_4, CY_PIN_OUT_FUNCTION(P5_1_TCPWM0_LINE_COMPL4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P5_3), PWM_32b_5, CY_PIN_OUT_FUNCTION(P5_3_TCPWM0_LINE_COMPL5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P5_5), PWM_32b_6, CY_PIN_OUT_FUNCTION(P5_5_TCPWM0_LINE_COMPL6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P5_7), PWM_32b_7, CY_PIN_OUT_FUNCTION(P5_7_TCPWM0_LINE_COMPL7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P6_1), PWM_32b_0, CY_PIN_OUT_FUNCTION(P6_1_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P6_3), PWM_32b_1, CY_PIN_OUT_FUNCTION(P6_3_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P6_5), PWM_32b_2, CY_PIN_OUT_FUNCTION(P6_5_TCPWM0_LINE_COMPL2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P6_7), PWM_32b_3, CY_PIN_OUT_FUNCTION(P6_7_TCPWM0_LINE_COMPL3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P7_1), PWM_32b_4, CY_PIN_OUT_FUNCTION(P7_1_TCPWM0_LINE_COMPL4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P7_3), PWM_32b_5, CY_PIN_OUT_FUNCTION(P7_3_TCPWM0_LINE_COMPL5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P7_5), PWM_32b_6, CY_PIN_OUT_FUNCTION(P7_5_TCPWM0_LINE_COMPL6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P7_7), PWM_32b_7, CY_PIN_OUT_FUNCTION(P7_7_TCPWM0_LINE_COMPL7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P8_1), PWM_32b_0, CY_PIN_OUT_FUNCTION(P8_1_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P8_3), PWM_32b_1, CY_PIN_OUT_FUNCTION(P8_3_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P8_5), PWM_32b_2, CY_PIN_OUT_FUNCTION(P8_5_TCPWM0_LINE_COMPL2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P8_7), PWM_32b_3, CY_PIN_OUT_FUNCTION(P8_7_TCPWM0_LINE_COMPL3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P9_1), PWM_32b_4, CY_PIN_OUT_FUNCTION(P9_1_TCPWM0_LINE_COMPL4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P9_3), PWM_32b_5, CY_PIN_OUT_FUNCTION(P9_3_TCPWM0_LINE_COMPL5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P9_5), PWM_32b_7, CY_PIN_OUT_FUNCTION(P9_5_TCPWM0_LINE_COMPL7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P9_7), PWM_32b_0, CY_PIN_OUT_FUNCTION(P9_7_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P10_1), PWM_32b_6, CY_PIN_OUT_FUNCTION(P10_1_TCPWM0_LINE_COMPL6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P10_3), PWM_32b_7, CY_PIN_OUT_FUNCTION(P10_3_TCPWM0_LINE_COMPL7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P10_5), PWM_32b_0, CY_PIN_OUT_FUNCTION(P10_5_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P10_7), PWM_32b_1, CY_PIN_OUT_FUNCTION(P10_7_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P11_1), PWM_32b_1, CY_PIN_OUT_FUNCTION(P11_1_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P11_3), PWM_32b_2, CY_PIN_OUT_FUNCTION(P11_3_TCPWM0_LINE_COMPL2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P11_5), PWM_32b_3, CY_PIN_OUT_FUNCTION(P11_5_TCPWM0_LINE_COMPL3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{PWM32(P12_1), PWM_32b_4, CY_PIN_OUT_FUNCTION(P12_1_TCPWM0_LINE_COMPL4, PCLK_TCPWM0_CLOCKS4)},
|
||||
{PWM32(P12_3), PWM_32b_5, CY_PIN_OUT_FUNCTION(P12_3_TCPWM0_LINE_COMPL5, PCLK_TCPWM0_CLOCKS5)},
|
||||
{PWM32(P12_5), PWM_32b_6, CY_PIN_OUT_FUNCTION(P12_5_TCPWM0_LINE_COMPL6, PCLK_TCPWM0_CLOCKS6)},
|
||||
{PWM32(P12_7), PWM_32b_7, CY_PIN_OUT_FUNCTION(P12_7_TCPWM0_LINE_COMPL7, PCLK_TCPWM0_CLOCKS7)},
|
||||
{PWM32(P13_1), PWM_32b_0, CY_PIN_OUT_FUNCTION(P13_1_TCPWM0_LINE_COMPL0, PCLK_TCPWM0_CLOCKS0)},
|
||||
{PWM32(P13_3), PWM_32b_1, CY_PIN_OUT_FUNCTION(P13_3_TCPWM0_LINE_COMPL1, PCLK_TCPWM0_CLOCKS1)},
|
||||
{PWM32(P13_5), PWM_32b_2, CY_PIN_OUT_FUNCTION(P13_5_TCPWM0_LINE_COMPL2, PCLK_TCPWM0_CLOCKS2)},
|
||||
{PWM32(P13_7), PWM_32b_3, CY_PIN_OUT_FUNCTION(P13_7_TCPWM0_LINE_COMPL3, PCLK_TCPWM0_CLOCKS3)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
#endif // DEVICE_PWMOUT
|
||||
|
||||
#if DEVICE_ANALOGIN
|
||||
const PinMap PinMap_ADC[] = {
|
||||
{P10_0, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_1, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_2, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_3, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_4, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_5, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_6, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{P10_7, ADC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_SAR)},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
#endif // DEVICE_ANALOGIN
|
||||
|
||||
#if DEVICE_ANALOGOUT
|
||||
const PinMap PinMap_DAC[] = {
|
||||
{P9_6, DAC_0, CY_PIN_ANALOG_FUNCTION(PCLK_PASS_CLOCK_CTDAC)},
|
||||
{P10_5, DAC_0, CY_PIN_FUNCTION(HSIOM_SEL_AMUXA, PCLK_PASS_CLOCK_CTDAC, AnalogMode, 0)}, // CTDAC connects to the P10_5 pin through the AMUXA bus
|
||||
{NC, NC, 0}
|
||||
};
|
||||
#endif // DEVICE_ANALOGIN
|
|
@ -0,0 +1,310 @@
|
|||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xx7_cm0plus.scat
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
;* The main purpose of the linker script is to describe how the sections in the
|
||||
;* input files should be mapped into the output file, and to control the memory
|
||||
;* layout of the output file.
|
||||
;*
|
||||
;* \note The entry point location is fixed and starts at 0x10000000. The valid
|
||||
;* application image should be placed there.
|
||||
;*
|
||||
;* \note The linker files included with the PDL template projects must be
|
||||
;* generic and handle all common use cases. Your project may not use every
|
||||
;* section defined in the linker files. In that case you may see the warnings
|
||||
;* during the build process: L6314W (no section matches pattern) and/or L6329W
|
||||
;* (pattern only matches removed unused sections). In your project, you can
|
||||
;* suppress the warning by passing the "--diag_suppress=L6314W,L6329W" option to
|
||||
;* the linker, simply comment out or remove the relevant code in the linker
|
||||
;* file.
|
||||
;*
|
||||
;*******************************************************************************
|
||||
;* \copyright
|
||||
;* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
;* 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
|
||||
;*
|
||||
;* 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.
|
||||
;******************************************************************************/
|
||||
|
||||
#if !defined(MBED_ROM_START)
|
||||
#define MBED_ROM_START 0x10000000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_START is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
;* is equal to MBED_ROM_START
|
||||
;*
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
;* is equal to MBED_ROM_SIZE
|
||||
;*
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x00010000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_PUBLIC_RAM_START)
|
||||
#define MBED_PUBLIC_RAM_START 0x08047600
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_PUBLIC_RAM_SIZE)
|
||||
#define MBED_PUBLIC_RAM_SIZE 0x200
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
|
||||
; The defines below describe the location and size of blocks of memory in the target.
|
||||
; Use these defines to specify the memory regions available for allocation.
|
||||
|
||||
; The following defines control RAM and flash memory allocation for the CM0+ core.
|
||||
; You can change the memory allocation by editing the RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for the CM4 core in 'xx_cm4_dual.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.scat'.
|
||||
; RAM
|
||||
#define RAM_START MBED_RAM_START
|
||||
#define RAM_SIZE MBED_RAM_SIZE
|
||||
; Public RAM
|
||||
#define PUBLIC_RAM_START MBED_PUBLIC_RAM_START
|
||||
#define PUBLIC_RAM_SIZE MBED_PUBLIC_RAM_SIZE
|
||||
; Flash
|
||||
#define FLASH_START MBED_APP_START
|
||||
#define FLASH_SIZE MBED_APP_SIZE
|
||||
|
||||
; The following defines describe a 32K flash region used for EEPROM emulation.
|
||||
; This region can also be used as the general purpose flash.
|
||||
; You can assign sections to this memory region for only one of the cores.
|
||||
; Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
|
||||
; Therefore, repurposing this memory region will prevent such middleware from operation.
|
||||
#define EM_EEPROM_START 0x14000000
|
||||
#define EM_EEPROM_SIZE 0x8000
|
||||
|
||||
; The following defines describe device specific memory regions and must not be changed.
|
||||
; Supervisory flash: User data
|
||||
#define SFLASH_USER_DATA_START 0x16000800
|
||||
#define SFLASH_USER_DATA_SIZE 0x00000800
|
||||
|
||||
; Supervisory flash: Normal Access Restrictions (NAR)
|
||||
#define SFLASH_NAR_START 0x16001A00
|
||||
#define SFLASH_NAR_SIZE 0x00000200
|
||||
|
||||
; Supervisory flash: Public Key
|
||||
#define SFLASH_PUBLIC_KEY_START 0x16005A00
|
||||
#define SFLASH_PUBLIC_KEY_SIZE 0x00000C00
|
||||
|
||||
; Supervisory flash: Table of Content # 2
|
||||
#define SFLASH_TOC_2_START 0x16007C00
|
||||
#define SFLASH_TOC_2_SIZE 0x00000200
|
||||
|
||||
; Supervisory flash: Table of Content # 2 Copy
|
||||
#define SFLASH_RTOC_2_START 0x16007E00
|
||||
#define SFLASH_RTOC_2_SIZE 0x00000200
|
||||
|
||||
; External memory
|
||||
#define XIP_START 0x18000000
|
||||
#define XIP_SIZE 0x08000000
|
||||
|
||||
; eFuse
|
||||
#define EFUSE_START 0x90700000
|
||||
#define EFUSE_SIZE 0x100000
|
||||
|
||||
|
||||
LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
|
||||
{
|
||||
.cy_app_header +0
|
||||
{
|
||||
* (.cy_app_header)
|
||||
}
|
||||
|
||||
ER_FLASH_VECTORS +0
|
||||
{
|
||||
* (RESET, +FIRST)
|
||||
}
|
||||
|
||||
ER_FLASH_CODE +0 FIXED
|
||||
{
|
||||
* (InRoot$$Sections)
|
||||
* (+RO)
|
||||
}
|
||||
|
||||
ER_RAM_VECTORS RAM_START UNINIT
|
||||
{
|
||||
* (RESET_RAM, +FIRST)
|
||||
}
|
||||
|
||||
RW_RAM_DATA +0
|
||||
{
|
||||
* (.cy_ramfunc)
|
||||
.ANY (+RW, +ZI)
|
||||
}
|
||||
|
||||
; Place variables in the section that should not be initialized during the
|
||||
; device startup.
|
||||
RW_IRAM1 +0 UNINIT
|
||||
{
|
||||
* (.noinit)
|
||||
}
|
||||
|
||||
RW_IRAM2 PUBLIC_RAM_START UNINIT
|
||||
{
|
||||
* (.cy_sharedmem)
|
||||
}
|
||||
|
||||
; Application heap area (HEAP)
|
||||
ARM_LIB_HEAP +0
|
||||
{
|
||||
* (HEAP)
|
||||
}
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK RAM_START+RAM_SIZE -Stack_Size
|
||||
{
|
||||
* (STACK)
|
||||
}
|
||||
}
|
||||
|
||||
; Emulated EEPROM Flash area
|
||||
LR_EM_EEPROM EM_EEPROM_START EM_EEPROM_SIZE
|
||||
{
|
||||
.cy_em_eeprom +0
|
||||
{
|
||||
* (.cy_em_eeprom)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: User data
|
||||
LR_SFLASH_USER_DATA SFLASH_USER_DATA_START SFLASH_USER_DATA_SIZE
|
||||
{
|
||||
.cy_sflash_user_data +0
|
||||
{
|
||||
* (.cy_sflash_user_data)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Normal Access Restrictions (NAR)
|
||||
LR_SFLASH_NAR SFLASH_NAR_START SFLASH_NAR_SIZE
|
||||
{
|
||||
.cy_sflash_nar +0
|
||||
{
|
||||
* (.cy_sflash_nar)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Public Key
|
||||
LR_SFLASH_PUBLIC_KEY SFLASH_PUBLIC_KEY_START SFLASH_PUBLIC_KEY_SIZE
|
||||
{
|
||||
.cy_sflash_public_key +0
|
||||
{
|
||||
* (.cy_sflash_public_key)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Table of Content # 2
|
||||
LR_SFLASH_TOC_2 SFLASH_TOC_2_START SFLASH_TOC_2_SIZE
|
||||
{
|
||||
.cy_toc_part2 +0
|
||||
{
|
||||
* (.cy_toc_part2)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Table of Content # 2 Copy
|
||||
LR_SFLASH_RTOC_2 SFLASH_RTOC_2_START SFLASH_RTOC_2_SIZE
|
||||
{
|
||||
.cy_rtoc_part2 +0
|
||||
{
|
||||
* (.cy_rtoc_part2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Places the code in the Execute in Place (XIP) section. See the smif driver documentation for details.
|
||||
LR_EROM XIP_START XIP_SIZE
|
||||
{
|
||||
.cy_xip +0
|
||||
{
|
||||
* (.cy_xip)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; eFuse
|
||||
LR_EFUSE EFUSE_START EFUSE_SIZE
|
||||
{
|
||||
.cy_efuse +0
|
||||
{
|
||||
* (.cy_efuse)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; The section is used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage.
|
||||
CYMETA 0x90500000
|
||||
{
|
||||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00100000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,315 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm0plus.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM0plus Device Series
|
||||
; * @version V5.00
|
||||
; * @date 02. March 2016
|
||||
; ******************************************************************************/
|
||||
;/*
|
||||
; * Copyright (c) 2009-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.
|
||||
; */
|
||||
|
||||
;/*
|
||||
;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
;*/
|
||||
|
||||
; <h> Stack Configuration
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
IF :DEF:__STACK_SIZE
|
||||
Stack_Size EQU __STACK_SIZE
|
||||
ELSE
|
||||
Stack_Size EQU 0x00000400
|
||||
ENDIF
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
IF :DEF:__HEAP_SIZE
|
||||
Heap_Size EQU __HEAP_SIZE
|
||||
ELSE
|
||||
Heap_Size EQU 0x00000400
|
||||
ENDIF
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
Heap_Mem SPACE Heap_Size
|
||||
__heap_limit
|
||||
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
|
||||
__Vectors DCD __initial_sp ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
|
||||
DCD 0x0000000D ; NMI Handler located at ROM code
|
||||
DCD HardFault_Handler ; Hard Fault Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD SVC_Handler ; SVCall Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External interrupts Description
|
||||
DCD NvicMux0_IRQHandler ; CM0+ NVIC Mux input 0
|
||||
DCD NvicMux1_IRQHandler ; CM0+ NVIC Mux input 1
|
||||
DCD NvicMux2_IRQHandler ; CM0+ NVIC Mux input 2
|
||||
DCD NvicMux3_IRQHandler ; CM0+ NVIC Mux input 3
|
||||
DCD NvicMux4_IRQHandler ; CM0+ NVIC Mux input 4
|
||||
DCD NvicMux5_IRQHandler ; CM0+ NVIC Mux input 5
|
||||
DCD NvicMux6_IRQHandler ; CM0+ NVIC Mux input 6
|
||||
DCD NvicMux7_IRQHandler ; CM0+ NVIC Mux input 7
|
||||
DCD NvicMux8_IRQHandler ; CM0+ NVIC Mux input 8
|
||||
DCD NvicMux9_IRQHandler ; CM0+ NVIC Mux input 9
|
||||
DCD NvicMux10_IRQHandler ; CM0+ NVIC Mux input 10
|
||||
DCD NvicMux11_IRQHandler ; CM0+ NVIC Mux input 11
|
||||
DCD NvicMux12_IRQHandler ; CM0+ NVIC Mux input 12
|
||||
DCD NvicMux13_IRQHandler ; CM0+ NVIC Mux input 13
|
||||
DCD NvicMux14_IRQHandler ; CM0+ NVIC Mux input 14
|
||||
DCD NvicMux15_IRQHandler ; CM0+ NVIC Mux input 15
|
||||
DCD NvicMux16_IRQHandler ; CM0+ NVIC Mux input 16
|
||||
DCD NvicMux17_IRQHandler ; CM0+ NVIC Mux input 17
|
||||
DCD NvicMux18_IRQHandler ; CM0+ NVIC Mux input 18
|
||||
DCD NvicMux19_IRQHandler ; CM0+ NVIC Mux input 19
|
||||
DCD NvicMux20_IRQHandler ; CM0+ NVIC Mux input 20
|
||||
DCD NvicMux21_IRQHandler ; CM0+ NVIC Mux input 21
|
||||
DCD NvicMux22_IRQHandler ; CM0+ NVIC Mux input 22
|
||||
DCD NvicMux23_IRQHandler ; CM0+ NVIC Mux input 23
|
||||
DCD NvicMux24_IRQHandler ; CM0+ NVIC Mux input 24
|
||||
DCD NvicMux25_IRQHandler ; CM0+ NVIC Mux input 25
|
||||
DCD NvicMux26_IRQHandler ; CM0+ NVIC Mux input 26
|
||||
DCD NvicMux27_IRQHandler ; CM0+ NVIC Mux input 27
|
||||
DCD NvicMux28_IRQHandler ; CM0+ NVIC Mux input 28
|
||||
DCD NvicMux29_IRQHandler ; CM0+ NVIC Mux input 29
|
||||
DCD NvicMux30_IRQHandler ; CM0+ NVIC Mux input 30
|
||||
DCD NvicMux31_IRQHandler ; CM0+ NVIC Mux input 31
|
||||
|
||||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
EXPORT __ramVectors
|
||||
AREA RESET_RAM, READWRITE, NOINIT
|
||||
__ramVectors SPACE __Vectors_Size
|
||||
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
|
||||
; Weak function for startup customization
|
||||
;
|
||||
; Note. The global resources are not yet initialized (for example global variables, peripherals, clocks)
|
||||
; because this function is executed as the first instruction in the ResetHandler.
|
||||
; The PDL is also not initialized to use the proper register offsets.
|
||||
; The user of this function is responsible for initializing the PDL and resources before using them.
|
||||
;
|
||||
Cy_OnResetUser PROC
|
||||
EXPORT Cy_OnResetUser [WEAK]
|
||||
BX LR
|
||||
ENDP
|
||||
|
||||
; Reset Handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT __main
|
||||
|
||||
; Define strong function for startup customization
|
||||
BL Cy_OnResetUser
|
||||
|
||||
; Copy vectors from ROM to RAM
|
||||
LDR r1, =__Vectors
|
||||
LDR r0, =__ramVectors
|
||||
LDR r2, =__Vectors_Size
|
||||
Vectors_Copy
|
||||
LDR r3, [r1]
|
||||
STR r3, [r0]
|
||||
ADDS r0, r0, #4
|
||||
ADDS r1, r1, #4
|
||||
SUBS r2, r2, #1
|
||||
CMP r2, #0
|
||||
BNE Vectors_Copy
|
||||
|
||||
; Update Vector Table Offset Register. */
|
||||
LDR r0, =__ramVectors
|
||||
LDR r1, =0xE000ED08
|
||||
STR r0, [r1]
|
||||
dsb 0xF
|
||||
|
||||
LDR R0, =__main
|
||||
BLX R0
|
||||
|
||||
; Should never get here
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Cy_SysLib_FaultHandler PROC
|
||||
EXPORT Cy_SysLib_FaultHandler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
HardFault_Handler PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
movs r0, #4
|
||||
mov r1, LR
|
||||
tst r0, r1
|
||||
beq L_MSP
|
||||
mrs r0, PSP
|
||||
bl L_API_call
|
||||
L_MSP
|
||||
mrs r0, MSP
|
||||
L_API_call
|
||||
bl Cy_SysLib_FaultHandler
|
||||
ENDP
|
||||
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
EXPORT Default_Handler [WEAK]
|
||||
EXPORT NvicMux0_IRQHandler [WEAK]
|
||||
EXPORT NvicMux1_IRQHandler [WEAK]
|
||||
EXPORT NvicMux2_IRQHandler [WEAK]
|
||||
EXPORT NvicMux3_IRQHandler [WEAK]
|
||||
EXPORT NvicMux4_IRQHandler [WEAK]
|
||||
EXPORT NvicMux5_IRQHandler [WEAK]
|
||||
EXPORT NvicMux6_IRQHandler [WEAK]
|
||||
EXPORT NvicMux7_IRQHandler [WEAK]
|
||||
EXPORT NvicMux8_IRQHandler [WEAK]
|
||||
EXPORT NvicMux9_IRQHandler [WEAK]
|
||||
EXPORT NvicMux10_IRQHandler [WEAK]
|
||||
EXPORT NvicMux11_IRQHandler [WEAK]
|
||||
EXPORT NvicMux12_IRQHandler [WEAK]
|
||||
EXPORT NvicMux13_IRQHandler [WEAK]
|
||||
EXPORT NvicMux14_IRQHandler [WEAK]
|
||||
EXPORT NvicMux15_IRQHandler [WEAK]
|
||||
EXPORT NvicMux16_IRQHandler [WEAK]
|
||||
EXPORT NvicMux17_IRQHandler [WEAK]
|
||||
EXPORT NvicMux18_IRQHandler [WEAK]
|
||||
EXPORT NvicMux19_IRQHandler [WEAK]
|
||||
EXPORT NvicMux20_IRQHandler [WEAK]
|
||||
EXPORT NvicMux21_IRQHandler [WEAK]
|
||||
EXPORT NvicMux22_IRQHandler [WEAK]
|
||||
EXPORT NvicMux23_IRQHandler [WEAK]
|
||||
EXPORT NvicMux24_IRQHandler [WEAK]
|
||||
EXPORT NvicMux25_IRQHandler [WEAK]
|
||||
EXPORT NvicMux26_IRQHandler [WEAK]
|
||||
EXPORT NvicMux27_IRQHandler [WEAK]
|
||||
EXPORT NvicMux28_IRQHandler [WEAK]
|
||||
EXPORT NvicMux29_IRQHandler [WEAK]
|
||||
EXPORT NvicMux30_IRQHandler [WEAK]
|
||||
EXPORT NvicMux31_IRQHandler [WEAK]
|
||||
|
||||
NvicMux0_IRQHandler
|
||||
NvicMux1_IRQHandler
|
||||
NvicMux2_IRQHandler
|
||||
NvicMux3_IRQHandler
|
||||
NvicMux4_IRQHandler
|
||||
NvicMux5_IRQHandler
|
||||
NvicMux6_IRQHandler
|
||||
NvicMux7_IRQHandler
|
||||
NvicMux8_IRQHandler
|
||||
NvicMux9_IRQHandler
|
||||
NvicMux10_IRQHandler
|
||||
NvicMux11_IRQHandler
|
||||
NvicMux12_IRQHandler
|
||||
NvicMux13_IRQHandler
|
||||
NvicMux14_IRQHandler
|
||||
NvicMux15_IRQHandler
|
||||
NvicMux16_IRQHandler
|
||||
NvicMux17_IRQHandler
|
||||
NvicMux18_IRQHandler
|
||||
NvicMux19_IRQHandler
|
||||
NvicMux20_IRQHandler
|
||||
NvicMux21_IRQHandler
|
||||
NvicMux22_IRQHandler
|
||||
NvicMux23_IRQHandler
|
||||
NvicMux24_IRQHandler
|
||||
NvicMux25_IRQHandler
|
||||
NvicMux26_IRQHandler
|
||||
NvicMux27_IRQHandler
|
||||
NvicMux28_IRQHandler
|
||||
NvicMux29_IRQHandler
|
||||
NvicMux30_IRQHandler
|
||||
NvicMux31_IRQHandler
|
||||
|
||||
B .
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
|
||||
; User Initial Stack & Heap
|
||||
|
||||
IF :DEF:__MICROLIB
|
||||
|
||||
EXPORT __initial_sp
|
||||
EXPORT __heap_base
|
||||
EXPORT __heap_limit
|
||||
|
||||
ELSE
|
||||
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
||||
LDR R0, =Heap_Mem
|
||||
LDR R1, =(Stack_Mem + Stack_Size)
|
||||
LDR R2, =(Heap_Mem + Heap_Size)
|
||||
LDR R3, =Stack_Mem
|
||||
BX LR
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
ENDIF
|
||||
|
||||
END
|
||||
|
||||
|
||||
; [] END OF FILE
|
|
@ -0,0 +1,468 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm0plus.ld
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
* The main purpose of the linker script is to describe how the sections in the
|
||||
* input files should be mapped into the output file, and to control the memory
|
||||
* layout of the output file.
|
||||
*
|
||||
* \note The entry point location is fixed and starts at 0x10000000. The valid
|
||||
* application image should be placed there.
|
||||
*
|
||||
* \note The linker files included with the PDL template projects must be generic
|
||||
* and handle all common use cases. Your project may not use every section
|
||||
* defined in the linker files. In that case you may see warnings during the
|
||||
* build process. In your project, you can simply comment out or remove the
|
||||
* relevant code in the linker file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
||||
SEARCH_DIR(.)
|
||||
GROUP(-lgcc -lc -lnosys)
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
#if !defined(MBED_ROM_START)
|
||||
#define MBED_ROM_START 0x10000000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x00010000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_PUBLIC_RAM_START)
|
||||
#define MBED_PUBLIC_RAM_START 0x08047600
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_PUBLIC_RAM_SIZE)
|
||||
#define MBED_PUBLIC_RAM_SIZE 0x200
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
||||
|
||||
/* Force symbol to be entered in the output file as an undefined symbol. Doing
|
||||
* this may, for example, trigger linking of additional modules from standard
|
||||
* libraries. You may list several symbols for each EXTERN, and you may use
|
||||
* EXTERN multiple times. This command has the same effect as the -u command-line
|
||||
* option.
|
||||
*/
|
||||
EXTERN(Reset_Handler)
|
||||
|
||||
/* The MEMORY section below describes the location and size of blocks of memory in the target.
|
||||
* Use this section to specify the memory regions available for allocation.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM0+ core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for the CM4 core in 'xx_cm4_dual.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.ld'.
|
||||
*/
|
||||
ram (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||
public_ram (rw) : ORIGIN = MBED_PUBLIC_RAM_START, LENGTH = MBED_PUBLIC_RAM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_APP_START, LENGTH = (MBED_APP_SIZE - 0x8000)
|
||||
|
||||
/* This is a 32K flash region used for EEPROM emulation. This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
* Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
|
||||
* Therefore, repurposing this memory region will prevent such middleware from operation.
|
||||
*/
|
||||
em_eeprom (rx) : ORIGIN = 0x14000000, LENGTH = 0x8000 /* 32 KB */
|
||||
|
||||
/* The following regions define device specific memory regions and must not be changed. */
|
||||
sflash_user_data (rx) : ORIGIN = 0x16000800, LENGTH = 0x800 /* Supervisory flash: User data */
|
||||
sflash_nar (rx) : ORIGIN = 0x16001A00, LENGTH = 0x200 /* Supervisory flash: Normal Access Restrictions (NAR) */
|
||||
sflash_public_key (rx) : ORIGIN = 0x16005A00, LENGTH = 0xC00 /* Supervisory flash: Public Key */
|
||||
sflash_toc_2 (rx) : ORIGIN = 0x16007C00, LENGTH = 0x200 /* Supervisory flash: Table of Content # 2 */
|
||||
sflash_rtoc_2 (rx) : ORIGIN = 0x16007E00, LENGTH = 0x200 /* Supervisory flash: Table of Content # 2 Copy */
|
||||
xip (rx) : ORIGIN = 0x18000000, LENGTH = 0x8000000 /* 128 MB */
|
||||
efuse (r) : ORIGIN = 0x90700000, LENGTH = 0x100000 /* 1 MB */
|
||||
}
|
||||
|
||||
/* Library configurations */
|
||||
GROUP(libgcc.a libc.a libm.a libnosys.a)
|
||||
|
||||
/* 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
|
||||
* __Vectors_End
|
||||
* __Vectors_Size
|
||||
*/
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.cy_app_header :
|
||||
{
|
||||
KEEP(*(.cy_app_header))
|
||||
} > flash
|
||||
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__Vectors = . ;
|
||||
KEEP(*(.vectors))
|
||||
. = ALIGN(4);
|
||||
__Vectors_End = .;
|
||||
__Vectors_Size = __Vectors_End - __Vectors;
|
||||
__end__ = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
*(.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)
|
||||
|
||||
/* Read-only code (constants). */
|
||||
*(.rodata .rodata.* .constdata .constdata.* .conststring .conststring.*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > flash
|
||||
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > flash
|
||||
|
||||
__exidx_start = .;
|
||||
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > flash
|
||||
__exidx_end = .;
|
||||
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_psoc6_01_cm0plus.S */
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
/* Copy interrupt vectors from flash to RAM */
|
||||
LONG (__Vectors) /* From */
|
||||
LONG (__ram_vectors_start__) /* To */
|
||||
LONG (__Vectors_End - __Vectors) /* Size */
|
||||
|
||||
/* Copy data section to RAM */
|
||||
LONG (__etext) /* From */
|
||||
LONG (__data_start__) /* To */
|
||||
LONG (__data_end__ - __data_start__) /* Size */
|
||||
|
||||
__copy_table_end__ = .;
|
||||
} > flash
|
||||
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_psoc6_01_cm0plus.S */
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > flash
|
||||
|
||||
__etext = . ;
|
||||
|
||||
|
||||
.ramVectors (NOLOAD) : ALIGN(8)
|
||||
{
|
||||
__ram_vectors_start__ = .;
|
||||
KEEP(*(.ram_vectors))
|
||||
__ram_vectors_end__ = .;
|
||||
} > ram
|
||||
|
||||
|
||||
.data __ram_vectors_end__ : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
|
||||
*(vtable)
|
||||
*(.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);
|
||||
|
||||
KEEP(*(.cy_ramfunc*))
|
||||
. = ALIGN(4);
|
||||
|
||||
__data_end__ = .;
|
||||
|
||||
} > ram
|
||||
|
||||
|
||||
/* Place variables in the section that should not be initialized during the
|
||||
* device startup.
|
||||
*/
|
||||
.noinit (NOLOAD) : ALIGN(8)
|
||||
{
|
||||
KEEP(*(.noinit))
|
||||
} > ram
|
||||
|
||||
|
||||
/* The uninitialized global or static variables are placed in this section.
|
||||
*
|
||||
* The NOLOAD attribute tells linker that .bss section does not consume
|
||||
* any space in the image. The NOLOAD attribute changes the .bss type to
|
||||
* NOBITS, and that makes linker to A) not allocate section in memory, and
|
||||
* A) put information to clear the section with all zeros during application
|
||||
* loading.
|
||||
*
|
||||
* Without the NOLOAD attribute, the .bss section might get PROGBITS type.
|
||||
* This makes linker to A) allocate zeroed section in memory, and B) copy
|
||||
* this section to RAM during application loading.
|
||||
*/
|
||||
.bss (NOLOAD):
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > ram
|
||||
|
||||
|
||||
.heap (NOLOAD):
|
||||
{
|
||||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
KEEP(*(.heap*))
|
||||
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
|
||||
__HeapLimit = .;
|
||||
} > ram
|
||||
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (NOLOAD):
|
||||
{
|
||||
KEEP(*(.stack*))
|
||||
} > ram
|
||||
|
||||
|
||||
/* Public RAM */
|
||||
.cy_sharedmem (NOLOAD):
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.cy_sharedmem))
|
||||
} > public_ram
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(ram) + LENGTH(ram);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
.cy_em_eeprom :
|
||||
{
|
||||
KEEP(*(.cy_em_eeprom))
|
||||
} > em_eeprom
|
||||
|
||||
|
||||
/* Supervisory Flash: User data */
|
||||
.cy_sflash_user_data :
|
||||
{
|
||||
KEEP(*(.cy_sflash_user_data))
|
||||
} > sflash_user_data
|
||||
|
||||
|
||||
/* Supervisory Flash: Normal Access Restrictions (NAR) */
|
||||
.cy_sflash_nar :
|
||||
{
|
||||
KEEP(*(.cy_sflash_nar))
|
||||
} > sflash_nar
|
||||
|
||||
|
||||
/* Supervisory Flash: Public Key */
|
||||
.cy_sflash_public_key :
|
||||
{
|
||||
KEEP(*(.cy_sflash_public_key))
|
||||
} > sflash_public_key
|
||||
|
||||
|
||||
/* Supervisory Flash: Table of Content # 2 */
|
||||
.cy_toc_part2 :
|
||||
{
|
||||
KEEP(*(.cy_toc_part2))
|
||||
} > sflash_toc_2
|
||||
|
||||
|
||||
/* Supervisory Flash: Table of Content # 2 Copy */
|
||||
.cy_rtoc_part2 :
|
||||
{
|
||||
KEEP(*(.cy_rtoc_part2))
|
||||
} > sflash_rtoc_2
|
||||
|
||||
|
||||
/* Places the code in the Execute in Place (XIP) section. See the smif driver
|
||||
* documentation for details.
|
||||
*/
|
||||
.cy_xip :
|
||||
{
|
||||
KEEP(*(.cy_xip))
|
||||
} > xip
|
||||
|
||||
|
||||
/* eFuse */
|
||||
.cy_efuse :
|
||||
{
|
||||
KEEP(*(.cy_efuse))
|
||||
} > efuse
|
||||
|
||||
|
||||
/* These sections are used for additional metadata (silicon revision,
|
||||
* Silicon/JTAG ID, etc.) storage.
|
||||
*/
|
||||
.cymeta 0x90500000 : { KEEP(*(.cymeta)) } :NONE
|
||||
}
|
||||
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
__cy_memory_0_start = 0x10000000;
|
||||
__cy_memory_0_length = 0x00100000;
|
||||
__cy_memory_0_row_size = 0x200;
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
__cy_memory_1_start = 0x14000000;
|
||||
__cy_memory_1_length = 0x8000;
|
||||
__cy_memory_1_row_size = 0x200;
|
||||
|
||||
/* Supervisory Flash */
|
||||
__cy_memory_2_start = 0x16000000;
|
||||
__cy_memory_2_length = 0x8000;
|
||||
__cy_memory_2_row_size = 0x200;
|
||||
|
||||
/* XIP */
|
||||
__cy_memory_3_start = 0x18000000;
|
||||
__cy_memory_3_length = 0x08000000;
|
||||
__cy_memory_3_row_size = 0x200;
|
||||
|
||||
/* eFuse */
|
||||
__cy_memory_4_start = 0x90700000;
|
||||
__cy_memory_4_length = 0x100000;
|
||||
__cy_memory_4_row_size = 1;
|
||||
|
||||
/* EOF */
|
|
@ -0,0 +1,399 @@
|
|||
/**************************************************************************//**
|
||||
* @file startup_psoc6_01_cm0plus.S
|
||||
* @brief CMSIS Core Device Startup File for
|
||||
* ARMCM0plus Device Series
|
||||
* @version V5.00
|
||||
* @date 02. March 2016
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-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.
|
||||
*/
|
||||
|
||||
/* Address of the NMI handler */
|
||||
#define CY_NMI_HANLDER_ADDR 0x0000000D
|
||||
|
||||
/* The CPU VTOR register */
|
||||
#define CY_CPU_VTOR_ADDR 0xE000ED08
|
||||
|
||||
/* Copy flash vectors and data section to RAM */
|
||||
#define __STARTUP_COPY_MULTIPLE
|
||||
|
||||
/* Clear single BSS section */
|
||||
#define __STARTUP_CLEAR_BSS
|
||||
|
||||
.syntax unified
|
||||
.arch armv6-m
|
||||
|
||||
.section .stack
|
||||
.align 3
|
||||
#ifdef __STACK_SIZE
|
||||
.equ Stack_Size, __STACK_SIZE
|
||||
#else
|
||||
.equ Stack_Size, 0x00001000
|
||||
#endif
|
||||
.globl __StackTop
|
||||
.globl __StackLimit
|
||||
__StackLimit:
|
||||
.space Stack_Size
|
||||
.size __StackLimit, . - __StackLimit
|
||||
__StackTop:
|
||||
.size __StackTop, . - __StackTop
|
||||
|
||||
.section .heap
|
||||
.align 3
|
||||
#ifdef __HEAP_SIZE
|
||||
.equ Heap_Size, __HEAP_SIZE
|
||||
#else
|
||||
.equ Heap_Size, 0x00000400
|
||||
#endif
|
||||
.globl __HeapBase
|
||||
.globl __HeapLimit
|
||||
__HeapBase:
|
||||
.if Heap_Size
|
||||
.space Heap_Size
|
||||
.endif
|
||||
.size __HeapBase, . - __HeapBase
|
||||
__HeapLimit:
|
||||
.size __HeapLimit, . - __HeapLimit
|
||||
|
||||
.section .vectors
|
||||
.align 2
|
||||
.globl __Vectors
|
||||
__Vectors:
|
||||
.long __StackTop /* Top of Stack */
|
||||
.long Reset_Handler /* Reset Handler */
|
||||
.long CY_NMI_HANLDER_ADDR /* NMI Handler */
|
||||
.long HardFault_Handler /* Hard Fault Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long SVC_Handler /* SVCall Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long PendSV_Handler /* PendSV Handler */
|
||||
.long SysTick_Handler /* SysTick Handler */
|
||||
|
||||
/* External interrupts Description */
|
||||
.long NvicMux0_IRQHandler /* CM0+ NVIC Mux input 0 */
|
||||
.long NvicMux1_IRQHandler /* CM0+ NVIC Mux input 1 */
|
||||
.long NvicMux2_IRQHandler /* CM0+ NVIC Mux input 2 */
|
||||
.long NvicMux3_IRQHandler /* CM0+ NVIC Mux input 3 */
|
||||
.long NvicMux4_IRQHandler /* CM0+ NVIC Mux input 4 */
|
||||
.long NvicMux5_IRQHandler /* CM0+ NVIC Mux input 5 */
|
||||
.long NvicMux6_IRQHandler /* CM0+ NVIC Mux input 6 */
|
||||
.long NvicMux7_IRQHandler /* CM0+ NVIC Mux input 7 */
|
||||
.long NvicMux8_IRQHandler /* CM0+ NVIC Mux input 8 */
|
||||
.long NvicMux9_IRQHandler /* CM0+ NVIC Mux input 9 */
|
||||
.long NvicMux10_IRQHandler /* CM0+ NVIC Mux input 10 */
|
||||
.long NvicMux11_IRQHandler /* CM0+ NVIC Mux input 11 */
|
||||
.long NvicMux12_IRQHandler /* CM0+ NVIC Mux input 12 */
|
||||
.long NvicMux13_IRQHandler /* CM0+ NVIC Mux input 13 */
|
||||
.long NvicMux14_IRQHandler /* CM0+ NVIC Mux input 14 */
|
||||
.long NvicMux15_IRQHandler /* CM0+ NVIC Mux input 15 */
|
||||
.long NvicMux16_IRQHandler /* CM0+ NVIC Mux input 16 */
|
||||
.long NvicMux17_IRQHandler /* CM0+ NVIC Mux input 17 */
|
||||
.long NvicMux18_IRQHandler /* CM0+ NVIC Mux input 18 */
|
||||
.long NvicMux19_IRQHandler /* CM0+ NVIC Mux input 19 */
|
||||
.long NvicMux20_IRQHandler /* CM0+ NVIC Mux input 20 */
|
||||
.long NvicMux21_IRQHandler /* CM0+ NVIC Mux input 21 */
|
||||
.long NvicMux22_IRQHandler /* CM0+ NVIC Mux input 22 */
|
||||
.long NvicMux23_IRQHandler /* CM0+ NVIC Mux input 23 */
|
||||
.long NvicMux24_IRQHandler /* CM0+ NVIC Mux input 24 */
|
||||
.long NvicMux25_IRQHandler /* CM0+ NVIC Mux input 25 */
|
||||
.long NvicMux26_IRQHandler /* CM0+ NVIC Mux input 26 */
|
||||
.long NvicMux27_IRQHandler /* CM0+ NVIC Mux input 27 */
|
||||
.long NvicMux28_IRQHandler /* CM0+ NVIC Mux input 28 */
|
||||
.long NvicMux29_IRQHandler /* CM0+ NVIC Mux input 29 */
|
||||
.long NvicMux30_IRQHandler /* CM0+ NVIC Mux input 30 */
|
||||
.long NvicMux31_IRQHandler /* CM0+ NVIC Mux input 31 */
|
||||
|
||||
.size __Vectors, . - __Vectors
|
||||
.equ __VectorsSize, . - __Vectors
|
||||
|
||||
.section .ram_vectors
|
||||
.align 2
|
||||
.globl __ramVectors
|
||||
__ramVectors:
|
||||
.space __VectorsSize
|
||||
.size __ramVectors, . - __ramVectors
|
||||
|
||||
|
||||
.text
|
||||
.thumb
|
||||
.thumb_func
|
||||
.align 2
|
||||
|
||||
/*
|
||||
* Device startup customization
|
||||
*
|
||||
* Note. The global resources are not yet initialized (for example global variables, peripherals, clocks)
|
||||
* because this function is executed as the first instruction in the ResetHandler.
|
||||
* The PDL is also not initialized to use the proper register offsets.
|
||||
* The user of this function is responsible for initializing the PDL and resources before using them.
|
||||
*/
|
||||
.weak Cy_OnResetUser
|
||||
.func Cy_OnResetUser, Cy_OnResetUser
|
||||
.type Cy_OnResetUser, %function
|
||||
|
||||
Cy_OnResetUser:
|
||||
bx lr
|
||||
.size Cy_OnResetUser, . - Cy_OnResetUser
|
||||
.endfunc
|
||||
|
||||
/* Reset handler */
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
|
||||
Reset_Handler:
|
||||
bl Cy_OnResetUser
|
||||
|
||||
/* Firstly it copies data from read only memory to RAM. There are two schemes
|
||||
* to copy. One can copy more than one sections. Another can only copy
|
||||
* one section. The former scheme needs more instructions and read-only
|
||||
* data to implement than the latter.
|
||||
* Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes. */
|
||||
|
||||
#ifdef __STARTUP_COPY_MULTIPLE
|
||||
/* Multiple sections scheme.
|
||||
*
|
||||
* Between symbol address __copy_table_start__ and __copy_table_end__,
|
||||
* there are array of triplets, each of which specify:
|
||||
* offset 0: LMA of start of a section to copy from
|
||||
* offset 4: VMA of start of a section to copy to
|
||||
* offset 8: size of the section to copy. Must be multiply of 4
|
||||
*
|
||||
* All addresses must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
ldr r4, =__copy_table_start__
|
||||
ldr r5, =__copy_table_end__
|
||||
|
||||
.L_loop0:
|
||||
cmp r4, r5
|
||||
bge .L_loop0_done
|
||||
ldr r1, [r4]
|
||||
ldr r2, [r4, #4]
|
||||
ldr r3, [r4, #8]
|
||||
|
||||
.L_loop0_0:
|
||||
subs r3, #4
|
||||
blt .L_loop0_0_done
|
||||
ldr r0, [r1, r3]
|
||||
str r0, [r2, r3]
|
||||
b .L_loop0_0
|
||||
|
||||
.L_loop0_0_done:
|
||||
adds r4, #12
|
||||
b .L_loop0
|
||||
|
||||
.L_loop0_done:
|
||||
#else
|
||||
/* Single section scheme.
|
||||
*
|
||||
* The ranges of copy from/to are specified by following symbols
|
||||
* __etext: LMA of start of the section to copy from. Usually end of text
|
||||
* __data_start__: VMA of start of the section to copy to
|
||||
* __data_end__: VMA of end of the section to copy to
|
||||
*
|
||||
* All addresses must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
ldr r1, =__etext
|
||||
ldr r2, =__data_start__
|
||||
ldr r3, =__data_end__
|
||||
|
||||
subs r3, r2
|
||||
ble .L_loop1_done
|
||||
|
||||
.L_loop1:
|
||||
subs r3, #4
|
||||
ldr r0, [r1,r3]
|
||||
str r0, [r2,r3]
|
||||
bgt .L_loop1
|
||||
|
||||
.L_loop1_done:
|
||||
#endif /*__STARTUP_COPY_MULTIPLE */
|
||||
|
||||
/* This part of work usually is done in C library startup code. Otherwise,
|
||||
* define this macro to enable it in this startup.
|
||||
*
|
||||
* There are two schemes too. One can clear multiple BSS sections. Another
|
||||
* can only clear one section. The former is more size expensive than the
|
||||
* latter.
|
||||
*
|
||||
* Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
|
||||
* Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
|
||||
*/
|
||||
#ifdef __STARTUP_CLEAR_BSS_MULTIPLE
|
||||
/* Multiple sections scheme.
|
||||
*
|
||||
* Between symbol address __copy_table_start__ and __copy_table_end__,
|
||||
* there are array of tuples specifying:
|
||||
* offset 0: Start of a BSS section
|
||||
* offset 4: Size of this BSS section. Must be multiply of 4
|
||||
*/
|
||||
ldr r3, =__zero_table_start__
|
||||
ldr r4, =__zero_table_end__
|
||||
|
||||
.L_loop2:
|
||||
cmp r3, r4
|
||||
bge .L_loop2_done
|
||||
ldr r1, [r3]
|
||||
ldr r2, [r3, #4]
|
||||
movs r0, 0
|
||||
|
||||
.L_loop2_0:
|
||||
subs r2, #4
|
||||
blt .L_loop2_0_done
|
||||
str r0, [r1, r2]
|
||||
b .L_loop2_0
|
||||
.L_loop2_0_done:
|
||||
|
||||
adds r3, #8
|
||||
b .L_loop2
|
||||
.L_loop2_done:
|
||||
#elif defined (__STARTUP_CLEAR_BSS)
|
||||
/* Single BSS section scheme.
|
||||
*
|
||||
* The BSS section is specified by following symbols
|
||||
* __bss_start__: start of the BSS section.
|
||||
* __bss_end__: end of the BSS section.
|
||||
*
|
||||
* Both addresses must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
ldr r1, =__bss_start__
|
||||
ldr r2, =__bss_end__
|
||||
|
||||
movs r0, 0
|
||||
|
||||
subs r2, r1
|
||||
ble .L_loop3_done
|
||||
|
||||
.L_loop3:
|
||||
subs r2, #4
|
||||
str r0, [r1, r2]
|
||||
bgt .L_loop3
|
||||
.L_loop3_done:
|
||||
#endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
|
||||
|
||||
/* Update Vector Table Offset Register. */
|
||||
ldr r0, =__ramVectors
|
||||
ldr r1, =CY_CPU_VTOR_ADDR
|
||||
str r0, [r1]
|
||||
dsb 0xF
|
||||
|
||||
bl _start
|
||||
|
||||
/* Should never get here */
|
||||
b .
|
||||
|
||||
.pool
|
||||
.size Reset_Handler, . - Reset_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak Default_Handler
|
||||
.type Default_Handler, %function
|
||||
Default_Handler:
|
||||
b .
|
||||
.size Default_Handler, . - Default_Handler
|
||||
.weak Cy_SysLib_FaultHandler
|
||||
.type Cy_SysLib_FaultHandler, %function
|
||||
|
||||
Cy_SysLib_FaultHandler:
|
||||
b .
|
||||
.size Cy_SysLib_FaultHandler, . - Cy_SysLib_FaultHandler
|
||||
.type Fault_Handler, %function
|
||||
|
||||
Fault_Handler:
|
||||
/* Storing LR content for Creator call stack trace */
|
||||
push {LR}
|
||||
movs r0, #4
|
||||
mov r1, LR
|
||||
tst r0, r1
|
||||
beq .L_MSP
|
||||
mrs r0, PSP
|
||||
b .L_API_call
|
||||
.L_MSP:
|
||||
mrs r0, MSP
|
||||
.L_API_call:
|
||||
/* Compensation of stack pointer address due to pushing 4 bytes of LR */
|
||||
adds r0, r0, #4
|
||||
bl Cy_SysLib_FaultHandler
|
||||
b .
|
||||
.size Fault_Handler, . - Fault_Handler
|
||||
|
||||
.macro def_fault_Handler fault_handler_name
|
||||
.weak \fault_handler_name
|
||||
.set \fault_handler_name, Fault_Handler
|
||||
.endm
|
||||
|
||||
/* Macro to define default handlers. Default handler
|
||||
* will be weak symbol and just dead loops. They can be
|
||||
* overwritten by other handlers */
|
||||
.macro def_irq_handler handler_name
|
||||
.weak \handler_name
|
||||
.set \handler_name, Default_Handler
|
||||
.endm
|
||||
|
||||
def_irq_handler NMI_Handler
|
||||
|
||||
def_fault_Handler HardFault_Handler
|
||||
|
||||
def_irq_handler SVC_Handler
|
||||
def_irq_handler PendSV_Handler
|
||||
def_irq_handler SysTick_Handler
|
||||
|
||||
def_irq_handler NvicMux0_IRQHandler /* CM0+ NVIC Mux input 0 */
|
||||
def_irq_handler NvicMux1_IRQHandler /* CM0+ NVIC Mux input 1 */
|
||||
def_irq_handler NvicMux2_IRQHandler /* CM0+ NVIC Mux input 2 */
|
||||
def_irq_handler NvicMux3_IRQHandler /* CM0+ NVIC Mux input 3 */
|
||||
def_irq_handler NvicMux4_IRQHandler /* CM0+ NVIC Mux input 4 */
|
||||
def_irq_handler NvicMux5_IRQHandler /* CM0+ NVIC Mux input 5 */
|
||||
def_irq_handler NvicMux6_IRQHandler /* CM0+ NVIC Mux input 6 */
|
||||
def_irq_handler NvicMux7_IRQHandler /* CM0+ NVIC Mux input 7 */
|
||||
def_irq_handler NvicMux8_IRQHandler /* CM0+ NVIC Mux input 8 */
|
||||
def_irq_handler NvicMux9_IRQHandler /* CM0+ NVIC Mux input 9 */
|
||||
def_irq_handler NvicMux10_IRQHandler /* CM0+ NVIC Mux input 10 */
|
||||
def_irq_handler NvicMux11_IRQHandler /* CM0+ NVIC Mux input 11 */
|
||||
def_irq_handler NvicMux12_IRQHandler /* CM0+ NVIC Mux input 12 */
|
||||
def_irq_handler NvicMux13_IRQHandler /* CM0+ NVIC Mux input 13 */
|
||||
def_irq_handler NvicMux14_IRQHandler /* CM0+ NVIC Mux input 14 */
|
||||
def_irq_handler NvicMux15_IRQHandler /* CM0+ NVIC Mux input 15 */
|
||||
def_irq_handler NvicMux16_IRQHandler /* CM0+ NVIC Mux input 16 */
|
||||
def_irq_handler NvicMux17_IRQHandler /* CM0+ NVIC Mux input 17 */
|
||||
def_irq_handler NvicMux18_IRQHandler /* CM0+ NVIC Mux input 18 */
|
||||
def_irq_handler NvicMux19_IRQHandler /* CM0+ NVIC Mux input 19 */
|
||||
def_irq_handler NvicMux20_IRQHandler /* CM0+ NVIC Mux input 20 */
|
||||
def_irq_handler NvicMux21_IRQHandler /* CM0+ NVIC Mux input 21 */
|
||||
def_irq_handler NvicMux22_IRQHandler /* CM0+ NVIC Mux input 22 */
|
||||
def_irq_handler NvicMux23_IRQHandler /* CM0+ NVIC Mux input 23 */
|
||||
def_irq_handler NvicMux24_IRQHandler /* CM0+ NVIC Mux input 24 */
|
||||
def_irq_handler NvicMux25_IRQHandler /* CM0+ NVIC Mux input 25 */
|
||||
def_irq_handler NvicMux26_IRQHandler /* CM0+ NVIC Mux input 26 */
|
||||
def_irq_handler NvicMux27_IRQHandler /* CM0+ NVIC Mux input 27 */
|
||||
def_irq_handler NvicMux28_IRQHandler /* CM0+ NVIC Mux input 28 */
|
||||
def_irq_handler NvicMux29_IRQHandler /* CM0+ NVIC Mux input 29 */
|
||||
def_irq_handler NvicMux30_IRQHandler /* CM0+ NVIC Mux input 30 */
|
||||
def_irq_handler NvicMux31_IRQHandler /* CM0+ NVIC Mux input 31 */
|
||||
|
||||
.end
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,285 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm0plus.icf
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
* The main purpose of the linker script is to describe how the sections in the
|
||||
* input files should be mapped into the output file, and to control the memory
|
||||
* layout of the output file.
|
||||
*
|
||||
* \note The entry point is fixed and starts at 0x10000000. The valid application
|
||||
* image should be placed there.
|
||||
*
|
||||
* \note The linker files included with the PDL template projects must be generic
|
||||
* and handle all common use cases. Your project may not use every section
|
||||
* defined in the linker files. In that case you may see warnings during the
|
||||
* build process. In your project, you can simply comment out or remove the
|
||||
* relevant code in the linker file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||
/*-Editor annotation file-*/
|
||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_4.xml" */
|
||||
/*-Specials-*/
|
||||
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x10000000;
|
||||
}
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = MBED_ROM_START;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x80000;
|
||||
}
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x08000000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x00010000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_PUBLIC_RAM_START)) {
|
||||
define symbol MBED_PUBLIC_RAM_START = 0x08047600;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_PUBLIC_RAM_SIZE)) {
|
||||
define symbol MBED_PUBLIC_RAM_SIZE = 0x200;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
/* The symbols below define the location and size of blocks of memory in the target.
|
||||
* Use these symbols to specify the memory regions available for allocation.
|
||||
*/
|
||||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM0+ core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM4 core in 'xx_cm4_dual.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.icf'.
|
||||
*/
|
||||
/* RAM */
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = MBED_RAM_START;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = (MBED_RAM_START + MBED_RAM_SIZE);
|
||||
/* Public RAM */
|
||||
define symbol __ICFEDIT_region_IRAM2_start__ = MBED_PUBLIC_RAM_START;
|
||||
define symbol __ICFEDIT_region_IRAM2_end__ = (MBED_PUBLIC_RAM_START + MBED_PUBLIC_RAM_SIZE);
|
||||
/* Flash */
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_APP_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_APP_START + MBED_APP_SIZE - 0x8000);
|
||||
|
||||
/* The following symbols define a 32K flash region used for EEPROM emulation.
|
||||
* This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
* Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
|
||||
* Therefore, repurposing this memory region will prevent such middleware from operation.
|
||||
*/
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x14000000;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x14007FFF;
|
||||
|
||||
/* The following symbols define device specific memory regions and must not be changed. */
|
||||
/* Supervisory FLASH - User Data */
|
||||
define symbol __ICFEDIT_region_IROM3_start__ = 0x16000800;
|
||||
define symbol __ICFEDIT_region_IROM3_end__ = 0x160007FF;
|
||||
|
||||
/* Supervisory FLASH - Normal Access Restrictions (NAR) */
|
||||
define symbol __ICFEDIT_region_IROM4_start__ = 0x16001A00;
|
||||
define symbol __ICFEDIT_region_IROM4_end__ = 0x16001BFF;
|
||||
|
||||
/* Supervisory FLASH - Public Key */
|
||||
define symbol __ICFEDIT_region_IROM5_start__ = 0x16005A00;
|
||||
define symbol __ICFEDIT_region_IROM5_end__ = 0x160065FF;
|
||||
|
||||
/* Supervisory FLASH - Table of Content # 2 */
|
||||
define symbol __ICFEDIT_region_IROM6_start__ = 0x16007C00;
|
||||
define symbol __ICFEDIT_region_IROM6_end__ = 0x16007DFF;
|
||||
|
||||
/* Supervisory FLASH - Table of Content # 2 Copy */
|
||||
define symbol __ICFEDIT_region_IROM7_start__ = 0x16007E00;
|
||||
define symbol __ICFEDIT_region_IROM7_end__ = 0x16007FFF;
|
||||
|
||||
/* eFuse */
|
||||
define symbol __ICFEDIT_region_IROM8_start__ = 0x90700000;
|
||||
define symbol __ICFEDIT_region_IROM8_end__ = 0x907FFFFF;
|
||||
|
||||
/* XIP */
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x18000000;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x1FFFFFFF;
|
||||
|
||||
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_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;
|
||||
/*-Sizes-*/
|
||||
if (!isdefinedsymbol(__STACK_SIZE)) {
|
||||
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
|
||||
} else {
|
||||
define symbol __ICFEDIT_size_cstack__ = __STACK_SIZE;
|
||||
}
|
||||
define symbol __ICFEDIT_size_proc_stack__ = 0x0;
|
||||
if (!isdefinedsymbol(__HEAP_SIZE)) {
|
||||
define symbol __ICFEDIT_size_heap__ = 0x4000;
|
||||
} else {
|
||||
define symbol __ICFEDIT_size_heap__ = __HEAP_SIZE;
|
||||
}
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM1_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__];
|
||||
define region IROM2_region = mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IROM3_region = mem:[from __ICFEDIT_region_IROM3_start__ to __ICFEDIT_region_IROM3_end__];
|
||||
define region IROM4_region = mem:[from __ICFEDIT_region_IROM4_start__ to __ICFEDIT_region_IROM4_end__];
|
||||
define region IROM5_region = mem:[from __ICFEDIT_region_IROM5_start__ to __ICFEDIT_region_IROM5_end__];
|
||||
define region IROM6_region = mem:[from __ICFEDIT_region_IROM6_start__ to __ICFEDIT_region_IROM6_end__];
|
||||
define region IROM7_region = mem:[from __ICFEDIT_region_IROM7_start__ to __ICFEDIT_region_IROM7_end__];
|
||||
define region IROM8_region = mem:[from __ICFEDIT_region_IROM8_start__ to __ICFEDIT_region_IROM8_end__];
|
||||
define region EROM1_region = mem:[from __ICFEDIT_region_EROM1_start__ to __ICFEDIT_region_EROM1_end__];
|
||||
define region IRAM1_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__];
|
||||
define region IRAM2_region = mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__];
|
||||
|
||||
define block RAM_DATA {readwrite section .data};
|
||||
define block RAM_OTHER {readwrite section * };
|
||||
define block RAM_NOINIT {readwrite section .noinit};
|
||||
define block RAM_BSS {readwrite section .bss};
|
||||
define block RAM with fixed order {block RAM_DATA, block RAM_OTHER, block RAM_NOINIT, block RAM_BSS};
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
define block HSTACK {block HEAP, block PROC_STACK, last block CSTACK};
|
||||
define block RO {first section .intvec, readonly};
|
||||
|
||||
/*-Initializations-*/
|
||||
initialize by copy { readwrite };
|
||||
do not initialize { section .noinit, section .intvec_ram };
|
||||
|
||||
|
||||
/*-Placement-*/
|
||||
|
||||
/* Flash */
|
||||
".cy_app_header" : place at start of IROM1_region { section .cy_app_header };
|
||||
place in IROM1_region { block RO };
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
".cy_em_eeprom" : place at start of IROM2_region { section .cy_em_eeprom };
|
||||
|
||||
/* Supervisory Flash - User Data */
|
||||
".cy_sflash_user_data" : place at start of IROM3_region { section .cy_sflash_user_data };
|
||||
|
||||
/* Supervisory Flash - NAR */
|
||||
".cy_sflash_nar" : place at start of IROM4_region { section .cy_sflash_nar };
|
||||
|
||||
/* Supervisory Flash - Public Key */
|
||||
".cy_sflash_public_key" : place at start of IROM5_region { section .cy_sflash_public_key };
|
||||
|
||||
/* Supervisory Flash - TOC2 */
|
||||
".cy_toc_part2" : place at start of IROM6_region { section .cy_toc_part2 };
|
||||
|
||||
/* Supervisory Flash - RTOC2 */
|
||||
".cy_rtoc_part2" : place at start of IROM7_region { section .cy_rtoc_part2 };
|
||||
|
||||
/* eFuse */
|
||||
".cy_efuse" : place at start of IROM8_region { section .cy_efuse };
|
||||
|
||||
/* Execute in Place (XIP). See the smif driver documentation for details. */
|
||||
".cy_xip" : place at start of EROM1_region { section .cy_xip };
|
||||
|
||||
/* RAM */
|
||||
place at start of IRAM1_region { readwrite section .intvec_ram};
|
||||
place in IRAM1_region { block RAM};
|
||||
place in IRAM1_region { readwrite section .cy_ramfunc };
|
||||
place at end of IRAM1_region { block HSTACK };
|
||||
|
||||
/* Public RAM */
|
||||
place at start of IRAM2_region { section .cy_sharedmem };
|
||||
|
||||
/* These sections are used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage. */
|
||||
".cymeta" : place at address mem : 0x90500000 { readonly section .cymeta };
|
||||
|
||||
|
||||
keep { section .cy_app_header,
|
||||
section .cy_em_eeprom,
|
||||
section .cy_sflash_user_data,
|
||||
section .cy_sflash_nar,
|
||||
section .cy_sflash_public_key,
|
||||
section .cy_toc_part2,
|
||||
section .cy_rtoc_part2,
|
||||
section .cy_efuse,
|
||||
section .cy_xip,
|
||||
section .cymeta,
|
||||
};
|
||||
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
define exported symbol __cy_memory_0_start = 0x10000000;
|
||||
define exported symbol __cy_memory_0_length = 0x00100000;
|
||||
define exported symbol __cy_memory_0_row_size = 0x200;
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
define exported symbol __cy_memory_1_start = 0x14000000;
|
||||
define exported symbol __cy_memory_1_length = 0x8000;
|
||||
define exported symbol __cy_memory_1_row_size = 0x200;
|
||||
|
||||
/* Supervisory Flash */
|
||||
define exported symbol __cy_memory_2_start = 0x16000000;
|
||||
define exported symbol __cy_memory_2_length = 0x8000;
|
||||
define exported symbol __cy_memory_2_row_size = 0x200;
|
||||
|
||||
/* XIP */
|
||||
define exported symbol __cy_memory_3_start = 0x18000000;
|
||||
define exported symbol __cy_memory_3_length = 0x08000000;
|
||||
define exported symbol __cy_memory_3_row_size = 0x200;
|
||||
|
||||
/* eFuse */
|
||||
define exported symbol __cy_memory_4_start = 0x90700000;
|
||||
define exported symbol __cy_memory_4_length = 0x100000;
|
||||
define exported symbol __cy_memory_4_row_size = 1;
|
||||
|
||||
/* EOF */
|
|
@ -0,0 +1,413 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm0plus.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM0plus Device Series
|
||||
; * @version V5.00
|
||||
; * @date 08. March 2016
|
||||
; ******************************************************************************/
|
||||
;/*
|
||||
; * Copyright (c) 2009-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.
|
||||
; */
|
||||
|
||||
;
|
||||
; The modules in this file are included in the libraries, and may be replaced
|
||||
; by any user-defined modules that define the PUBLIC symbol _program_start or
|
||||
; a user defined start symbol.
|
||||
; To override the cstartup defined in the library, simply add your modified
|
||||
; version to the workbench project.
|
||||
;
|
||||
; The vector table is normally located at address 0.
|
||||
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
|
||||
; The name "__vector_table" has special meaning for C-SPY:
|
||||
; it is where the SP start value is found, and the NVIC vector
|
||||
; table register (VTOR) is initialized to this address if != 0.
|
||||
;
|
||||
; Cortex-M version
|
||||
;
|
||||
|
||||
MODULE ?cstartup
|
||||
|
||||
;; Forward declaration of sections.
|
||||
SECTION CSTACK:DATA:NOROOT(3)
|
||||
SECTION .intvec_ram:DATA:NOROOT(2)
|
||||
SECTION .intvec:CODE:NOROOT(2)
|
||||
|
||||
EXTERN __iar_program_start
|
||||
EXTERN SystemInit
|
||||
EXTERN __iar_data_init3
|
||||
PUBLIC __vector_table
|
||||
PUBLIC __vector_table_0x1c
|
||||
PUBLIC __Vectors
|
||||
PUBLIC __Vectors_End
|
||||
PUBLIC __Vectors_Size
|
||||
PUBLIC __ramVectors
|
||||
|
||||
DATA
|
||||
|
||||
__vector_table
|
||||
DCD sfe(CSTACK)
|
||||
DCD Reset_Handler
|
||||
|
||||
DCD 0x0000000D ; NMI_Handler is defined in ROM code
|
||||
DCD HardFault_Handler
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD 0
|
||||
__vector_table_0x1c
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD SVC_Handler
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
; External interrupts Description
|
||||
DCD NvicMux0_IRQHandler ; CM0+ NVIC Mux input 0
|
||||
DCD NvicMux1_IRQHandler ; CM0+ NVIC Mux input 1
|
||||
DCD NvicMux2_IRQHandler ; CM0+ NVIC Mux input 2
|
||||
DCD NvicMux3_IRQHandler ; CM0+ NVIC Mux input 3
|
||||
DCD NvicMux4_IRQHandler ; CM0+ NVIC Mux input 4
|
||||
DCD NvicMux5_IRQHandler ; CM0+ NVIC Mux input 5
|
||||
DCD NvicMux6_IRQHandler ; CM0+ NVIC Mux input 6
|
||||
DCD NvicMux7_IRQHandler ; CM0+ NVIC Mux input 7
|
||||
DCD NvicMux8_IRQHandler ; CM0+ NVIC Mux input 8
|
||||
DCD NvicMux9_IRQHandler ; CM0+ NVIC Mux input 9
|
||||
DCD NvicMux10_IRQHandler ; CM0+ NVIC Mux input 10
|
||||
DCD NvicMux11_IRQHandler ; CM0+ NVIC Mux input 11
|
||||
DCD NvicMux12_IRQHandler ; CM0+ NVIC Mux input 12
|
||||
DCD NvicMux13_IRQHandler ; CM0+ NVIC Mux input 13
|
||||
DCD NvicMux14_IRQHandler ; CM0+ NVIC Mux input 14
|
||||
DCD NvicMux15_IRQHandler ; CM0+ NVIC Mux input 15
|
||||
DCD NvicMux16_IRQHandler ; CM0+ NVIC Mux input 16
|
||||
DCD NvicMux17_IRQHandler ; CM0+ NVIC Mux input 17
|
||||
DCD NvicMux18_IRQHandler ; CM0+ NVIC Mux input 18
|
||||
DCD NvicMux19_IRQHandler ; CM0+ NVIC Mux input 19
|
||||
DCD NvicMux20_IRQHandler ; CM0+ NVIC Mux input 20
|
||||
DCD NvicMux21_IRQHandler ; CM0+ NVIC Mux input 21
|
||||
DCD NvicMux22_IRQHandler ; CM0+ NVIC Mux input 22
|
||||
DCD NvicMux23_IRQHandler ; CM0+ NVIC Mux input 23
|
||||
DCD NvicMux24_IRQHandler ; CM0+ NVIC Mux input 24
|
||||
DCD NvicMux25_IRQHandler ; CM0+ NVIC Mux input 25
|
||||
DCD NvicMux26_IRQHandler ; CM0+ NVIC Mux input 26
|
||||
DCD NvicMux27_IRQHandler ; CM0+ NVIC Mux input 27
|
||||
DCD NvicMux28_IRQHandler ; CM0+ NVIC Mux input 28
|
||||
DCD NvicMux29_IRQHandler ; CM0+ NVIC Mux input 29
|
||||
DCD NvicMux30_IRQHandler ; CM0+ NVIC Mux input 30
|
||||
DCD NvicMux31_IRQHandler ; CM0+ NVIC Mux input 31
|
||||
|
||||
__Vectors_End
|
||||
|
||||
__Vectors EQU __vector_table
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
SECTION .intvec_ram:DATA:REORDER:NOROOT(2)
|
||||
__ramVectors
|
||||
DS32 __Vectors_Size
|
||||
|
||||
|
||||
THUMB
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Default handlers
|
||||
;;
|
||||
PUBWEAK Default_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
Default_Handler
|
||||
B Default_Handler
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Weak function for startup customization
|
||||
;;
|
||||
;; Note. The global resources are not yet initialized (for example global variables, peripherals, clocks)
|
||||
;; because this function is executed as the first instruction in the ResetHandler.
|
||||
;; The PDL is also not initialized to use the proper register offsets.
|
||||
;; The user of this function is responsible for initializing the PDL and resources before using them.
|
||||
;;
|
||||
PUBWEAK Cy_OnResetUser
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
Cy_OnResetUser
|
||||
BX LR
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Define strong version to return zero for
|
||||
;; __iar_program_start to skip data sections
|
||||
;; initialization.
|
||||
;;
|
||||
PUBLIC __low_level_init
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
__low_level_init
|
||||
MOVS R0, #0
|
||||
BX LR
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Default interrupt handlers.
|
||||
;;
|
||||
THUMB
|
||||
PUBWEAK Reset_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
Reset_Handler
|
||||
|
||||
; Define strong function for startup customization
|
||||
LDR R0, =Cy_OnResetUser
|
||||
BLX R0
|
||||
|
||||
; Copy vectors from ROM to RAM
|
||||
LDR r1, =__vector_table
|
||||
LDR r0, =__ramVectors
|
||||
LDR r2, =__Vectors_Size
|
||||
intvec_copy
|
||||
LDR r3, [r1]
|
||||
STR r3, [r0]
|
||||
ADDS r0, r0, #4
|
||||
ADDS r1, r1, #4
|
||||
SUBS r2, r2, #1
|
||||
CMP r2, #0
|
||||
BNE intvec_copy
|
||||
|
||||
; Update Vector Table Offset Register
|
||||
LDR r0, =__ramVectors
|
||||
LDR r1, =0xE000ED08
|
||||
STR r0, [r1]
|
||||
dsb
|
||||
|
||||
LDR R0, =__iar_program_start
|
||||
BLX R0
|
||||
|
||||
; Should never get here
|
||||
Cy_Main_Exited
|
||||
B Cy_Main_Exited
|
||||
|
||||
|
||||
PUBWEAK NMI_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NMI_Handler
|
||||
B NMI_Handler
|
||||
|
||||
|
||||
PUBWEAK Cy_SysLib_FaultHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
Cy_SysLib_FaultHandler
|
||||
B Cy_SysLib_FaultHandler
|
||||
|
||||
PUBWEAK HardFault_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
HardFault_Handler
|
||||
IMPORT Cy_SysLib_FaultHandler
|
||||
movs r0, #4
|
||||
mov r1, LR
|
||||
tst r0, r1
|
||||
beq L_MSP
|
||||
mrs r0, PSP
|
||||
b L_API_call
|
||||
L_MSP
|
||||
mrs r0, MSP
|
||||
L_API_call
|
||||
; Storing LR content for Creator call stack trace
|
||||
push {LR}
|
||||
bl Cy_SysLib_FaultHandler
|
||||
|
||||
|
||||
PUBWEAK SVC_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SVC_Handler
|
||||
B SVC_Handler
|
||||
|
||||
PUBWEAK PendSV_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PendSV_Handler
|
||||
B PendSV_Handler
|
||||
|
||||
PUBWEAK SysTick_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SysTick_Handler
|
||||
B SysTick_Handler
|
||||
|
||||
|
||||
; External interrupts
|
||||
PUBWEAK NvicMux0_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux0_IRQHandler
|
||||
B NvicMux0_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux1_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux1_IRQHandler
|
||||
B NvicMux1_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux2_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux2_IRQHandler
|
||||
B NvicMux2_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux3_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux3_IRQHandler
|
||||
B NvicMux3_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux4_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux4_IRQHandler
|
||||
B NvicMux4_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux5_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux5_IRQHandler
|
||||
B NvicMux5_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux6_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux6_IRQHandler
|
||||
B NvicMux6_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux7_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux7_IRQHandler
|
||||
B NvicMux7_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux8_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux8_IRQHandler
|
||||
B NvicMux8_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux9_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux9_IRQHandler
|
||||
B NvicMux9_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux10_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux10_IRQHandler
|
||||
B NvicMux10_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux11_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux11_IRQHandler
|
||||
B NvicMux11_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux12_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux12_IRQHandler
|
||||
B NvicMux12_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux13_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux13_IRQHandler
|
||||
B NvicMux13_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux14_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux14_IRQHandler
|
||||
B NvicMux14_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux15_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux15_IRQHandler
|
||||
B NvicMux15_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux16_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux16_IRQHandler
|
||||
B NvicMux16_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux17_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux17_IRQHandler
|
||||
B NvicMux17_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux18_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux18_IRQHandler
|
||||
B NvicMux18_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux19_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux19_IRQHandler
|
||||
B NvicMux19_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux20_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux20_IRQHandler
|
||||
B NvicMux20_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux21_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux21_IRQHandler
|
||||
B NvicMux21_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux22_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux22_IRQHandler
|
||||
B NvicMux22_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux23_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux23_IRQHandler
|
||||
B NvicMux23_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux24_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux24_IRQHandler
|
||||
B NvicMux24_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux25_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux25_IRQHandler
|
||||
B NvicMux25_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux26_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux26_IRQHandler
|
||||
B NvicMux26_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux27_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux27_IRQHandler
|
||||
B NvicMux27_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux28_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux28_IRQHandler
|
||||
B NvicMux28_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux29_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux29_IRQHandler
|
||||
B NvicMux29_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux30_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux30_IRQHandler
|
||||
B NvicMux30_IRQHandler
|
||||
|
||||
PUBWEAK NvicMux31_IRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NvicMux31_IRQHandler
|
||||
B NvicMux31_IRQHandler
|
||||
|
||||
|
||||
END
|
||||
|
||||
|
||||
; [] END OF FILE
|
|
@ -0,0 +1,750 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm0plus.c
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "cy_device.h"
|
||||
#include "device.h"
|
||||
#include "system_psoc6.h"
|
||||
#include "cy_device_headers.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "cy_syslib.h"
|
||||
#include "cy_wdt.h"
|
||||
#include "cycfg.h"
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
#include "cy_ipc_sema.h"
|
||||
#include "cy_ipc_pipe.h"
|
||||
#include "cy_ipc_drv.h"
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2)
|
||||
#include "cy_flash.h"
|
||||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
*******************************************************************************/
|
||||
|
||||
/** Default HFClk frequency in Hz */
|
||||
#define CY_CLK_HFCLK0_FREQ_HZ_DEFAULT (8000000UL)
|
||||
|
||||
/** Default PeriClk frequency in Hz */
|
||||
#define CY_CLK_PERICLK_FREQ_HZ_DEFAULT (4000000UL)
|
||||
|
||||
/** Default SlowClk system core frequency in Hz */
|
||||
#define CY_CLK_SYSTEM_FREQ_HZ_DEFAULT (4000000UL)
|
||||
|
||||
/** IMO frequency in Hz */
|
||||
#define CY_CLK_IMO_FREQ_HZ (8000000UL)
|
||||
|
||||
/** HVILO frequency in Hz */
|
||||
#define CY_CLK_HVILO_FREQ_HZ (32000UL)
|
||||
|
||||
/** PILO frequency in Hz */
|
||||
#define CY_CLK_PILO_FREQ_HZ (32768UL)
|
||||
|
||||
/** WCO frequency in Hz */
|
||||
#define CY_CLK_WCO_FREQ_HZ (32768UL)
|
||||
|
||||
/** ALTLF frequency in Hz */
|
||||
#define CY_CLK_ALTLF_FREQ_HZ (32768UL)
|
||||
|
||||
|
||||
/**
|
||||
* Holds the SlowClk (Cortex-M0+) or FastClk (Cortex-M4) system core clock,
|
||||
* which is the system clock frequency supplied to the SysTick timer and the
|
||||
* processor core clock.
|
||||
* This variable implements CMSIS Core global variable.
|
||||
* Refer to the [CMSIS documentation]
|
||||
* (http://www.keil.com/pack/doc/CMSIS/Core/html/group__system__init__gr.html "System and Clock Configuration")
|
||||
* for more details.
|
||||
* This variable can be used by debuggers to query the frequency
|
||||
* of the debug timer or to configure the trace clock speed.
|
||||
*
|
||||
* \attention Compilers must be configured to avoid removing this variable in case
|
||||
* the application program is not using it. Debugging systems require the variable
|
||||
* to be physically present in memory so that it can be examined to configure the debugger. */
|
||||
uint32_t SystemCoreClock = CY_CLK_SYSTEM_FREQ_HZ_DEFAULT;
|
||||
|
||||
/** Holds the HFClk0 clock frequency. Updated by \ref SystemCoreClockUpdate(). */
|
||||
uint32_t cy_Hfclk0FreqHz = CY_CLK_HFCLK0_FREQ_HZ_DEFAULT;
|
||||
|
||||
/** Holds the PeriClk clock frequency. Updated by \ref SystemCoreClockUpdate(). */
|
||||
uint32_t cy_PeriClkFreqHz = CY_CLK_PERICLK_FREQ_HZ_DEFAULT;
|
||||
|
||||
/** Holds the Alternate high frequency clock in Hz. Updated by \ref SystemCoreClockUpdate(). */
|
||||
#if (defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL)) || defined (CY_DOXYGEN)
|
||||
uint32_t cy_BleEcoClockFreqHz = CY_CLK_ALTHF_FREQ_HZ;
|
||||
#endif /* (defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL)) || defined (CY_DOXYGEN) */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemInit()
|
||||
*******************************************************************************/
|
||||
|
||||
/* CLK_FLL_CONFIG default values */
|
||||
#define CY_FB_CLK_FLL_CONFIG_VALUE (0x01000000u)
|
||||
#define CY_FB_CLK_FLL_CONFIG2_VALUE (0x00020001u)
|
||||
#define CY_FB_CLK_FLL_CONFIG3_VALUE (0x00002800u)
|
||||
#define CY_FB_CLK_FLL_CONFIG4_VALUE (0x000000FFu)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate (void)
|
||||
*******************************************************************************/
|
||||
|
||||
/* Do not use these definitions directly in your application */
|
||||
#define CY_DELAY_MS_OVERFLOW_THRESHOLD (0x8000u)
|
||||
#define CY_DELAY_1K_THRESHOLD (1000u)
|
||||
#define CY_DELAY_1K_MINUS_1_THRESHOLD (CY_DELAY_1K_THRESHOLD - 1u)
|
||||
#define CY_DELAY_1M_THRESHOLD (1000000u)
|
||||
#define CY_DELAY_1M_MINUS_1_THRESHOLD (CY_DELAY_1M_THRESHOLD - 1u)
|
||||
uint32_t cy_delayFreqHz = CY_CLK_SYSTEM_FREQ_HZ_DEFAULT;
|
||||
|
||||
uint32_t cy_delayFreqKhz = (CY_CLK_SYSTEM_FREQ_HZ_DEFAULT + CY_DELAY_1K_MINUS_1_THRESHOLD) /
|
||||
CY_DELAY_1K_THRESHOLD;
|
||||
|
||||
uint8_t cy_delayFreqMhz = (uint8_t)((CY_CLK_SYSTEM_FREQ_HZ_DEFAULT + CY_DELAY_1M_MINUS_1_THRESHOLD) /
|
||||
CY_DELAY_1M_THRESHOLD);
|
||||
|
||||
uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
|
||||
((CY_CLK_SYSTEM_FREQ_HZ_DEFAULT + CY_DELAY_1K_MINUS_1_THRESHOLD) / CY_DELAY_1K_THRESHOLD);
|
||||
|
||||
#define CY_ROOT_PATH_SRC_IMO (0UL)
|
||||
#define CY_ROOT_PATH_SRC_EXT (1UL)
|
||||
#if (SRSS_ECO_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_ECO (2UL)
|
||||
#endif /* (SRSS_ECO_PRESENT == 1U) */
|
||||
#if (SRSS_ALTHF_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_ALTHF (3UL)
|
||||
#endif /* (SRSS_ALTHF_PRESENT == 1U) */
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX (4UL)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_HVILO (16UL)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_WCO (17UL)
|
||||
#if (SRSS_ALTLF_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_ALTLF (18UL)
|
||||
#endif /* (SRSS_ALTLF_PRESENT == 1U) */
|
||||
#if (SRSS_PILO_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_PILO (19UL)
|
||||
#endif /* (SRSS_PILO_PRESENT == 1U) */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Cy_SysEnableCM4(), Cy_SysRetainCM4(), and Cy_SysResetCM4()
|
||||
*******************************************************************************/
|
||||
#define CY_SYS_CM4_PWR_CTL_KEY_OPEN (0x05FAUL)
|
||||
#define CY_SYS_CM4_PWR_CTL_KEY_CLOSE (0xFA05UL)
|
||||
#define CY_SYS_CM4_VECTOR_TABLE_VALID_ADDR (0x000003FFUL)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: mbed_sdk_init
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Mbed's post-memory-initialization function.
|
||||
* Used here to initialize common parts of the Cypress libraries.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
/* Initialize system and clocks. */
|
||||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Configure mailbox IPC interrupts */
|
||||
mailbox_init();
|
||||
#else
|
||||
/* Enable global interrupts */
|
||||
__enable_irq();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SystemInit
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Initializes the system:
|
||||
* - Restores FLL registers to the default state.
|
||||
* - Unlocks and disables WDT.
|
||||
* - Calls Cy_PDL_Init() function to define the driver library.
|
||||
* - Calls the Cy_SystemInit() function, if compiled from PSoC Creator.
|
||||
* - Calls \ref SystemCoreClockUpdate().
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SystemInit(void)
|
||||
{
|
||||
Cy_PDL_Init(CY_DEVICE_CFG);
|
||||
|
||||
/* Restore FLL registers to the default state as they are not restored by the ROM code */
|
||||
uint32_t copy = SRSS->CLK_FLL_CONFIG;
|
||||
copy &= ~SRSS_CLK_FLL_CONFIG_FLL_ENABLE_Msk;
|
||||
SRSS->CLK_FLL_CONFIG = copy;
|
||||
|
||||
copy = SRSS->CLK_ROOT_SELECT[0u];
|
||||
copy &= ~SRSS_CLK_ROOT_SELECT_ROOT_DIV_Msk; /* Set ROOT_DIV = 0*/
|
||||
SRSS->CLK_ROOT_SELECT[0u] = copy;
|
||||
|
||||
SRSS->CLK_FLL_CONFIG = CY_FB_CLK_FLL_CONFIG_VALUE;
|
||||
SRSS->CLK_FLL_CONFIG2 = CY_FB_CLK_FLL_CONFIG2_VALUE;
|
||||
SRSS->CLK_FLL_CONFIG3 = CY_FB_CLK_FLL_CONFIG3_VALUE;
|
||||
SRSS->CLK_FLL_CONFIG4 = CY_FB_CLK_FLL_CONFIG4_VALUE;
|
||||
|
||||
/* Unlock and disable WDT */
|
||||
Cy_WDT_Unlock();
|
||||
Cy_WDT_Disable();
|
||||
|
||||
Cy_SystemInit();
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2) && !defined(CY_PSOC6ABLE2_REV_0A_SUPPORT_DISABLE)
|
||||
if (CY_SYSLIB_DEVICE_REV_0A == Cy_SysLib_GetDeviceRevision())
|
||||
{
|
||||
/* Clear data register of IPC structure #7, reserved for the Deep-Sleep operations. */
|
||||
IPC_STRUCT7->DATA = 0UL;
|
||||
/* Release IPC structure #7 to avoid deadlocks in case of SW or WDT reset during Deep-Sleep entering. */
|
||||
IPC_STRUCT7->RELEASE = 0UL;
|
||||
}
|
||||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) && !defined(CY_PSOC6ABLE2_REV_0A_SUPPORT_DISABLE) */
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
/* Allocate and initialize semaphores for the system operations. */
|
||||
CY_SECTION(".cy_sharedmem")
|
||||
static uint32_t ipcSemaArray[CY_IPC_SEMA_COUNT / CY_IPC_SEMA_PER_WORD];
|
||||
|
||||
(void) Cy_IPC_Sema_Init(CY_IPC_CHAN_SEMA, CY_IPC_SEMA_COUNT, ipcSemaArray);
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
*
|
||||
* Initializes the system pipes. The system pipes are used by BLE and Flash.
|
||||
*
|
||||
* If the default startup file is not used, or SystemInit() is not called in your
|
||||
* project, call the following three functions prior to executing any flash or
|
||||
* EmEEPROM write or erase operation:
|
||||
* -# Cy_IPC_Sema_Init()
|
||||
* -# Cy_IPC_Pipe_Config()
|
||||
* -# Cy_IPC_Pipe_Init()
|
||||
* -# Cy_Flash_Init()
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
/* Create an array of endpoint structures */
|
||||
static cy_stc_ipc_pipe_ep_t systemIpcPipeEpArray[CY_IPC_MAX_ENDPOINTS];
|
||||
|
||||
Cy_IPC_Pipe_Config(systemIpcPipeEpArray);
|
||||
|
||||
static cy_ipc_pipe_callback_ptr_t systemIpcPipeSysCbArray[CY_SYS_CYPIPE_CLIENT_CNT];
|
||||
|
||||
static const cy_stc_ipc_pipe_config_t systemIpcPipeConfigCm0 =
|
||||
{
|
||||
/* .ep0ConfigData */
|
||||
{
|
||||
/* .ipcNotifierNumber */ CY_IPC_INTR_CYPIPE_EP0,
|
||||
/* .ipcNotifierPriority */ CY_SYS_INTR_CYPIPE_PRIOR_EP0,
|
||||
/* .ipcNotifierMuxNumber */ CY_SYS_INTR_CYPIPE_MUX_EP0,
|
||||
/* .epAddress */ CY_IPC_EP_CYPIPE_CM0_ADDR,
|
||||
/* .epConfig */ CY_SYS_CYPIPE_CONFIG_EP0
|
||||
},
|
||||
/* .ep1ConfigData */
|
||||
{
|
||||
/* .ipcNotifierNumber */ CY_IPC_INTR_CYPIPE_EP1,
|
||||
/* .ipcNotifierPriority */ CY_SYS_INTR_CYPIPE_PRIOR_EP1,
|
||||
/* .ipcNotifierMuxNumber */ 0u,
|
||||
/* .epAddress */ CY_IPC_EP_CYPIPE_CM4_ADDR,
|
||||
/* .epConfig */ CY_SYS_CYPIPE_CONFIG_EP1
|
||||
},
|
||||
/* .endpointClientsCount */ CY_SYS_CYPIPE_CLIENT_CNT,
|
||||
/* .endpointsCallbacksArray */ systemIpcPipeSysCbArray,
|
||||
/* .userPipeIsrHandler */ &Cy_SysIpcPipeIsrCm0
|
||||
};
|
||||
|
||||
if (cy_device->flashPipeRequired != 0u)
|
||||
{
|
||||
Cy_IPC_Pipe_Init(&systemIpcPipeConfigCm0);
|
||||
}
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2)
|
||||
Cy_Flash_Init();
|
||||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SystemInit
|
||||
****************************************************************************//**
|
||||
*
|
||||
* The function is called during device startup. Once project compiled as part of
|
||||
* the PSoC Creator project, the Cy_SystemInit() function is generated by the
|
||||
* PSoC Creator.
|
||||
*
|
||||
* The function generated by PSoC Creator performs all of the necessary device
|
||||
* configuration based on the design settings. This includes settings from the
|
||||
* Design Wide Resources (DWR) such as Clocks and Pins as well as any component
|
||||
* configuration that is necessary.
|
||||
*
|
||||
*******************************************************************************/
|
||||
__WEAK void Cy_SystemInit(void)
|
||||
{
|
||||
/* Empty weak function. The actual implementation to be in the PSoC Creator
|
||||
* generated strong function.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SystemCoreClockUpdate
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Gets core clock frequency and updates \ref SystemCoreClock, \ref
|
||||
* cy_Hfclk0FreqHz, and \ref cy_PeriClkFreqHz.
|
||||
*
|
||||
* Updates global variables used by the \ref Cy_SysLib_Delay(), \ref
|
||||
* Cy_SysLib_DelayUs(), and \ref Cy_SysLib_DelayCycles().
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
uint32_t srcFreqHz;
|
||||
uint32_t pathFreqHz;
|
||||
uint32_t slowClkDiv;
|
||||
uint32_t periClkDiv;
|
||||
uint32_t rootPath;
|
||||
uint32_t srcClk;
|
||||
|
||||
/* Get root path clock for the high-frequency clock # 0 */
|
||||
rootPath = _FLD2VAL(SRSS_CLK_ROOT_SELECT_ROOT_MUX, SRSS->CLK_ROOT_SELECT[0u]);
|
||||
|
||||
/* Get source of the root path clock */
|
||||
srcClk = _FLD2VAL(SRSS_CLK_PATH_SELECT_PATH_MUX, SRSS->CLK_PATH_SELECT[rootPath]);
|
||||
|
||||
/* Get frequency of the source */
|
||||
switch (srcClk)
|
||||
{
|
||||
case CY_ROOT_PATH_SRC_IMO:
|
||||
srcFreqHz = CY_CLK_IMO_FREQ_HZ;
|
||||
break;
|
||||
|
||||
case CY_ROOT_PATH_SRC_EXT:
|
||||
srcFreqHz = CY_CLK_EXT_FREQ_HZ;
|
||||
break;
|
||||
|
||||
#if (SRSS_ECO_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_ECO:
|
||||
srcFreqHz = CY_CLK_ECO_FREQ_HZ;
|
||||
break;
|
||||
#endif /* (SRSS_ECO_PRESENT == 1U) */
|
||||
|
||||
#if defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL) && (SRSS_ALTHF_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_ALTHF:
|
||||
srcFreqHz = cy_BleEcoClockFreqHz;
|
||||
break;
|
||||
#endif /* defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL) && (SRSS_ALTHF_PRESENT == 1U) */
|
||||
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX:
|
||||
{
|
||||
uint32_t dsi_src;
|
||||
dsi_src = _FLD2VAL(SRSS_CLK_DSI_SELECT_DSI_MUX, SRSS->CLK_DSI_SELECT[rootPath]);
|
||||
switch (dsi_src)
|
||||
{
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_HVILO:
|
||||
srcFreqHz = CY_CLK_HVILO_FREQ_HZ;
|
||||
break;
|
||||
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_WCO:
|
||||
srcFreqHz = CY_CLK_WCO_FREQ_HZ;
|
||||
break;
|
||||
|
||||
#if (SRSS_ALTLF_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_ALTLF:
|
||||
srcFreqHz = CY_CLK_ALTLF_FREQ_HZ;
|
||||
break;
|
||||
#endif /* (SRSS_ALTLF_PRESENT == 1U) */
|
||||
|
||||
#if (SRSS_PILO_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_PILO:
|
||||
srcFreqHz = CY_CLK_PILO_FREQ_HZ;
|
||||
break;
|
||||
#endif /* (SRSS_PILO_PRESENT == 1U) */
|
||||
|
||||
default:
|
||||
srcFreqHz = CY_CLK_HVILO_FREQ_HZ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
srcFreqHz = CY_CLK_EXT_FREQ_HZ;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rootPath == 0UL)
|
||||
{
|
||||
/* FLL */
|
||||
bool fllLocked = ( 0UL != _FLD2VAL(SRSS_CLK_FLL_STATUS_LOCKED, SRSS->CLK_FLL_STATUS));
|
||||
bool fllOutputOutput = ( 3UL == _FLD2VAL(SRSS_CLK_FLL_CONFIG3_BYPASS_SEL, SRSS->CLK_FLL_CONFIG3));
|
||||
bool fllOutputAuto = ((0UL == _FLD2VAL(SRSS_CLK_FLL_CONFIG3_BYPASS_SEL, SRSS->CLK_FLL_CONFIG3)) ||
|
||||
(1UL == _FLD2VAL(SRSS_CLK_FLL_CONFIG3_BYPASS_SEL, SRSS->CLK_FLL_CONFIG3)));
|
||||
if ((fllOutputAuto && fllLocked) || fllOutputOutput)
|
||||
{
|
||||
uint32_t fllMult;
|
||||
uint32_t refDiv;
|
||||
uint32_t outputDiv;
|
||||
|
||||
fllMult = _FLD2VAL(SRSS_CLK_FLL_CONFIG_FLL_MULT, SRSS->CLK_FLL_CONFIG);
|
||||
refDiv = _FLD2VAL(SRSS_CLK_FLL_CONFIG2_FLL_REF_DIV, SRSS->CLK_FLL_CONFIG2);
|
||||
outputDiv = _FLD2VAL(SRSS_CLK_FLL_CONFIG_FLL_OUTPUT_DIV, SRSS->CLK_FLL_CONFIG) + 1UL;
|
||||
|
||||
pathFreqHz = ((srcFreqHz / refDiv) * fllMult) / outputDiv;
|
||||
}
|
||||
else
|
||||
{
|
||||
pathFreqHz = srcFreqHz;
|
||||
}
|
||||
}
|
||||
else if ((rootPath == 1UL) || (rootPath == 2UL))
|
||||
{
|
||||
/* PLL */
|
||||
bool pllLocked = ( 0UL != _FLD2VAL(SRSS_CLK_PLL_STATUS_LOCKED, SRSS->CLK_PLL_STATUS[rootPath - 1UL]));
|
||||
bool pllOutputOutput = ( 3UL == _FLD2VAL(SRSS_CLK_PLL_CONFIG_BYPASS_SEL, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]));
|
||||
bool pllOutputAuto = ((0UL == _FLD2VAL(SRSS_CLK_PLL_CONFIG_BYPASS_SEL, SRSS->CLK_PLL_CONFIG[rootPath - 1UL])) ||
|
||||
(1UL == _FLD2VAL(SRSS_CLK_PLL_CONFIG_BYPASS_SEL, SRSS->CLK_PLL_CONFIG[rootPath - 1UL])));
|
||||
if ((pllOutputAuto && pllLocked) || pllOutputOutput)
|
||||
{
|
||||
uint32_t feedbackDiv;
|
||||
uint32_t referenceDiv;
|
||||
uint32_t outputDiv;
|
||||
|
||||
feedbackDiv = _FLD2VAL(SRSS_CLK_PLL_CONFIG_FEEDBACK_DIV, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]);
|
||||
referenceDiv = _FLD2VAL(SRSS_CLK_PLL_CONFIG_REFERENCE_DIV, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]);
|
||||
outputDiv = _FLD2VAL(SRSS_CLK_PLL_CONFIG_OUTPUT_DIV, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]);
|
||||
|
||||
pathFreqHz = ((srcFreqHz * feedbackDiv) / referenceDiv) / outputDiv;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pathFreqHz = srcFreqHz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Direct */
|
||||
pathFreqHz = srcFreqHz;
|
||||
}
|
||||
|
||||
/* Get frequency after hf_clk pre-divider */
|
||||
pathFreqHz = pathFreqHz >> _FLD2VAL(SRSS_CLK_ROOT_SELECT_ROOT_DIV, SRSS->CLK_ROOT_SELECT[0u]);
|
||||
cy_Hfclk0FreqHz = pathFreqHz;
|
||||
|
||||
/* Slow Clock Divider */
|
||||
slowClkDiv = 1u + _FLD2VAL(CPUSS_CM0_CLOCK_CTL_SLOW_INT_DIV, CPUSS->CM0_CLOCK_CTL);
|
||||
|
||||
/* Peripheral Clock Divider */
|
||||
periClkDiv = 1u + _FLD2VAL(CPUSS_CM0_CLOCK_CTL_PERI_INT_DIV, CPUSS->CM0_CLOCK_CTL);
|
||||
|
||||
pathFreqHz = pathFreqHz / periClkDiv;
|
||||
cy_PeriClkFreqHz = pathFreqHz;
|
||||
pathFreqHz = pathFreqHz / slowClkDiv;
|
||||
SystemCoreClock = pathFreqHz;
|
||||
|
||||
/* Sets clock frequency for Delay API */
|
||||
cy_delayFreqHz = SystemCoreClock;
|
||||
cy_delayFreqMhz = (uint8_t)((cy_delayFreqHz + CY_DELAY_1M_MINUS_1_THRESHOLD) / CY_DELAY_1M_THRESHOLD);
|
||||
cy_delayFreqKhz = (cy_delayFreqHz + CY_DELAY_1K_MINUS_1_THRESHOLD) / CY_DELAY_1K_THRESHOLD;
|
||||
cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD * cy_delayFreqKhz;
|
||||
}
|
||||
|
||||
|
||||
#if (CY_SYSTEM_CPU_CM0P == 1UL) || defined(CY_DOXYGEN)
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysGetCM4Status
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Returns the Cortex-M4 core power mode.
|
||||
*
|
||||
* \return \ref group_system_config_cm4_status_macro
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint32_t Cy_SysGetCM4Status(void)
|
||||
{
|
||||
uint32_t regValue;
|
||||
|
||||
/* Get current power mode */
|
||||
regValue = CPUSS->CM4_PWR_CTL & CPUSS_CM4_PWR_CTL_PWR_MODE_Msk;
|
||||
|
||||
return (regValue);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysEnableCM4
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Sets vector table base address and enables the Cortex-M4 core.
|
||||
*
|
||||
* \note If the CPU is already enabled, it is reset and then enabled.
|
||||
*
|
||||
* \param vectorTableOffset The offset of the vector table base address from
|
||||
* memory address 0x00000000. The offset should be multiple to 1024 bytes.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SysEnableCM4(uint32_t vectorTableOffset)
|
||||
{
|
||||
uint32_t regValue;
|
||||
uint32_t interruptState;
|
||||
uint32_t cpuState;
|
||||
|
||||
CY_ASSERT_L2((vectorTableOffset & CY_SYS_CM4_VECTOR_TABLE_VALID_ADDR) == 0UL);
|
||||
|
||||
interruptState = Cy_SysLib_EnterCriticalSection();
|
||||
|
||||
cpuState = Cy_SysGetCM4Status();
|
||||
if (CY_SYS_CM4_STATUS_ENABLED == cpuState)
|
||||
{
|
||||
Cy_SysResetCM4();
|
||||
}
|
||||
|
||||
CPUSS->CM4_VECTOR_TABLE_BASE = vectorTableOffset;
|
||||
|
||||
regValue = CPUSS->CM4_PWR_CTL & ~(CPUSS_CM4_PWR_CTL_VECTKEYSTAT_Msk | CPUSS_CM4_PWR_CTL_PWR_MODE_Msk);
|
||||
regValue |= _VAL2FLD(CPUSS_CM4_PWR_CTL_VECTKEYSTAT, CY_SYS_CM4_PWR_CTL_KEY_OPEN);
|
||||
regValue |= CY_SYS_CM4_STATUS_ENABLED;
|
||||
CPUSS->CM4_PWR_CTL = regValue;
|
||||
|
||||
while((CPUSS->CM4_STATUS & CPUSS_CM4_STATUS_PWR_DONE_Msk) == 0UL)
|
||||
{
|
||||
/* Wait for the power mode to take effect */
|
||||
}
|
||||
|
||||
Cy_SysLib_ExitCriticalSection(interruptState);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysDisableCM4
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Disables the Cortex-M4 core and waits for the mode to take the effect.
|
||||
*
|
||||
* \warning Do not call the function while the Cortex-M4 is executing because
|
||||
* such a call may corrupt/abort a pending bus-transaction by the CPU and cause
|
||||
* unexpected behavior in the system including a deadlock. Call the function
|
||||
* while the Cortex-M4 core is in the Sleep or Deep Sleep low-power mode. Use
|
||||
* the \ref group_syspm Power Management (syspm) API to put the CPU into the
|
||||
* low-power modes. Use the \ref Cy_SysPm_ReadStatus() to get a status of the
|
||||
* CPU.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SysDisableCM4(void)
|
||||
{
|
||||
uint32_t interruptState;
|
||||
uint32_t regValue;
|
||||
|
||||
interruptState = Cy_SysLib_EnterCriticalSection();
|
||||
|
||||
regValue = CPUSS->CM4_PWR_CTL & ~(CPUSS_CM4_PWR_CTL_VECTKEYSTAT_Msk | CPUSS_CM4_PWR_CTL_PWR_MODE_Msk);
|
||||
regValue |= _VAL2FLD(CPUSS_CM4_PWR_CTL_VECTKEYSTAT, CY_SYS_CM4_PWR_CTL_KEY_OPEN);
|
||||
regValue |= CY_SYS_CM4_STATUS_DISABLED;
|
||||
CPUSS->CM4_PWR_CTL = regValue;
|
||||
|
||||
while((CPUSS->CM4_STATUS & CPUSS_CM4_STATUS_PWR_DONE_Msk) == 0UL)
|
||||
{
|
||||
/* Wait for the power mode to take effect */
|
||||
}
|
||||
|
||||
Cy_SysLib_ExitCriticalSection(interruptState);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysRetainCM4
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Retains the Cortex-M4 core and exists without waiting for the mode to take
|
||||
* effect.
|
||||
*
|
||||
* \note The retained mode can be entered only from the enabled mode.
|
||||
*
|
||||
* \warning Do not call the function while the Cortex-M4 is executing because
|
||||
* such a call may corrupt/abort a pending bus-transaction by the CPU and cause
|
||||
* unexpected behavior in the system including a deadlock. Call the function
|
||||
* while the Cortex-M4 core is in the Sleep or Deep Sleep low-power mode. Use
|
||||
* the \ref group_syspm Power Management (syspm) API to put the CPU into the
|
||||
* low-power modes. Use the \ref Cy_SysPm_ReadStatus() to get a status of the CPU.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SysRetainCM4(void)
|
||||
{
|
||||
uint32_t interruptState;
|
||||
uint32_t regValue;
|
||||
|
||||
interruptState = Cy_SysLib_EnterCriticalSection();
|
||||
|
||||
regValue = CPUSS->CM4_PWR_CTL & ~(CPUSS_CM4_PWR_CTL_VECTKEYSTAT_Msk | CPUSS_CM4_PWR_CTL_PWR_MODE_Msk);
|
||||
regValue |= _VAL2FLD(CPUSS_CM4_PWR_CTL_VECTKEYSTAT, CY_SYS_CM4_PWR_CTL_KEY_OPEN);
|
||||
regValue |= CY_SYS_CM4_STATUS_RETAINED;
|
||||
CPUSS->CM4_PWR_CTL = regValue;
|
||||
|
||||
Cy_SysLib_ExitCriticalSection(interruptState);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysResetCM4
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Resets the Cortex-M4 core and waits for the mode to take the effect.
|
||||
*
|
||||
* \note The reset mode can not be entered from the retained mode.
|
||||
*
|
||||
* \warning Do not call the function while the Cortex-M4 is executing because
|
||||
* such a call may corrupt/abort a pending bus-transaction by the CPU and cause
|
||||
* unexpected behavior in the system including a deadlock. Call the function
|
||||
* while the Cortex-M4 core is in the Sleep or Deep Sleep low-power mode. Use
|
||||
* the \ref group_syspm Power Management (syspm) API to put the CPU into the
|
||||
* low-power modes. Use the \ref Cy_SysPm_ReadStatus() to get a status of the CPU.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SysResetCM4(void)
|
||||
{
|
||||
uint32_t interruptState;
|
||||
uint32_t regValue;
|
||||
|
||||
interruptState = Cy_SysLib_EnterCriticalSection();
|
||||
|
||||
regValue = CPUSS->CM4_PWR_CTL & ~(CPUSS_CM4_PWR_CTL_VECTKEYSTAT_Msk | CPUSS_CM4_PWR_CTL_PWR_MODE_Msk);
|
||||
regValue |= _VAL2FLD(CPUSS_CM4_PWR_CTL_VECTKEYSTAT, CY_SYS_CM4_PWR_CTL_KEY_OPEN);
|
||||
regValue |= CY_SYS_CM4_STATUS_RESET;
|
||||
CPUSS->CM4_PWR_CTL = regValue;
|
||||
|
||||
while((CPUSS->CM4_STATUS & CPUSS_CM4_STATUS_PWR_DONE_Msk) == 0UL)
|
||||
{
|
||||
/* Wait for the power mode to take effect */
|
||||
}
|
||||
|
||||
Cy_SysLib_ExitCriticalSection(interruptState);
|
||||
}
|
||||
#endif /* #if (CY_SYSTEM_CPU_CM0P == 1UL) || defined(CY_DOXYGEN) */
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysIpcPipeIsrCm0
|
||||
****************************************************************************//**
|
||||
*
|
||||
* This is the interrupt service routine for the system pipe.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SysIpcPipeIsrCm0(void)
|
||||
{
|
||||
Cy_IPC_Pipe_ExecuteCallback(CY_IPC_EP_CYPIPE_CM0_ADDR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
*
|
||||
* The intention of the function is to declare boundaries of the memories for the
|
||||
* MDK compilers. For the rest of the supported compilers, this is done using
|
||||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
EXPORT __cy_memory_0_start
|
||||
EXPORT __cy_memory_0_length
|
||||
EXPORT __cy_memory_0_row_size
|
||||
|
||||
/* Working Flash */
|
||||
EXPORT __cy_memory_1_start
|
||||
EXPORT __cy_memory_1_length
|
||||
EXPORT __cy_memory_1_row_size
|
||||
|
||||
/* Supervisory Flash */
|
||||
EXPORT __cy_memory_2_start
|
||||
EXPORT __cy_memory_2_length
|
||||
EXPORT __cy_memory_2_row_size
|
||||
|
||||
/* XIP */
|
||||
EXPORT __cy_memory_3_start
|
||||
EXPORT __cy_memory_3_length
|
||||
EXPORT __cy_memory_3_row_size
|
||||
|
||||
/* eFuse */
|
||||
EXPORT __cy_memory_4_start
|
||||
EXPORT __cy_memory_4_length
|
||||
EXPORT __cy_memory_4_row_size
|
||||
|
||||
/* Flash */
|
||||
__cy_memory_0_start EQU __cpp(CY_FLASH_BASE)
|
||||
__cy_memory_0_length EQU __cpp(CY_FLASH_SIZE)
|
||||
__cy_memory_0_row_size EQU 0x200
|
||||
|
||||
/* Flash region for EEPROM emulation */
|
||||
__cy_memory_1_start EQU __cpp(CY_EM_EEPROM_BASE)
|
||||
__cy_memory_1_length EQU __cpp(CY_EM_EEPROM_SIZE)
|
||||
__cy_memory_1_row_size EQU 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
__cy_memory_2_start EQU __cpp(CY_SFLASH_BASE)
|
||||
__cy_memory_2_length EQU __cpp(CY_SFLASH_SIZE)
|
||||
__cy_memory_2_row_size EQU 0x200
|
||||
|
||||
/* XIP */
|
||||
__cy_memory_3_start EQU __cpp(CY_XIP_BASE)
|
||||
__cy_memory_3_length EQU __cpp(CY_XIP_SIZE)
|
||||
__cy_memory_3_row_size EQU 0x200
|
||||
|
||||
/* eFuse */
|
||||
__cy_memory_4_start EQU __cpp(0x90700000)
|
||||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,298 @@
|
|||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
|
||||
; The first line specifies a preprocessor command that the linker invokes
|
||||
; to pass a scatter file through a C preprocessor.
|
||||
|
||||
;*******************************************************************************
|
||||
;* \file cy8c6xx7_cm4_dual.scat
|
||||
;* \version 2.40
|
||||
;*
|
||||
;* Linker file for the ARMCC.
|
||||
;*
|
||||
;* The main purpose of the linker script is to describe how the sections in the
|
||||
;* input files should be mapped into the output file, and to control the memory
|
||||
;* layout of the output file.
|
||||
;*
|
||||
;* \note The entry point location is fixed and starts at 0x10000000. The valid
|
||||
;* application image should be placed there.
|
||||
;*
|
||||
;* \note The linker files included with the PDL template projects must be
|
||||
;* generic and handle all common use cases. Your project may not use every
|
||||
;* section defined in the linker files. In that case you may see the warnings
|
||||
;* during the build process: L6314W (no section matches pattern) and/or L6329W
|
||||
;* (pattern only matches removed unused sections). In your project, you can
|
||||
;* suppress the warning by passing the "--diag_suppress=L6314W,L6329W" option to
|
||||
;* the linker, simply comment out or remove the relevant code in the linker
|
||||
;* file.
|
||||
;*
|
||||
;*******************************************************************************
|
||||
;* \copyright
|
||||
;* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
;* 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
|
||||
;*
|
||||
;* 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.
|
||||
;******************************************************************************/
|
||||
|
||||
#if !defined(MBED_ROM_START)
|
||||
#define MBED_ROM_START 0x10002000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_START is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
;* is equal to MBED_ROM_START
|
||||
;*
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x000FE000
|
||||
#endif
|
||||
|
||||
;* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
;* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
;* is equal to MBED_ROM_SIZE
|
||||
;*
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08002000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x00045800
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
|
||||
; The defines below describe the location and size of blocks of memory in the target.
|
||||
; Use these defines to specify the memory regions available for allocation.
|
||||
|
||||
; The following defines control RAM and flash memory allocation for the CM4 core.
|
||||
; You can change the memory allocation by editing RAM and Flash defines.
|
||||
; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
; Using this memory region for other purposes will lead to unexpected behavior.
|
||||
; Your changes must be aligned with the corresponding defines for CM0+ core in 'xx_cm0plus.scat',
|
||||
; where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.scat'.
|
||||
; RAM
|
||||
#define RAM_START MBED_RAM_START
|
||||
#define RAM_SIZE MBED_RAM_SIZE
|
||||
; Flash
|
||||
#define FLASH_START MBED_APP_START
|
||||
#define FLASH_SIZE MBED_APP_SIZE
|
||||
|
||||
; The following defines describe a 32K flash region used for EEPROM emulation.
|
||||
; This region can also be used as the general purpose flash.
|
||||
; You can assign sections to this memory region for only one of the cores.
|
||||
; Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
|
||||
; Therefore, repurposing this memory region will prevent such middleware from operation.
|
||||
#define EM_EEPROM_START 0x14000000
|
||||
#define EM_EEPROM_SIZE 0x8000
|
||||
|
||||
; The following defines describe device specific memory regions and must not be changed.
|
||||
; Supervisory flash: User data
|
||||
#define SFLASH_USER_DATA_START 0x16000800
|
||||
#define SFLASH_USER_DATA_SIZE 0x00000800
|
||||
|
||||
; Supervisory flash: Normal Access Restrictions (NAR)
|
||||
#define SFLASH_NAR_START 0x16001A00
|
||||
#define SFLASH_NAR_SIZE 0x00000200
|
||||
|
||||
; Supervisory flash: Public Key
|
||||
#define SFLASH_PUBLIC_KEY_START 0x16005A00
|
||||
#define SFLASH_PUBLIC_KEY_SIZE 0x00000C00
|
||||
|
||||
; Supervisory flash: Table of Content # 2
|
||||
#define SFLASH_TOC_2_START 0x16007C00
|
||||
#define SFLASH_TOC_2_SIZE 0x00000200
|
||||
|
||||
; Supervisory flash: Table of Content # 2 Copy
|
||||
#define SFLASH_RTOC_2_START 0x16007E00
|
||||
#define SFLASH_RTOC_2_SIZE 0x00000200
|
||||
|
||||
; External memory
|
||||
#define XIP_START 0x18000000
|
||||
#define XIP_SIZE 0x08000000
|
||||
|
||||
; eFuse
|
||||
#define EFUSE_START 0x90700000
|
||||
#define EFUSE_SIZE 0x100000
|
||||
|
||||
|
||||
LR_IROM1 FLASH_START FLASH_SIZE
|
||||
{
|
||||
ER_FLASH_VECTORS +0
|
||||
{
|
||||
* (RESET, +FIRST)
|
||||
}
|
||||
|
||||
ER_FLASH_CODE +0 FIXED
|
||||
{
|
||||
* (InRoot$$Sections)
|
||||
* (+RO)
|
||||
}
|
||||
|
||||
ER_RAM_VECTORS RAM_START UNINIT
|
||||
{
|
||||
* (RESET_RAM, +FIRST)
|
||||
}
|
||||
|
||||
RW_RAM_DATA +0
|
||||
{
|
||||
* (.cy_ramfunc)
|
||||
.ANY (+RW, +ZI)
|
||||
}
|
||||
|
||||
; Place variables in the section that should not be initialized during the
|
||||
; device startup.
|
||||
RW_IRAM1 +0 UNINIT
|
||||
{
|
||||
* (.noinit)
|
||||
}
|
||||
|
||||
; Application heap area (HEAP)
|
||||
ARM_LIB_HEAP +0
|
||||
{
|
||||
* (HEAP)
|
||||
}
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK RAM_START+RAM_SIZE -Stack_Size
|
||||
{
|
||||
* (STACK)
|
||||
}
|
||||
|
||||
; Used for the digital signature of the secure application and the
|
||||
; Bootloader SDK application. The size of the section depends on the required
|
||||
; data size.
|
||||
.cy_app_signature (FLASH_START + FLASH_SIZE - 256) 256
|
||||
{
|
||||
* (.cy_app_signature)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Emulated EEPROM Flash area
|
||||
LR_EM_EEPROM EM_EEPROM_START EM_EEPROM_SIZE
|
||||
{
|
||||
.cy_em_eeprom +0
|
||||
{
|
||||
* (.cy_em_eeprom)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: User data
|
||||
LR_SFLASH_USER_DATA SFLASH_USER_DATA_START SFLASH_USER_DATA_SIZE
|
||||
{
|
||||
.cy_sflash_user_data +0
|
||||
{
|
||||
* (.cy_sflash_user_data)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Normal Access Restrictions (NAR)
|
||||
LR_SFLASH_NAR SFLASH_NAR_START SFLASH_NAR_SIZE
|
||||
{
|
||||
.cy_sflash_nar +0
|
||||
{
|
||||
* (.cy_sflash_nar)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Public Key
|
||||
LR_SFLASH_PUBLIC_KEY SFLASH_PUBLIC_KEY_START SFLASH_PUBLIC_KEY_SIZE
|
||||
{
|
||||
.cy_sflash_public_key +0
|
||||
{
|
||||
* (.cy_sflash_public_key)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Table of Content # 2
|
||||
LR_SFLASH_TOC_2 SFLASH_TOC_2_START SFLASH_TOC_2_SIZE
|
||||
{
|
||||
.cy_toc_part2 +0
|
||||
{
|
||||
* (.cy_toc_part2)
|
||||
}
|
||||
}
|
||||
|
||||
; Supervisory flash: Table of Content # 2 Copy
|
||||
LR_SFLASH_RTOC_2 SFLASH_RTOC_2_START SFLASH_RTOC_2_SIZE
|
||||
{
|
||||
.cy_rtoc_part2 +0
|
||||
{
|
||||
* (.cy_rtoc_part2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Places the code in the Execute in Place (XIP) section. See the smif driver documentation for details.
|
||||
LR_EROM XIP_START XIP_SIZE
|
||||
{
|
||||
.cy_xip +0
|
||||
{
|
||||
* (.cy_xip)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; eFuse
|
||||
LR_EFUSE EFUSE_START EFUSE_SIZE
|
||||
{
|
||||
.cy_efuse +0
|
||||
{
|
||||
* (.cy_efuse)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; The section is used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage.
|
||||
CYMETA 0x90500000
|
||||
{
|
||||
.cymeta +0 { * (.cymeta) }
|
||||
}
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
#define __cy_memory_0_start 0x10000000
|
||||
#define __cy_memory_0_length 0x00100000
|
||||
#define __cy_memory_0_row_size 0x200
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
#define __cy_memory_1_start 0x14000000
|
||||
#define __cy_memory_1_length 0x8000
|
||||
#define __cy_memory_1_row_size 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
#define __cy_memory_2_start 0x16000000
|
||||
#define __cy_memory_2_length 0x8000
|
||||
#define __cy_memory_2_row_size 0x200
|
||||
|
||||
/* XIP */
|
||||
#define __cy_memory_3_start 0x18000000
|
||||
#define __cy_memory_3_length 0x08000000
|
||||
#define __cy_memory_3_row_size 0x200
|
||||
|
||||
/* eFuse */
|
||||
#define __cy_memory_4_start 0x90700000
|
||||
#define __cy_memory_4_length 0x100000
|
||||
#define __cy_memory_4_row_size 1
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,692 @@
|
|||
;/**************************************************************************//**
|
||||
; * @file startup_psoc6_01_cm4.S
|
||||
; * @brief CMSIS Core Device Startup File for
|
||||
; * ARMCM4 Device Series
|
||||
; * @version V5.00
|
||||
; * @date 02. March 2016
|
||||
; ******************************************************************************/
|
||||
;/*
|
||||
; * Copyright (c) 2009-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.
|
||||
; */
|
||||
|
||||
;/*
|
||||
;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
;*/
|
||||
|
||||
; <h> Stack Configuration
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
IF :DEF:__STACK_SIZE
|
||||
Stack_Size EQU __STACK_SIZE
|
||||
ELSE
|
||||
Stack_Size EQU 0x00000400
|
||||
ENDIF
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
IF :DEF:__HEAP_SIZE
|
||||
Heap_Size EQU __HEAP_SIZE
|
||||
ELSE
|
||||
Heap_Size EQU 0x00000400
|
||||
ENDIF
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
Heap_Mem SPACE Heap_Size
|
||||
__heap_limit
|
||||
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
|
||||
__Vectors DCD __initial_sp ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
|
||||
DCD 0x0000000D ; NMI Handler located at ROM code
|
||||
DCD HardFault_Handler ; Hard Fault Handler
|
||||
DCD MemManage_Handler ; MPU Fault Handler
|
||||
DCD BusFault_Handler ; Bus Fault Handler
|
||||
DCD UsageFault_Handler ; Usage Fault Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD SVC_Handler ; SVCall Handler
|
||||
DCD DebugMon_Handler ; Debug Monitor Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External interrupts Description
|
||||
DCD ioss_interrupts_gpio_0_IRQHandler ; GPIO Port Interrupt #0
|
||||
DCD ioss_interrupts_gpio_1_IRQHandler ; GPIO Port Interrupt #1
|
||||
DCD ioss_interrupts_gpio_2_IRQHandler ; GPIO Port Interrupt #2
|
||||
DCD ioss_interrupts_gpio_3_IRQHandler ; GPIO Port Interrupt #3
|
||||
DCD ioss_interrupts_gpio_4_IRQHandler ; GPIO Port Interrupt #4
|
||||
DCD ioss_interrupts_gpio_5_IRQHandler ; GPIO Port Interrupt #5
|
||||
DCD ioss_interrupts_gpio_6_IRQHandler ; GPIO Port Interrupt #6
|
||||
DCD ioss_interrupts_gpio_7_IRQHandler ; GPIO Port Interrupt #7
|
||||
DCD ioss_interrupts_gpio_8_IRQHandler ; GPIO Port Interrupt #8
|
||||
DCD ioss_interrupts_gpio_9_IRQHandler ; GPIO Port Interrupt #9
|
||||
DCD ioss_interrupts_gpio_10_IRQHandler ; GPIO Port Interrupt #10
|
||||
DCD ioss_interrupts_gpio_11_IRQHandler ; GPIO Port Interrupt #11
|
||||
DCD ioss_interrupts_gpio_12_IRQHandler ; GPIO Port Interrupt #12
|
||||
DCD ioss_interrupts_gpio_13_IRQHandler ; GPIO Port Interrupt #13
|
||||
DCD ioss_interrupts_gpio_14_IRQHandler ; GPIO Port Interrupt #14
|
||||
DCD ioss_interrupt_gpio_IRQHandler ; GPIO All Ports
|
||||
DCD ioss_interrupt_vdd_IRQHandler ; GPIO Supply Detect Interrupt
|
||||
DCD lpcomp_interrupt_IRQHandler ; Low Power Comparator Interrupt
|
||||
DCD scb_8_interrupt_IRQHandler ; Serial Communication Block #8 (DeepSleep capable)
|
||||
DCD srss_interrupt_mcwdt_0_IRQHandler ; Multi Counter Watchdog Timer interrupt
|
||||
DCD srss_interrupt_mcwdt_1_IRQHandler ; Multi Counter Watchdog Timer interrupt
|
||||
DCD srss_interrupt_backup_IRQHandler ; Backup domain interrupt
|
||||
DCD srss_interrupt_IRQHandler ; Other combined Interrupts for SRSS (LVD, WDT, CLKCAL)
|
||||
DCD pass_interrupt_ctbs_IRQHandler ; CTBm Interrupt (all CTBms)
|
||||
DCD bless_interrupt_IRQHandler ; Bluetooth Radio interrupt
|
||||
DCD cpuss_interrupts_ipc_0_IRQHandler ; CPUSS Inter Process Communication Interrupt #0
|
||||
DCD cpuss_interrupts_ipc_1_IRQHandler ; CPUSS Inter Process Communication Interrupt #1
|
||||
DCD cpuss_interrupts_ipc_2_IRQHandler ; CPUSS Inter Process Communication Interrupt #2
|
||||
DCD cpuss_interrupts_ipc_3_IRQHandler ; CPUSS Inter Process Communication Interrupt #3
|
||||
DCD cpuss_interrupts_ipc_4_IRQHandler ; CPUSS Inter Process Communication Interrupt #4
|
||||
DCD cpuss_interrupts_ipc_5_IRQHandler ; CPUSS Inter Process Communication Interrupt #5
|
||||
DCD cpuss_interrupts_ipc_6_IRQHandler ; CPUSS Inter Process Communication Interrupt #6
|
||||
DCD cpuss_interrupts_ipc_7_IRQHandler ; CPUSS Inter Process Communication Interrupt #7
|
||||
DCD cpuss_interrupts_ipc_8_IRQHandler ; CPUSS Inter Process Communication Interrupt #8
|
||||
DCD cpuss_interrupts_ipc_9_IRQHandler ; CPUSS Inter Process Communication Interrupt #9
|
||||
DCD cpuss_interrupts_ipc_10_IRQHandler ; CPUSS Inter Process Communication Interrupt #10
|
||||
DCD cpuss_interrupts_ipc_11_IRQHandler ; CPUSS Inter Process Communication Interrupt #11
|
||||
DCD cpuss_interrupts_ipc_12_IRQHandler ; CPUSS Inter Process Communication Interrupt #12
|
||||
DCD cpuss_interrupts_ipc_13_IRQHandler ; CPUSS Inter Process Communication Interrupt #13
|
||||
DCD cpuss_interrupts_ipc_14_IRQHandler ; CPUSS Inter Process Communication Interrupt #14
|
||||
DCD cpuss_interrupts_ipc_15_IRQHandler ; CPUSS Inter Process Communication Interrupt #15
|
||||
DCD scb_0_interrupt_IRQHandler ; Serial Communication Block #0
|
||||
DCD scb_1_interrupt_IRQHandler ; Serial Communication Block #1
|
||||
DCD scb_2_interrupt_IRQHandler ; Serial Communication Block #2
|
||||
DCD scb_3_interrupt_IRQHandler ; Serial Communication Block #3
|
||||
DCD scb_4_interrupt_IRQHandler ; Serial Communication Block #4
|
||||
DCD scb_5_interrupt_IRQHandler ; Serial Communication Block #5
|
||||
DCD scb_6_interrupt_IRQHandler ; Serial Communication Block #6
|
||||
DCD scb_7_interrupt_IRQHandler ; Serial Communication Block #7
|
||||
DCD csd_interrupt_IRQHandler ; CSD (Capsense) interrupt
|
||||
DCD cpuss_interrupts_dw0_0_IRQHandler ; CPUSS DataWire #0, Channel #0
|
||||
DCD cpuss_interrupts_dw0_1_IRQHandler ; CPUSS DataWire #0, Channel #1
|
||||
DCD cpuss_interrupts_dw0_2_IRQHandler ; CPUSS DataWire #0, Channel #2
|
||||
DCD cpuss_interrupts_dw0_3_IRQHandler ; CPUSS DataWire #0, Channel #3
|
||||
DCD cpuss_interrupts_dw0_4_IRQHandler ; CPUSS DataWire #0, Channel #4
|
||||
DCD cpuss_interrupts_dw0_5_IRQHandler ; CPUSS DataWire #0, Channel #5
|
||||
DCD cpuss_interrupts_dw0_6_IRQHandler ; CPUSS DataWire #0, Channel #6
|
||||
DCD cpuss_interrupts_dw0_7_IRQHandler ; CPUSS DataWire #0, Channel #7
|
||||
DCD cpuss_interrupts_dw0_8_IRQHandler ; CPUSS DataWire #0, Channel #8
|
||||
DCD cpuss_interrupts_dw0_9_IRQHandler ; CPUSS DataWire #0, Channel #9
|
||||
DCD cpuss_interrupts_dw0_10_IRQHandler ; CPUSS DataWire #0, Channel #10
|
||||
DCD cpuss_interrupts_dw0_11_IRQHandler ; CPUSS DataWire #0, Channel #11
|
||||
DCD cpuss_interrupts_dw0_12_IRQHandler ; CPUSS DataWire #0, Channel #12
|
||||
DCD cpuss_interrupts_dw0_13_IRQHandler ; CPUSS DataWire #0, Channel #13
|
||||
DCD cpuss_interrupts_dw0_14_IRQHandler ; CPUSS DataWire #0, Channel #14
|
||||
DCD cpuss_interrupts_dw0_15_IRQHandler ; CPUSS DataWire #0, Channel #15
|
||||
DCD cpuss_interrupts_dw1_0_IRQHandler ; CPUSS DataWire #1, Channel #0
|
||||
DCD cpuss_interrupts_dw1_1_IRQHandler ; CPUSS DataWire #1, Channel #1
|
||||
DCD cpuss_interrupts_dw1_2_IRQHandler ; CPUSS DataWire #1, Channel #2
|
||||
DCD cpuss_interrupts_dw1_3_IRQHandler ; CPUSS DataWire #1, Channel #3
|
||||
DCD cpuss_interrupts_dw1_4_IRQHandler ; CPUSS DataWire #1, Channel #4
|
||||
DCD cpuss_interrupts_dw1_5_IRQHandler ; CPUSS DataWire #1, Channel #5
|
||||
DCD cpuss_interrupts_dw1_6_IRQHandler ; CPUSS DataWire #1, Channel #6
|
||||
DCD cpuss_interrupts_dw1_7_IRQHandler ; CPUSS DataWire #1, Channel #7
|
||||
DCD cpuss_interrupts_dw1_8_IRQHandler ; CPUSS DataWire #1, Channel #8
|
||||
DCD cpuss_interrupts_dw1_9_IRQHandler ; CPUSS DataWire #1, Channel #9
|
||||
DCD cpuss_interrupts_dw1_10_IRQHandler ; CPUSS DataWire #1, Channel #10
|
||||
DCD cpuss_interrupts_dw1_11_IRQHandler ; CPUSS DataWire #1, Channel #11
|
||||
DCD cpuss_interrupts_dw1_12_IRQHandler ; CPUSS DataWire #1, Channel #12
|
||||
DCD cpuss_interrupts_dw1_13_IRQHandler ; CPUSS DataWire #1, Channel #13
|
||||
DCD cpuss_interrupts_dw1_14_IRQHandler ; CPUSS DataWire #1, Channel #14
|
||||
DCD cpuss_interrupts_dw1_15_IRQHandler ; CPUSS DataWire #1, Channel #15
|
||||
DCD cpuss_interrupts_fault_0_IRQHandler ; CPUSS Fault Structure Interrupt #0
|
||||
DCD cpuss_interrupts_fault_1_IRQHandler ; CPUSS Fault Structure Interrupt #1
|
||||
DCD cpuss_interrupt_crypto_IRQHandler ; CRYPTO Accelerator Interrupt
|
||||
DCD cpuss_interrupt_fm_IRQHandler ; FLASH Macro Interrupt
|
||||
DCD cpuss_interrupts_cm0_cti_0_IRQHandler ; CM0+ CTI #0
|
||||
DCD cpuss_interrupts_cm0_cti_1_IRQHandler ; CM0+ CTI #1
|
||||
DCD cpuss_interrupts_cm4_cti_0_IRQHandler ; CM4 CTI #0
|
||||
DCD cpuss_interrupts_cm4_cti_1_IRQHandler ; CM4 CTI #1
|
||||
DCD tcpwm_0_interrupts_0_IRQHandler ; TCPWM #0, Counter #0
|
||||
DCD tcpwm_0_interrupts_1_IRQHandler ; TCPWM #0, Counter #1
|
||||
DCD tcpwm_0_interrupts_2_IRQHandler ; TCPWM #0, Counter #2
|
||||
DCD tcpwm_0_interrupts_3_IRQHandler ; TCPWM #0, Counter #3
|
||||
DCD tcpwm_0_interrupts_4_IRQHandler ; TCPWM #0, Counter #4
|
||||
DCD tcpwm_0_interrupts_5_IRQHandler ; TCPWM #0, Counter #5
|
||||
DCD tcpwm_0_interrupts_6_IRQHandler ; TCPWM #0, Counter #6
|
||||
DCD tcpwm_0_interrupts_7_IRQHandler ; TCPWM #0, Counter #7
|
||||
DCD tcpwm_1_interrupts_0_IRQHandler ; TCPWM #1, Counter #0
|
||||
DCD tcpwm_1_interrupts_1_IRQHandler ; TCPWM #1, Counter #1
|
||||
DCD tcpwm_1_interrupts_2_IRQHandler ; TCPWM #1, Counter #2
|
||||
DCD tcpwm_1_interrupts_3_IRQHandler ; TCPWM #1, Counter #3
|
||||
DCD tcpwm_1_interrupts_4_IRQHandler ; TCPWM #1, Counter #4
|
||||
DCD tcpwm_1_interrupts_5_IRQHandler ; TCPWM #1, Counter #5
|
||||
DCD tcpwm_1_interrupts_6_IRQHandler ; TCPWM #1, Counter #6
|
||||
DCD tcpwm_1_interrupts_7_IRQHandler ; TCPWM #1, Counter #7
|
||||
DCD tcpwm_1_interrupts_8_IRQHandler ; TCPWM #1, Counter #8
|
||||
DCD tcpwm_1_interrupts_9_IRQHandler ; TCPWM #1, Counter #9
|
||||
DCD tcpwm_1_interrupts_10_IRQHandler ; TCPWM #1, Counter #10
|
||||
DCD tcpwm_1_interrupts_11_IRQHandler ; TCPWM #1, Counter #11
|
||||
DCD tcpwm_1_interrupts_12_IRQHandler ; TCPWM #1, Counter #12
|
||||
DCD tcpwm_1_interrupts_13_IRQHandler ; TCPWM #1, Counter #13
|
||||
DCD tcpwm_1_interrupts_14_IRQHandler ; TCPWM #1, Counter #14
|
||||
DCD tcpwm_1_interrupts_15_IRQHandler ; TCPWM #1, Counter #15
|
||||
DCD tcpwm_1_interrupts_16_IRQHandler ; TCPWM #1, Counter #16
|
||||
DCD tcpwm_1_interrupts_17_IRQHandler ; TCPWM #1, Counter #17
|
||||
DCD tcpwm_1_interrupts_18_IRQHandler ; TCPWM #1, Counter #18
|
||||
DCD tcpwm_1_interrupts_19_IRQHandler ; TCPWM #1, Counter #19
|
||||
DCD tcpwm_1_interrupts_20_IRQHandler ; TCPWM #1, Counter #20
|
||||
DCD tcpwm_1_interrupts_21_IRQHandler ; TCPWM #1, Counter #21
|
||||
DCD tcpwm_1_interrupts_22_IRQHandler ; TCPWM #1, Counter #22
|
||||
DCD tcpwm_1_interrupts_23_IRQHandler ; TCPWM #1, Counter #23
|
||||
DCD udb_interrupts_0_IRQHandler ; UDB Interrupt #0
|
||||
DCD udb_interrupts_1_IRQHandler ; UDB Interrupt #1
|
||||
DCD udb_interrupts_2_IRQHandler ; UDB Interrupt #2
|
||||
DCD udb_interrupts_3_IRQHandler ; UDB Interrupt #3
|
||||
DCD udb_interrupts_4_IRQHandler ; UDB Interrupt #4
|
||||
DCD udb_interrupts_5_IRQHandler ; UDB Interrupt #5
|
||||
DCD udb_interrupts_6_IRQHandler ; UDB Interrupt #6
|
||||
DCD udb_interrupts_7_IRQHandler ; UDB Interrupt #7
|
||||
DCD udb_interrupts_8_IRQHandler ; UDB Interrupt #8
|
||||
DCD udb_interrupts_9_IRQHandler ; UDB Interrupt #9
|
||||
DCD udb_interrupts_10_IRQHandler ; UDB Interrupt #10
|
||||
DCD udb_interrupts_11_IRQHandler ; UDB Interrupt #11
|
||||
DCD udb_interrupts_12_IRQHandler ; UDB Interrupt #12
|
||||
DCD udb_interrupts_13_IRQHandler ; UDB Interrupt #13
|
||||
DCD udb_interrupts_14_IRQHandler ; UDB Interrupt #14
|
||||
DCD udb_interrupts_15_IRQHandler ; UDB Interrupt #15
|
||||
DCD pass_interrupt_sar_IRQHandler ; SAR ADC interrupt
|
||||
DCD audioss_interrupt_i2s_IRQHandler ; I2S Audio interrupt
|
||||
DCD audioss_interrupt_pdm_IRQHandler ; PDM/PCM Audio interrupt
|
||||
DCD profile_interrupt_IRQHandler ; Energy Profiler interrupt
|
||||
DCD smif_interrupt_IRQHandler ; Serial Memory Interface interrupt
|
||||
DCD usb_interrupt_hi_IRQHandler ; USB Interrupt
|
||||
DCD usb_interrupt_med_IRQHandler ; USB Interrupt
|
||||
DCD usb_interrupt_lo_IRQHandler ; USB Interrupt
|
||||
DCD pass_interrupt_dacs_IRQHandler ; Consolidated interrrupt for all DACs
|
||||
|
||||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
EXPORT __ramVectors
|
||||
AREA RESET_RAM, READWRITE, NOINIT
|
||||
__ramVectors SPACE __Vectors_Size
|
||||
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
|
||||
; Weak function for startup customization
|
||||
;
|
||||
; Note. The global resources are not yet initialized (for example global variables, peripherals, clocks)
|
||||
; because this function is executed as the first instruction in the ResetHandler.
|
||||
; The PDL is also not initialized to use the proper register offsets.
|
||||
; The user of this function is responsible for initializing the PDL and resources before using them.
|
||||
;
|
||||
Cy_OnResetUser PROC
|
||||
EXPORT Cy_OnResetUser [WEAK]
|
||||
BX LR
|
||||
ENDP
|
||||
|
||||
; Reset Handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT Cy_SystemInitFpuEnable
|
||||
IMPORT __main
|
||||
|
||||
; Define strong function for startup customization
|
||||
BL Cy_OnResetUser
|
||||
|
||||
; Disable global interrupts
|
||||
CPSID I
|
||||
|
||||
; Copy vectors from ROM to RAM
|
||||
LDR r1, =__Vectors
|
||||
LDR r0, =__ramVectors
|
||||
LDR r2, =__Vectors_Size
|
||||
Vectors_Copy
|
||||
LDR r3, [r1]
|
||||
STR r3, [r0]
|
||||
ADDS r0, r0, #4
|
||||
ADDS r1, r1, #4
|
||||
SUBS r2, r2, #1
|
||||
CMP r2, #0
|
||||
BNE Vectors_Copy
|
||||
|
||||
; Update Vector Table Offset Register. */
|
||||
LDR r0, =__ramVectors
|
||||
LDR r1, =0xE000ED08
|
||||
STR r0, [r1]
|
||||
dsb 0xF
|
||||
|
||||
; Enable the FPU if used
|
||||
LDR R0, =Cy_SystemInitFpuEnable
|
||||
BLX R0
|
||||
|
||||
LDR R0, =__main
|
||||
BLX R0
|
||||
|
||||
; Should never get here
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Cy_SysLib_FaultHandler PROC
|
||||
EXPORT Cy_SysLib_FaultHandler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
HardFault_Wrapper\
|
||||
PROC
|
||||
EXPORT HardFault_Wrapper [WEAK]
|
||||
movs r0, #4
|
||||
mov r1, LR
|
||||
tst r0, r1
|
||||
beq L_MSP
|
||||
mrs r0, PSP
|
||||
bl L_API_call
|
||||
L_MSP
|
||||
mrs r0, MSP
|
||||
L_API_call
|
||||
bl Cy_SysLib_FaultHandler
|
||||
ENDP
|
||||
HardFault_Handler\
|
||||
PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
B HardFault_Wrapper
|
||||
ENDP
|
||||
MemManage_Handler\
|
||||
PROC
|
||||
EXPORT MemManage_Handler [WEAK]
|
||||
B HardFault_Wrapper
|
||||
ENDP
|
||||
BusFault_Handler\
|
||||
PROC
|
||||
EXPORT BusFault_Handler [WEAK]
|
||||
B HardFault_Wrapper
|
||||
ENDP
|
||||
UsageFault_Handler\
|
||||
PROC
|
||||
EXPORT UsageFault_Handler [WEAK]
|
||||
B HardFault_Wrapper
|
||||
ENDP
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
DebugMon_Handler\
|
||||
PROC
|
||||
EXPORT DebugMon_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
EXPORT Default_Handler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_0_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_1_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_2_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_3_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_4_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_5_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_6_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_7_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_8_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_9_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_10_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_11_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_12_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_13_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupts_gpio_14_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupt_gpio_IRQHandler [WEAK]
|
||||
EXPORT ioss_interrupt_vdd_IRQHandler [WEAK]
|
||||
EXPORT lpcomp_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_8_interrupt_IRQHandler [WEAK]
|
||||
EXPORT srss_interrupt_mcwdt_0_IRQHandler [WEAK]
|
||||
EXPORT srss_interrupt_mcwdt_1_IRQHandler [WEAK]
|
||||
EXPORT srss_interrupt_backup_IRQHandler [WEAK]
|
||||
EXPORT srss_interrupt_IRQHandler [WEAK]
|
||||
EXPORT pass_interrupt_ctbs_IRQHandler [WEAK]
|
||||
EXPORT bless_interrupt_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_0_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_1_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_2_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_3_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_4_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_5_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_6_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_7_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_8_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_9_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_10_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_11_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_12_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_13_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_14_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_ipc_15_IRQHandler [WEAK]
|
||||
EXPORT scb_0_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_1_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_2_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_3_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_4_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_5_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_6_interrupt_IRQHandler [WEAK]
|
||||
EXPORT scb_7_interrupt_IRQHandler [WEAK]
|
||||
EXPORT csd_interrupt_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_0_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_1_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_2_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_3_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_4_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_5_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_6_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_7_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_8_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_9_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_10_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_11_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_12_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_13_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_14_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw0_15_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_0_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_1_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_2_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_3_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_4_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_5_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_6_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_7_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_8_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_9_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_10_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_11_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_12_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_13_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_14_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_dw1_15_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_fault_0_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_fault_1_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupt_crypto_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupt_fm_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_cm0_cti_0_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_cm0_cti_1_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_cm4_cti_0_IRQHandler [WEAK]
|
||||
EXPORT cpuss_interrupts_cm4_cti_1_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_0_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_1_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_2_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_3_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_4_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_5_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_6_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_0_interrupts_7_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_0_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_1_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_2_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_3_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_4_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_5_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_6_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_7_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_8_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_9_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_10_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_11_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_12_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_13_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_14_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_15_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_16_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_17_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_18_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_19_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_20_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_21_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_22_IRQHandler [WEAK]
|
||||
EXPORT tcpwm_1_interrupts_23_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_0_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_1_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_2_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_3_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_4_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_5_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_6_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_7_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_8_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_9_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_10_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_11_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_12_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_13_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_14_IRQHandler [WEAK]
|
||||
EXPORT udb_interrupts_15_IRQHandler [WEAK]
|
||||
EXPORT pass_interrupt_sar_IRQHandler [WEAK]
|
||||
EXPORT audioss_interrupt_i2s_IRQHandler [WEAK]
|
||||
EXPORT audioss_interrupt_pdm_IRQHandler [WEAK]
|
||||
EXPORT profile_interrupt_IRQHandler [WEAK]
|
||||
EXPORT smif_interrupt_IRQHandler [WEAK]
|
||||
EXPORT usb_interrupt_hi_IRQHandler [WEAK]
|
||||
EXPORT usb_interrupt_med_IRQHandler [WEAK]
|
||||
EXPORT usb_interrupt_lo_IRQHandler [WEAK]
|
||||
EXPORT pass_interrupt_dacs_IRQHandler [WEAK]
|
||||
|
||||
ioss_interrupts_gpio_0_IRQHandler
|
||||
ioss_interrupts_gpio_1_IRQHandler
|
||||
ioss_interrupts_gpio_2_IRQHandler
|
||||
ioss_interrupts_gpio_3_IRQHandler
|
||||
ioss_interrupts_gpio_4_IRQHandler
|
||||
ioss_interrupts_gpio_5_IRQHandler
|
||||
ioss_interrupts_gpio_6_IRQHandler
|
||||
ioss_interrupts_gpio_7_IRQHandler
|
||||
ioss_interrupts_gpio_8_IRQHandler
|
||||
ioss_interrupts_gpio_9_IRQHandler
|
||||
ioss_interrupts_gpio_10_IRQHandler
|
||||
ioss_interrupts_gpio_11_IRQHandler
|
||||
ioss_interrupts_gpio_12_IRQHandler
|
||||
ioss_interrupts_gpio_13_IRQHandler
|
||||
ioss_interrupts_gpio_14_IRQHandler
|
||||
ioss_interrupt_gpio_IRQHandler
|
||||
ioss_interrupt_vdd_IRQHandler
|
||||
lpcomp_interrupt_IRQHandler
|
||||
scb_8_interrupt_IRQHandler
|
||||
srss_interrupt_mcwdt_0_IRQHandler
|
||||
srss_interrupt_mcwdt_1_IRQHandler
|
||||
srss_interrupt_backup_IRQHandler
|
||||
srss_interrupt_IRQHandler
|
||||
pass_interrupt_ctbs_IRQHandler
|
||||
bless_interrupt_IRQHandler
|
||||
cpuss_interrupts_ipc_0_IRQHandler
|
||||
cpuss_interrupts_ipc_1_IRQHandler
|
||||
cpuss_interrupts_ipc_2_IRQHandler
|
||||
cpuss_interrupts_ipc_3_IRQHandler
|
||||
cpuss_interrupts_ipc_4_IRQHandler
|
||||
cpuss_interrupts_ipc_5_IRQHandler
|
||||
cpuss_interrupts_ipc_6_IRQHandler
|
||||
cpuss_interrupts_ipc_7_IRQHandler
|
||||
cpuss_interrupts_ipc_8_IRQHandler
|
||||
cpuss_interrupts_ipc_9_IRQHandler
|
||||
cpuss_interrupts_ipc_10_IRQHandler
|
||||
cpuss_interrupts_ipc_11_IRQHandler
|
||||
cpuss_interrupts_ipc_12_IRQHandler
|
||||
cpuss_interrupts_ipc_13_IRQHandler
|
||||
cpuss_interrupts_ipc_14_IRQHandler
|
||||
cpuss_interrupts_ipc_15_IRQHandler
|
||||
scb_0_interrupt_IRQHandler
|
||||
scb_1_interrupt_IRQHandler
|
||||
scb_2_interrupt_IRQHandler
|
||||
scb_3_interrupt_IRQHandler
|
||||
scb_4_interrupt_IRQHandler
|
||||
scb_5_interrupt_IRQHandler
|
||||
scb_6_interrupt_IRQHandler
|
||||
scb_7_interrupt_IRQHandler
|
||||
csd_interrupt_IRQHandler
|
||||
cpuss_interrupts_dw0_0_IRQHandler
|
||||
cpuss_interrupts_dw0_1_IRQHandler
|
||||
cpuss_interrupts_dw0_2_IRQHandler
|
||||
cpuss_interrupts_dw0_3_IRQHandler
|
||||
cpuss_interrupts_dw0_4_IRQHandler
|
||||
cpuss_interrupts_dw0_5_IRQHandler
|
||||
cpuss_interrupts_dw0_6_IRQHandler
|
||||
cpuss_interrupts_dw0_7_IRQHandler
|
||||
cpuss_interrupts_dw0_8_IRQHandler
|
||||
cpuss_interrupts_dw0_9_IRQHandler
|
||||
cpuss_interrupts_dw0_10_IRQHandler
|
||||
cpuss_interrupts_dw0_11_IRQHandler
|
||||
cpuss_interrupts_dw0_12_IRQHandler
|
||||
cpuss_interrupts_dw0_13_IRQHandler
|
||||
cpuss_interrupts_dw0_14_IRQHandler
|
||||
cpuss_interrupts_dw0_15_IRQHandler
|
||||
cpuss_interrupts_dw1_0_IRQHandler
|
||||
cpuss_interrupts_dw1_1_IRQHandler
|
||||
cpuss_interrupts_dw1_2_IRQHandler
|
||||
cpuss_interrupts_dw1_3_IRQHandler
|
||||
cpuss_interrupts_dw1_4_IRQHandler
|
||||
cpuss_interrupts_dw1_5_IRQHandler
|
||||
cpuss_interrupts_dw1_6_IRQHandler
|
||||
cpuss_interrupts_dw1_7_IRQHandler
|
||||
cpuss_interrupts_dw1_8_IRQHandler
|
||||
cpuss_interrupts_dw1_9_IRQHandler
|
||||
cpuss_interrupts_dw1_10_IRQHandler
|
||||
cpuss_interrupts_dw1_11_IRQHandler
|
||||
cpuss_interrupts_dw1_12_IRQHandler
|
||||
cpuss_interrupts_dw1_13_IRQHandler
|
||||
cpuss_interrupts_dw1_14_IRQHandler
|
||||
cpuss_interrupts_dw1_15_IRQHandler
|
||||
cpuss_interrupts_fault_0_IRQHandler
|
||||
cpuss_interrupts_fault_1_IRQHandler
|
||||
cpuss_interrupt_crypto_IRQHandler
|
||||
cpuss_interrupt_fm_IRQHandler
|
||||
cpuss_interrupts_cm0_cti_0_IRQHandler
|
||||
cpuss_interrupts_cm0_cti_1_IRQHandler
|
||||
cpuss_interrupts_cm4_cti_0_IRQHandler
|
||||
cpuss_interrupts_cm4_cti_1_IRQHandler
|
||||
tcpwm_0_interrupts_0_IRQHandler
|
||||
tcpwm_0_interrupts_1_IRQHandler
|
||||
tcpwm_0_interrupts_2_IRQHandler
|
||||
tcpwm_0_interrupts_3_IRQHandler
|
||||
tcpwm_0_interrupts_4_IRQHandler
|
||||
tcpwm_0_interrupts_5_IRQHandler
|
||||
tcpwm_0_interrupts_6_IRQHandler
|
||||
tcpwm_0_interrupts_7_IRQHandler
|
||||
tcpwm_1_interrupts_0_IRQHandler
|
||||
tcpwm_1_interrupts_1_IRQHandler
|
||||
tcpwm_1_interrupts_2_IRQHandler
|
||||
tcpwm_1_interrupts_3_IRQHandler
|
||||
tcpwm_1_interrupts_4_IRQHandler
|
||||
tcpwm_1_interrupts_5_IRQHandler
|
||||
tcpwm_1_interrupts_6_IRQHandler
|
||||
tcpwm_1_interrupts_7_IRQHandler
|
||||
tcpwm_1_interrupts_8_IRQHandler
|
||||
tcpwm_1_interrupts_9_IRQHandler
|
||||
tcpwm_1_interrupts_10_IRQHandler
|
||||
tcpwm_1_interrupts_11_IRQHandler
|
||||
tcpwm_1_interrupts_12_IRQHandler
|
||||
tcpwm_1_interrupts_13_IRQHandler
|
||||
tcpwm_1_interrupts_14_IRQHandler
|
||||
tcpwm_1_interrupts_15_IRQHandler
|
||||
tcpwm_1_interrupts_16_IRQHandler
|
||||
tcpwm_1_interrupts_17_IRQHandler
|
||||
tcpwm_1_interrupts_18_IRQHandler
|
||||
tcpwm_1_interrupts_19_IRQHandler
|
||||
tcpwm_1_interrupts_20_IRQHandler
|
||||
tcpwm_1_interrupts_21_IRQHandler
|
||||
tcpwm_1_interrupts_22_IRQHandler
|
||||
tcpwm_1_interrupts_23_IRQHandler
|
||||
udb_interrupts_0_IRQHandler
|
||||
udb_interrupts_1_IRQHandler
|
||||
udb_interrupts_2_IRQHandler
|
||||
udb_interrupts_3_IRQHandler
|
||||
udb_interrupts_4_IRQHandler
|
||||
udb_interrupts_5_IRQHandler
|
||||
udb_interrupts_6_IRQHandler
|
||||
udb_interrupts_7_IRQHandler
|
||||
udb_interrupts_8_IRQHandler
|
||||
udb_interrupts_9_IRQHandler
|
||||
udb_interrupts_10_IRQHandler
|
||||
udb_interrupts_11_IRQHandler
|
||||
udb_interrupts_12_IRQHandler
|
||||
udb_interrupts_13_IRQHandler
|
||||
udb_interrupts_14_IRQHandler
|
||||
udb_interrupts_15_IRQHandler
|
||||
pass_interrupt_sar_IRQHandler
|
||||
audioss_interrupt_i2s_IRQHandler
|
||||
audioss_interrupt_pdm_IRQHandler
|
||||
profile_interrupt_IRQHandler
|
||||
smif_interrupt_IRQHandler
|
||||
usb_interrupt_hi_IRQHandler
|
||||
usb_interrupt_med_IRQHandler
|
||||
usb_interrupt_lo_IRQHandler
|
||||
pass_interrupt_dacs_IRQHandler
|
||||
|
||||
B .
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
|
||||
; User Initial Stack & Heap
|
||||
|
||||
IF :DEF:__MICROLIB
|
||||
|
||||
EXPORT __initial_sp
|
||||
EXPORT __heap_base
|
||||
EXPORT __heap_limit
|
||||
|
||||
ELSE
|
||||
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
||||
LDR R0, =Heap_Mem
|
||||
LDR R1, =(Stack_Mem + Stack_Size)
|
||||
LDR R2, =(Heap_Mem + Heap_Size)
|
||||
LDR R3, =Stack_Mem
|
||||
BX LR
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
ENDIF
|
||||
|
||||
END
|
||||
|
||||
|
||||
; [] END OF FILE
|
|
@ -0,0 +1,447 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm4_dual.ld
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the GNU C compiler.
|
||||
*
|
||||
* The main purpose of the linker script is to describe how the sections in the
|
||||
* input files should be mapped into the output file, and to control the memory
|
||||
* layout of the output file.
|
||||
*
|
||||
* \note The entry point location is fixed and starts at 0x10000000. The valid
|
||||
* application image should be placed there.
|
||||
*
|
||||
* \note The linker files included with the PDL template projects must be generic
|
||||
* and handle all common use cases. Your project may not use every section
|
||||
* defined in the linker files. In that case you may see warnings during the
|
||||
* build process. In your project, you can simply comment out or remove the
|
||||
* relevant code in the linker file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
||||
SEARCH_DIR(.)
|
||||
GROUP(-lgcc -lc -lnosys)
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
#if !defined(MBED_ROM_START)
|
||||
#define MBED_ROM_START 0x10002000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START MBED_ROM_START
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x000FE000
|
||||
#endif
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x08002000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x00045800
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
||||
|
||||
/* Force symbol to be entered in the output file as an undefined symbol. Doing
|
||||
* this may, for example, trigger linking of additional modules from standard
|
||||
* libraries. You may list several symbols for each EXTERN, and you may use
|
||||
* EXTERN multiple times. This command has the same effect as the -u command-line
|
||||
* option.
|
||||
*/
|
||||
EXTERN(Reset_Handler)
|
||||
|
||||
/* The MEMORY section below describes the location and size of blocks of memory in the target.
|
||||
* Use this section to specify the memory regions available for allocation.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
/* The ram and flash regions control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding memory regions for CM0+ core in 'xx_cm0plus.ld',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.ld'.
|
||||
*/
|
||||
ram (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||
flash (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||
|
||||
/* This is a 32K flash region used for EEPROM emulation. This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
* Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
|
||||
* Therefore, repurposing this memory region will prevent such middleware from operation.
|
||||
*/
|
||||
em_eeprom (rx) : ORIGIN = 0x14000000, LENGTH = 0x8000 /* 32 KB */
|
||||
|
||||
/* The following regions define device specific memory regions and must not be changed. */
|
||||
sflash_user_data (rx) : ORIGIN = 0x16000800, LENGTH = 0x800 /* Supervisory flash: User data */
|
||||
sflash_nar (rx) : ORIGIN = 0x16001A00, LENGTH = 0x200 /* Supervisory flash: Normal Access Restrictions (NAR) */
|
||||
sflash_public_key (rx) : ORIGIN = 0x16005A00, LENGTH = 0xC00 /* Supervisory flash: Public Key */
|
||||
sflash_toc_2 (rx) : ORIGIN = 0x16007C00, LENGTH = 0x200 /* Supervisory flash: Table of Content # 2 */
|
||||
sflash_rtoc_2 (rx) : ORIGIN = 0x16007E00, LENGTH = 0x200 /* Supervisory flash: Table of Content # 2 Copy */
|
||||
xip (rx) : ORIGIN = 0x18000000, LENGTH = 0x8000000 /* 128 MB */
|
||||
efuse (r) : ORIGIN = 0x90700000, LENGTH = 0x100000 /* 1 MB */
|
||||
}
|
||||
|
||||
/* Library configurations */
|
||||
GROUP(libgcc.a libc.a libm.a libnosys.a)
|
||||
|
||||
/* 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
|
||||
* __Vectors_End
|
||||
* __Vectors_Size
|
||||
*/
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__Vectors = . ;
|
||||
KEEP(*(.vectors))
|
||||
. = ALIGN(4);
|
||||
__Vectors_End = .;
|
||||
__Vectors_Size = __Vectors_End - __Vectors;
|
||||
__end__ = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
*(.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)
|
||||
|
||||
/* Read-only code (constants). */
|
||||
*(.rodata .rodata.* .constdata .constdata.* .conststring .conststring.*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > flash
|
||||
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > flash
|
||||
|
||||
__exidx_start = .;
|
||||
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > flash
|
||||
__exidx_end = .;
|
||||
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_psoc6_01_cm4.S */
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
|
||||
/* Copy interrupt vectors from flash to RAM */
|
||||
LONG (__Vectors) /* From */
|
||||
LONG (__ram_vectors_start__) /* To */
|
||||
LONG (__Vectors_End - __Vectors) /* Size */
|
||||
|
||||
/* Copy data section to RAM */
|
||||
LONG (__etext) /* From */
|
||||
LONG (__data_start__) /* To */
|
||||
LONG (__data_end__ - __data_start__) /* Size */
|
||||
|
||||
__copy_table_end__ = .;
|
||||
} > flash
|
||||
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_psoc6_01_cm4.S */
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > flash
|
||||
|
||||
__etext = . ;
|
||||
|
||||
|
||||
.ramVectors (NOLOAD) : ALIGN(8)
|
||||
{
|
||||
__ram_vectors_start__ = .;
|
||||
KEEP(*(.ram_vectors))
|
||||
__ram_vectors_end__ = .;
|
||||
} > ram
|
||||
|
||||
|
||||
.data __ram_vectors_end__ : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
|
||||
*(vtable)
|
||||
*(.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);
|
||||
|
||||
KEEP(*(.cy_ramfunc*))
|
||||
. = ALIGN(4);
|
||||
|
||||
__data_end__ = .;
|
||||
|
||||
} > ram
|
||||
|
||||
|
||||
/* Place variables in the section that should not be initialized during the
|
||||
* device startup.
|
||||
*/
|
||||
.noinit (NOLOAD) : ALIGN(8)
|
||||
{
|
||||
KEEP(*(.noinit))
|
||||
} > ram
|
||||
|
||||
|
||||
/* The uninitialized global or static variables are placed in this section.
|
||||
*
|
||||
* The NOLOAD attribute tells linker that .bss section does not consume
|
||||
* any space in the image. The NOLOAD attribute changes the .bss type to
|
||||
* NOBITS, and that makes linker to A) not allocate section in memory, and
|
||||
* A) put information to clear the section with all zeros during application
|
||||
* loading.
|
||||
*
|
||||
* Without the NOLOAD attribute, the .bss section might get PROGBITS type.
|
||||
* This makes linker to A) allocate zeroed section in memory, and B) copy
|
||||
* this section to RAM during application loading.
|
||||
*/
|
||||
.bss (NOLOAD):
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > ram
|
||||
|
||||
|
||||
.heap (NOLOAD):
|
||||
{
|
||||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
KEEP(*(.heap*))
|
||||
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
|
||||
__HeapLimit = .;
|
||||
} > ram
|
||||
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(ram) + LENGTH(ram);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
|
||||
/* Used for the digital signature of the secure application and the Bootloader SDK application.
|
||||
* The size of the section depends on the required data size. */
|
||||
.cy_app_signature ORIGIN(flash) + LENGTH(flash) - 256 :
|
||||
{
|
||||
KEEP(*(.cy_app_signature))
|
||||
} > flash
|
||||
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
.cy_em_eeprom :
|
||||
{
|
||||
KEEP(*(.cy_em_eeprom))
|
||||
} > em_eeprom
|
||||
|
||||
|
||||
/* Supervisory Flash: User data */
|
||||
.cy_sflash_user_data :
|
||||
{
|
||||
KEEP(*(.cy_sflash_user_data))
|
||||
} > sflash_user_data
|
||||
|
||||
|
||||
/* Supervisory Flash: Normal Access Restrictions (NAR) */
|
||||
.cy_sflash_nar :
|
||||
{
|
||||
KEEP(*(.cy_sflash_nar))
|
||||
} > sflash_nar
|
||||
|
||||
|
||||
/* Supervisory Flash: Public Key */
|
||||
.cy_sflash_public_key :
|
||||
{
|
||||
KEEP(*(.cy_sflash_public_key))
|
||||
} > sflash_public_key
|
||||
|
||||
|
||||
/* Supervisory Flash: Table of Content # 2 */
|
||||
.cy_toc_part2 :
|
||||
{
|
||||
KEEP(*(.cy_toc_part2))
|
||||
} > sflash_toc_2
|
||||
|
||||
|
||||
/* Supervisory Flash: Table of Content # 2 Copy */
|
||||
.cy_rtoc_part2 :
|
||||
{
|
||||
KEEP(*(.cy_rtoc_part2))
|
||||
} > sflash_rtoc_2
|
||||
|
||||
|
||||
/* Places the code in the Execute in Place (XIP) section. See the smif driver
|
||||
* documentation for details.
|
||||
*/
|
||||
.cy_xip :
|
||||
{
|
||||
KEEP(*(.cy_xip))
|
||||
} > xip
|
||||
|
||||
|
||||
/* eFuse */
|
||||
.cy_efuse :
|
||||
{
|
||||
KEEP(*(.cy_efuse))
|
||||
} > efuse
|
||||
|
||||
|
||||
/* These sections are used for additional metadata (silicon revision,
|
||||
* Silicon/JTAG ID, etc.) storage.
|
||||
*/
|
||||
.cymeta 0x90500000 : { KEEP(*(.cymeta)) } :NONE
|
||||
}
|
||||
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
__cy_memory_0_start = 0x10000000;
|
||||
__cy_memory_0_length = 0x00100000;
|
||||
__cy_memory_0_row_size = 0x200;
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
__cy_memory_1_start = 0x14000000;
|
||||
__cy_memory_1_length = 0x8000;
|
||||
__cy_memory_1_row_size = 0x200;
|
||||
|
||||
/* Supervisory Flash */
|
||||
__cy_memory_2_start = 0x16000000;
|
||||
__cy_memory_2_length = 0x8000;
|
||||
__cy_memory_2_row_size = 0x200;
|
||||
|
||||
/* XIP */
|
||||
__cy_memory_3_start = 0x18000000;
|
||||
__cy_memory_3_length = 0x08000000;
|
||||
__cy_memory_3_row_size = 0x200;
|
||||
|
||||
/* eFuse */
|
||||
__cy_memory_4_start = 0x90700000;
|
||||
__cy_memory_4_length = 0x100000;
|
||||
__cy_memory_4_row_size = 1;
|
||||
|
||||
/* EOF */
|
|
@ -0,0 +1,631 @@
|
|||
/**************************************************************************//**
|
||||
* @file startup_psoc6_01_cm4.S
|
||||
* @brief CMSIS Core Device Startup File for
|
||||
* ARMCM4 Device Series
|
||||
* @version V5.00
|
||||
* @date 02. March 2016
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-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.
|
||||
*/
|
||||
|
||||
/* Address of the NMI handler */
|
||||
#define CY_NMI_HANLDER_ADDR 0x0000000D
|
||||
|
||||
/* The CPU VTOR register */
|
||||
#define CY_CPU_VTOR_ADDR 0xE000ED08
|
||||
|
||||
/* Copy flash vectors and data section to RAM */
|
||||
#define __STARTUP_COPY_MULTIPLE
|
||||
|
||||
/* Clear single BSS section */
|
||||
#define __STARTUP_CLEAR_BSS
|
||||
|
||||
.syntax unified
|
||||
.arch armv7-m
|
||||
|
||||
.section .stack
|
||||
.align 3
|
||||
#ifdef __STACK_SIZE
|
||||
.equ Stack_Size, __STACK_SIZE
|
||||
#else
|
||||
.equ Stack_Size, 0x00001000
|
||||
#endif
|
||||
.globl __StackTop
|
||||
.globl __StackLimit
|
||||
__StackLimit:
|
||||
.space Stack_Size
|
||||
.size __StackLimit, . - __StackLimit
|
||||
__StackTop:
|
||||
.size __StackTop, . - __StackTop
|
||||
|
||||
.section .heap
|
||||
.align 3
|
||||
#ifdef __HEAP_SIZE
|
||||
.equ Heap_Size, __HEAP_SIZE
|
||||
#else
|
||||
.equ Heap_Size, 0x00000400
|
||||
#endif
|
||||
.globl __HeapBase
|
||||
.globl __HeapLimit
|
||||
__HeapBase:
|
||||
.if Heap_Size
|
||||
.space Heap_Size
|
||||
.endif
|
||||
.size __HeapBase, . - __HeapBase
|
||||
__HeapLimit:
|
||||
.size __HeapLimit, . - __HeapLimit
|
||||
|
||||
.section .vectors
|
||||
.align 2
|
||||
.globl __Vectors
|
||||
__Vectors:
|
||||
.long __StackTop /* Top of Stack */
|
||||
.long Reset_Handler /* Reset Handler */
|
||||
.long CY_NMI_HANLDER_ADDR /* NMI Handler */
|
||||
.long HardFault_Handler /* Hard Fault Handler */
|
||||
.long MemManage_Handler /* MPU Fault Handler */
|
||||
.long BusFault_Handler /* Bus Fault Handler */
|
||||
.long UsageFault_Handler /* Usage Fault Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long SVC_Handler /* SVCall Handler */
|
||||
.long DebugMon_Handler /* Debug Monitor Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long PendSV_Handler /* PendSV Handler */
|
||||
.long SysTick_Handler /* SysTick Handler */
|
||||
|
||||
/* External interrupts Description */
|
||||
.long ioss_interrupts_gpio_0_IRQHandler /* GPIO Port Interrupt #0 */
|
||||
.long ioss_interrupts_gpio_1_IRQHandler /* GPIO Port Interrupt #1 */
|
||||
.long ioss_interrupts_gpio_2_IRQHandler /* GPIO Port Interrupt #2 */
|
||||
.long ioss_interrupts_gpio_3_IRQHandler /* GPIO Port Interrupt #3 */
|
||||
.long ioss_interrupts_gpio_4_IRQHandler /* GPIO Port Interrupt #4 */
|
||||
.long ioss_interrupts_gpio_5_IRQHandler /* GPIO Port Interrupt #5 */
|
||||
.long ioss_interrupts_gpio_6_IRQHandler /* GPIO Port Interrupt #6 */
|
||||
.long ioss_interrupts_gpio_7_IRQHandler /* GPIO Port Interrupt #7 */
|
||||
.long ioss_interrupts_gpio_8_IRQHandler /* GPIO Port Interrupt #8 */
|
||||
.long ioss_interrupts_gpio_9_IRQHandler /* GPIO Port Interrupt #9 */
|
||||
.long ioss_interrupts_gpio_10_IRQHandler /* GPIO Port Interrupt #10 */
|
||||
.long ioss_interrupts_gpio_11_IRQHandler /* GPIO Port Interrupt #11 */
|
||||
.long ioss_interrupts_gpio_12_IRQHandler /* GPIO Port Interrupt #12 */
|
||||
.long ioss_interrupts_gpio_13_IRQHandler /* GPIO Port Interrupt #13 */
|
||||
.long ioss_interrupts_gpio_14_IRQHandler /* GPIO Port Interrupt #14 */
|
||||
.long ioss_interrupt_gpio_IRQHandler /* GPIO All Ports */
|
||||
.long ioss_interrupt_vdd_IRQHandler /* GPIO Supply Detect Interrupt */
|
||||
.long lpcomp_interrupt_IRQHandler /* Low Power Comparator Interrupt */
|
||||
.long scb_8_interrupt_IRQHandler /* Serial Communication Block #8 (DeepSleep capable) */
|
||||
.long srss_interrupt_mcwdt_0_IRQHandler /* Multi Counter Watchdog Timer interrupt */
|
||||
.long srss_interrupt_mcwdt_1_IRQHandler /* Multi Counter Watchdog Timer interrupt */
|
||||
.long srss_interrupt_backup_IRQHandler /* Backup domain interrupt */
|
||||
.long srss_interrupt_IRQHandler /* Other combined Interrupts for SRSS (LVD, WDT, CLKCAL) */
|
||||
.long pass_interrupt_ctbs_IRQHandler /* CTBm Interrupt (all CTBms) */
|
||||
.long bless_interrupt_IRQHandler /* Bluetooth Radio interrupt */
|
||||
.long cpuss_interrupts_ipc_0_IRQHandler /* CPUSS Inter Process Communication Interrupt #0 */
|
||||
.long cpuss_interrupts_ipc_1_IRQHandler /* CPUSS Inter Process Communication Interrupt #1 */
|
||||
.long cpuss_interrupts_ipc_2_IRQHandler /* CPUSS Inter Process Communication Interrupt #2 */
|
||||
.long cpuss_interrupts_ipc_3_IRQHandler /* CPUSS Inter Process Communication Interrupt #3 */
|
||||
.long cpuss_interrupts_ipc_4_IRQHandler /* CPUSS Inter Process Communication Interrupt #4 */
|
||||
.long cpuss_interrupts_ipc_5_IRQHandler /* CPUSS Inter Process Communication Interrupt #5 */
|
||||
.long cpuss_interrupts_ipc_6_IRQHandler /* CPUSS Inter Process Communication Interrupt #6 */
|
||||
.long cpuss_interrupts_ipc_7_IRQHandler /* CPUSS Inter Process Communication Interrupt #7 */
|
||||
.long cpuss_interrupts_ipc_8_IRQHandler /* CPUSS Inter Process Communication Interrupt #8 */
|
||||
.long cpuss_interrupts_ipc_9_IRQHandler /* CPUSS Inter Process Communication Interrupt #9 */
|
||||
.long cpuss_interrupts_ipc_10_IRQHandler /* CPUSS Inter Process Communication Interrupt #10 */
|
||||
.long cpuss_interrupts_ipc_11_IRQHandler /* CPUSS Inter Process Communication Interrupt #11 */
|
||||
.long cpuss_interrupts_ipc_12_IRQHandler /* CPUSS Inter Process Communication Interrupt #12 */
|
||||
.long cpuss_interrupts_ipc_13_IRQHandler /* CPUSS Inter Process Communication Interrupt #13 */
|
||||
.long cpuss_interrupts_ipc_14_IRQHandler /* CPUSS Inter Process Communication Interrupt #14 */
|
||||
.long cpuss_interrupts_ipc_15_IRQHandler /* CPUSS Inter Process Communication Interrupt #15 */
|
||||
.long scb_0_interrupt_IRQHandler /* Serial Communication Block #0 */
|
||||
.long scb_1_interrupt_IRQHandler /* Serial Communication Block #1 */
|
||||
.long scb_2_interrupt_IRQHandler /* Serial Communication Block #2 */
|
||||
.long scb_3_interrupt_IRQHandler /* Serial Communication Block #3 */
|
||||
.long scb_4_interrupt_IRQHandler /* Serial Communication Block #4 */
|
||||
.long scb_5_interrupt_IRQHandler /* Serial Communication Block #5 */
|
||||
.long scb_6_interrupt_IRQHandler /* Serial Communication Block #6 */
|
||||
.long scb_7_interrupt_IRQHandler /* Serial Communication Block #7 */
|
||||
.long csd_interrupt_IRQHandler /* CSD (Capsense) interrupt */
|
||||
.long cpuss_interrupts_dw0_0_IRQHandler /* CPUSS DataWire #0, Channel #0 */
|
||||
.long cpuss_interrupts_dw0_1_IRQHandler /* CPUSS DataWire #0, Channel #1 */
|
||||
.long cpuss_interrupts_dw0_2_IRQHandler /* CPUSS DataWire #0, Channel #2 */
|
||||
.long cpuss_interrupts_dw0_3_IRQHandler /* CPUSS DataWire #0, Channel #3 */
|
||||
.long cpuss_interrupts_dw0_4_IRQHandler /* CPUSS DataWire #0, Channel #4 */
|
||||
.long cpuss_interrupts_dw0_5_IRQHandler /* CPUSS DataWire #0, Channel #5 */
|
||||
.long cpuss_interrupts_dw0_6_IRQHandler /* CPUSS DataWire #0, Channel #6 */
|
||||
.long cpuss_interrupts_dw0_7_IRQHandler /* CPUSS DataWire #0, Channel #7 */
|
||||
.long cpuss_interrupts_dw0_8_IRQHandler /* CPUSS DataWire #0, Channel #8 */
|
||||
.long cpuss_interrupts_dw0_9_IRQHandler /* CPUSS DataWire #0, Channel #9 */
|
||||
.long cpuss_interrupts_dw0_10_IRQHandler /* CPUSS DataWire #0, Channel #10 */
|
||||
.long cpuss_interrupts_dw0_11_IRQHandler /* CPUSS DataWire #0, Channel #11 */
|
||||
.long cpuss_interrupts_dw0_12_IRQHandler /* CPUSS DataWire #0, Channel #12 */
|
||||
.long cpuss_interrupts_dw0_13_IRQHandler /* CPUSS DataWire #0, Channel #13 */
|
||||
.long cpuss_interrupts_dw0_14_IRQHandler /* CPUSS DataWire #0, Channel #14 */
|
||||
.long cpuss_interrupts_dw0_15_IRQHandler /* CPUSS DataWire #0, Channel #15 */
|
||||
.long cpuss_interrupts_dw1_0_IRQHandler /* CPUSS DataWire #1, Channel #0 */
|
||||
.long cpuss_interrupts_dw1_1_IRQHandler /* CPUSS DataWire #1, Channel #1 */
|
||||
.long cpuss_interrupts_dw1_2_IRQHandler /* CPUSS DataWire #1, Channel #2 */
|
||||
.long cpuss_interrupts_dw1_3_IRQHandler /* CPUSS DataWire #1, Channel #3 */
|
||||
.long cpuss_interrupts_dw1_4_IRQHandler /* CPUSS DataWire #1, Channel #4 */
|
||||
.long cpuss_interrupts_dw1_5_IRQHandler /* CPUSS DataWire #1, Channel #5 */
|
||||
.long cpuss_interrupts_dw1_6_IRQHandler /* CPUSS DataWire #1, Channel #6 */
|
||||
.long cpuss_interrupts_dw1_7_IRQHandler /* CPUSS DataWire #1, Channel #7 */
|
||||
.long cpuss_interrupts_dw1_8_IRQHandler /* CPUSS DataWire #1, Channel #8 */
|
||||
.long cpuss_interrupts_dw1_9_IRQHandler /* CPUSS DataWire #1, Channel #9 */
|
||||
.long cpuss_interrupts_dw1_10_IRQHandler /* CPUSS DataWire #1, Channel #10 */
|
||||
.long cpuss_interrupts_dw1_11_IRQHandler /* CPUSS DataWire #1, Channel #11 */
|
||||
.long cpuss_interrupts_dw1_12_IRQHandler /* CPUSS DataWire #1, Channel #12 */
|
||||
.long cpuss_interrupts_dw1_13_IRQHandler /* CPUSS DataWire #1, Channel #13 */
|
||||
.long cpuss_interrupts_dw1_14_IRQHandler /* CPUSS DataWire #1, Channel #14 */
|
||||
.long cpuss_interrupts_dw1_15_IRQHandler /* CPUSS DataWire #1, Channel #15 */
|
||||
.long cpuss_interrupts_fault_0_IRQHandler /* CPUSS Fault Structure Interrupt #0 */
|
||||
.long cpuss_interrupts_fault_1_IRQHandler /* CPUSS Fault Structure Interrupt #1 */
|
||||
.long cpuss_interrupt_crypto_IRQHandler /* CRYPTO Accelerator Interrupt */
|
||||
.long cpuss_interrupt_fm_IRQHandler /* FLASH Macro Interrupt */
|
||||
.long cpuss_interrupts_cm0_cti_0_IRQHandler /* CM0+ CTI #0 */
|
||||
.long cpuss_interrupts_cm0_cti_1_IRQHandler /* CM0+ CTI #1 */
|
||||
.long cpuss_interrupts_cm4_cti_0_IRQHandler /* CM4 CTI #0 */
|
||||
.long cpuss_interrupts_cm4_cti_1_IRQHandler /* CM4 CTI #1 */
|
||||
.long tcpwm_0_interrupts_0_IRQHandler /* TCPWM #0, Counter #0 */
|
||||
.long tcpwm_0_interrupts_1_IRQHandler /* TCPWM #0, Counter #1 */
|
||||
.long tcpwm_0_interrupts_2_IRQHandler /* TCPWM #0, Counter #2 */
|
||||
.long tcpwm_0_interrupts_3_IRQHandler /* TCPWM #0, Counter #3 */
|
||||
.long tcpwm_0_interrupts_4_IRQHandler /* TCPWM #0, Counter #4 */
|
||||
.long tcpwm_0_interrupts_5_IRQHandler /* TCPWM #0, Counter #5 */
|
||||
.long tcpwm_0_interrupts_6_IRQHandler /* TCPWM #0, Counter #6 */
|
||||
.long tcpwm_0_interrupts_7_IRQHandler /* TCPWM #0, Counter #7 */
|
||||
.long tcpwm_1_interrupts_0_IRQHandler /* TCPWM #1, Counter #0 */
|
||||
.long tcpwm_1_interrupts_1_IRQHandler /* TCPWM #1, Counter #1 */
|
||||
.long tcpwm_1_interrupts_2_IRQHandler /* TCPWM #1, Counter #2 */
|
||||
.long tcpwm_1_interrupts_3_IRQHandler /* TCPWM #1, Counter #3 */
|
||||
.long tcpwm_1_interrupts_4_IRQHandler /* TCPWM #1, Counter #4 */
|
||||
.long tcpwm_1_interrupts_5_IRQHandler /* TCPWM #1, Counter #5 */
|
||||
.long tcpwm_1_interrupts_6_IRQHandler /* TCPWM #1, Counter #6 */
|
||||
.long tcpwm_1_interrupts_7_IRQHandler /* TCPWM #1, Counter #7 */
|
||||
.long tcpwm_1_interrupts_8_IRQHandler /* TCPWM #1, Counter #8 */
|
||||
.long tcpwm_1_interrupts_9_IRQHandler /* TCPWM #1, Counter #9 */
|
||||
.long tcpwm_1_interrupts_10_IRQHandler /* TCPWM #1, Counter #10 */
|
||||
.long tcpwm_1_interrupts_11_IRQHandler /* TCPWM #1, Counter #11 */
|
||||
.long tcpwm_1_interrupts_12_IRQHandler /* TCPWM #1, Counter #12 */
|
||||
.long tcpwm_1_interrupts_13_IRQHandler /* TCPWM #1, Counter #13 */
|
||||
.long tcpwm_1_interrupts_14_IRQHandler /* TCPWM #1, Counter #14 */
|
||||
.long tcpwm_1_interrupts_15_IRQHandler /* TCPWM #1, Counter #15 */
|
||||
.long tcpwm_1_interrupts_16_IRQHandler /* TCPWM #1, Counter #16 */
|
||||
.long tcpwm_1_interrupts_17_IRQHandler /* TCPWM #1, Counter #17 */
|
||||
.long tcpwm_1_interrupts_18_IRQHandler /* TCPWM #1, Counter #18 */
|
||||
.long tcpwm_1_interrupts_19_IRQHandler /* TCPWM #1, Counter #19 */
|
||||
.long tcpwm_1_interrupts_20_IRQHandler /* TCPWM #1, Counter #20 */
|
||||
.long tcpwm_1_interrupts_21_IRQHandler /* TCPWM #1, Counter #21 */
|
||||
.long tcpwm_1_interrupts_22_IRQHandler /* TCPWM #1, Counter #22 */
|
||||
.long tcpwm_1_interrupts_23_IRQHandler /* TCPWM #1, Counter #23 */
|
||||
.long udb_interrupts_0_IRQHandler /* UDB Interrupt #0 */
|
||||
.long udb_interrupts_1_IRQHandler /* UDB Interrupt #1 */
|
||||
.long udb_interrupts_2_IRQHandler /* UDB Interrupt #2 */
|
||||
.long udb_interrupts_3_IRQHandler /* UDB Interrupt #3 */
|
||||
.long udb_interrupts_4_IRQHandler /* UDB Interrupt #4 */
|
||||
.long udb_interrupts_5_IRQHandler /* UDB Interrupt #5 */
|
||||
.long udb_interrupts_6_IRQHandler /* UDB Interrupt #6 */
|
||||
.long udb_interrupts_7_IRQHandler /* UDB Interrupt #7 */
|
||||
.long udb_interrupts_8_IRQHandler /* UDB Interrupt #8 */
|
||||
.long udb_interrupts_9_IRQHandler /* UDB Interrupt #9 */
|
||||
.long udb_interrupts_10_IRQHandler /* UDB Interrupt #10 */
|
||||
.long udb_interrupts_11_IRQHandler /* UDB Interrupt #11 */
|
||||
.long udb_interrupts_12_IRQHandler /* UDB Interrupt #12 */
|
||||
.long udb_interrupts_13_IRQHandler /* UDB Interrupt #13 */
|
||||
.long udb_interrupts_14_IRQHandler /* UDB Interrupt #14 */
|
||||
.long udb_interrupts_15_IRQHandler /* UDB Interrupt #15 */
|
||||
.long pass_interrupt_sar_IRQHandler /* SAR ADC interrupt */
|
||||
.long audioss_interrupt_i2s_IRQHandler /* I2S Audio interrupt */
|
||||
.long audioss_interrupt_pdm_IRQHandler /* PDM/PCM Audio interrupt */
|
||||
.long profile_interrupt_IRQHandler /* Energy Profiler interrupt */
|
||||
.long smif_interrupt_IRQHandler /* Serial Memory Interface interrupt */
|
||||
.long usb_interrupt_hi_IRQHandler /* USB Interrupt */
|
||||
.long usb_interrupt_med_IRQHandler /* USB Interrupt */
|
||||
.long usb_interrupt_lo_IRQHandler /* USB Interrupt */
|
||||
.long pass_interrupt_dacs_IRQHandler /* Consolidated interrrupt for all DACs */
|
||||
|
||||
|
||||
.size __Vectors, . - __Vectors
|
||||
.equ __VectorsSize, . - __Vectors
|
||||
|
||||
.section .ram_vectors
|
||||
.align 2
|
||||
.globl __ramVectors
|
||||
__ramVectors:
|
||||
.space __VectorsSize
|
||||
.size __ramVectors, . - __ramVectors
|
||||
|
||||
|
||||
.text
|
||||
.thumb
|
||||
.thumb_func
|
||||
.align 2
|
||||
|
||||
/*
|
||||
* Device startup customization
|
||||
*
|
||||
* Note. The global resources are not yet initialized (for example global variables, peripherals, clocks)
|
||||
* because this function is executed as the first instruction in the ResetHandler.
|
||||
* The PDL is also not initialized to use the proper register offsets.
|
||||
* The user of this function is responsible for initializing the PDL and resources before using them.
|
||||
*/
|
||||
.weak Cy_OnResetUser
|
||||
.func Cy_OnResetUser, Cy_OnResetUser
|
||||
.type Cy_OnResetUser, %function
|
||||
|
||||
Cy_OnResetUser:
|
||||
bx lr
|
||||
.size Cy_OnResetUser, . - Cy_OnResetUser
|
||||
.endfunc
|
||||
|
||||
/* Reset handler */
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
|
||||
Reset_Handler:
|
||||
bl Cy_OnResetUser
|
||||
cpsid i
|
||||
|
||||
/* Firstly it copies data from read only memory to RAM. There are two schemes
|
||||
* to copy. One can copy more than one sections. Another can only copy
|
||||
* one section. The former scheme needs more instructions and read-only
|
||||
* data to implement than the latter.
|
||||
* Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes. */
|
||||
|
||||
#ifdef __STARTUP_COPY_MULTIPLE
|
||||
/* Multiple sections scheme.
|
||||
*
|
||||
* Between symbol address __copy_table_start__ and __copy_table_end__,
|
||||
* there are array of triplets, each of which specify:
|
||||
* offset 0: LMA of start of a section to copy from
|
||||
* offset 4: VMA of start of a section to copy to
|
||||
* offset 8: size of the section to copy. Must be multiply of 4
|
||||
*
|
||||
* All addresses must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
ldr r4, =__copy_table_start__
|
||||
ldr r5, =__copy_table_end__
|
||||
|
||||
.L_loop0:
|
||||
cmp r4, r5
|
||||
bge .L_loop0_done
|
||||
ldr r1, [r4]
|
||||
ldr r2, [r4, #4]
|
||||
ldr r3, [r4, #8]
|
||||
|
||||
.L_loop0_0:
|
||||
subs r3, #4
|
||||
ittt ge
|
||||
ldrge r0, [r1, r3]
|
||||
strge r0, [r2, r3]
|
||||
bge .L_loop0_0
|
||||
|
||||
adds r4, #12
|
||||
b .L_loop0
|
||||
|
||||
.L_loop0_done:
|
||||
#else
|
||||
/* Single section scheme.
|
||||
*
|
||||
* The ranges of copy from/to are specified by following symbols
|
||||
* __etext: LMA of start of the section to copy from. Usually end of text
|
||||
* __data_start__: VMA of start of the section to copy to
|
||||
* __data_end__: VMA of end of the section to copy to
|
||||
*
|
||||
* All addresses must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
ldr r1, =__etext
|
||||
ldr r2, =__data_start__
|
||||
ldr r3, =__data_end__
|
||||
|
||||
.L_loop1:
|
||||
cmp r2, r3
|
||||
ittt lt
|
||||
ldrlt r0, [r1], #4
|
||||
strlt r0, [r2], #4
|
||||
blt .L_loop1
|
||||
#endif /*__STARTUP_COPY_MULTIPLE */
|
||||
|
||||
/* This part of work usually is done in C library startup code. Otherwise,
|
||||
* define this macro to enable it in this startup.
|
||||
*
|
||||
* There are two schemes too. One can clear multiple BSS sections. Another
|
||||
* can only clear one section. The former is more size expensive than the
|
||||
* latter.
|
||||
*
|
||||
* Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
|
||||
* Otherwise define macro __STARTUP_CLEAR_BSS to choose the later.
|
||||
*/
|
||||
#ifdef __STARTUP_CLEAR_BSS_MULTIPLE
|
||||
/* Multiple sections scheme.
|
||||
*
|
||||
* Between symbol address __copy_table_start__ and __copy_table_end__,
|
||||
* there are array of tuples specifying:
|
||||
* offset 0: Start of a BSS section
|
||||
* offset 4: Size of this BSS section. Must be multiply of 4
|
||||
*/
|
||||
ldr r3, =__zero_table_start__
|
||||
ldr r4, =__zero_table_end__
|
||||
|
||||
.L_loop2:
|
||||
cmp r3, r4
|
||||
bge .L_loop2_done
|
||||
ldr r1, [r3]
|
||||
ldr r2, [r3, #4]
|
||||
movs r0, 0
|
||||
|
||||
.L_loop2_0:
|
||||
subs r2, #4
|
||||
itt ge
|
||||
strge r0, [r1, r2]
|
||||
bge .L_loop2_0
|
||||
|
||||
adds r3, #8
|
||||
b .L_loop2
|
||||
.L_loop2_done:
|
||||
#elif defined (__STARTUP_CLEAR_BSS)
|
||||
/* Single BSS section scheme.
|
||||
*
|
||||
* The BSS section is specified by following symbols
|
||||
* __bss_start__: start of the BSS section.
|
||||
* __bss_end__: end of the BSS section.
|
||||
*
|
||||
* Both addresses must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
ldr r1, =__bss_start__
|
||||
ldr r2, =__bss_end__
|
||||
|
||||
movs r0, 0
|
||||
.L_loop3:
|
||||
cmp r1, r2
|
||||
itt lt
|
||||
strlt r0, [r1], #4
|
||||
blt .L_loop3
|
||||
#endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
|
||||
|
||||
/* Update Vector Table Offset Register. */
|
||||
ldr r0, =__ramVectors
|
||||
ldr r1, =CY_CPU_VTOR_ADDR
|
||||
str r0, [r1]
|
||||
dsb 0xF
|
||||
|
||||
/* Enable the FPU if used */
|
||||
bl Cy_SystemInitFpuEnable
|
||||
|
||||
bl _start
|
||||
|
||||
/* Should never get here */
|
||||
b .
|
||||
|
||||
.pool
|
||||
.size Reset_Handler, . - Reset_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak Default_Handler
|
||||
.type Default_Handler, %function
|
||||
|
||||
Default_Handler:
|
||||
b .
|
||||
.size Default_Handler, . - Default_Handler
|
||||
|
||||
|
||||
.weak Cy_SysLib_FaultHandler
|
||||
.type Cy_SysLib_FaultHandler, %function
|
||||
|
||||
Cy_SysLib_FaultHandler:
|
||||
b .
|
||||
.size Cy_SysLib_FaultHandler, . - Cy_SysLib_FaultHandler
|
||||
.type Fault_Handler, %function
|
||||
|
||||
Fault_Handler:
|
||||
/* Storing LR content for Creator call stack trace */
|
||||
push {LR}
|
||||
movs r0, #4
|
||||
mov r1, LR
|
||||
tst r0, r1
|
||||
beq .L_MSP
|
||||
mrs r0, PSP
|
||||
b .L_API_call
|
||||
.L_MSP:
|
||||
mrs r0, MSP
|
||||
.L_API_call:
|
||||
/* Compensation of stack pointer address due to pushing 4 bytes of LR */
|
||||
adds r0, r0, #4
|
||||
bl Cy_SysLib_FaultHandler
|
||||
b .
|
||||
.size Fault_Handler, . - Fault_Handler
|
||||
|
||||
.macro def_fault_Handler fault_handler_name
|
||||
.weak \fault_handler_name
|
||||
.set \fault_handler_name, Fault_Handler
|
||||
.endm
|
||||
|
||||
/* Macro to define default handlers. Default handler
|
||||
* will be weak symbol and just dead loops. They can be
|
||||
* overwritten by other handlers */
|
||||
.macro def_irq_handler handler_name
|
||||
.weak \handler_name
|
||||
.set \handler_name, Default_Handler
|
||||
.endm
|
||||
|
||||
def_irq_handler NMI_Handler
|
||||
|
||||
def_fault_Handler HardFault_Handler
|
||||
def_fault_Handler MemManage_Handler
|
||||
def_fault_Handler BusFault_Handler
|
||||
def_fault_Handler UsageFault_Handler
|
||||
|
||||
def_irq_handler SVC_Handler
|
||||
def_irq_handler DebugMon_Handler
|
||||
def_irq_handler PendSV_Handler
|
||||
def_irq_handler SysTick_Handler
|
||||
|
||||
def_irq_handler ioss_interrupts_gpio_0_IRQHandler /* GPIO Port Interrupt #0 */
|
||||
def_irq_handler ioss_interrupts_gpio_1_IRQHandler /* GPIO Port Interrupt #1 */
|
||||
def_irq_handler ioss_interrupts_gpio_2_IRQHandler /* GPIO Port Interrupt #2 */
|
||||
def_irq_handler ioss_interrupts_gpio_3_IRQHandler /* GPIO Port Interrupt #3 */
|
||||
def_irq_handler ioss_interrupts_gpio_4_IRQHandler /* GPIO Port Interrupt #4 */
|
||||
def_irq_handler ioss_interrupts_gpio_5_IRQHandler /* GPIO Port Interrupt #5 */
|
||||
def_irq_handler ioss_interrupts_gpio_6_IRQHandler /* GPIO Port Interrupt #6 */
|
||||
def_irq_handler ioss_interrupts_gpio_7_IRQHandler /* GPIO Port Interrupt #7 */
|
||||
def_irq_handler ioss_interrupts_gpio_8_IRQHandler /* GPIO Port Interrupt #8 */
|
||||
def_irq_handler ioss_interrupts_gpio_9_IRQHandler /* GPIO Port Interrupt #9 */
|
||||
def_irq_handler ioss_interrupts_gpio_10_IRQHandler /* GPIO Port Interrupt #10 */
|
||||
def_irq_handler ioss_interrupts_gpio_11_IRQHandler /* GPIO Port Interrupt #11 */
|
||||
def_irq_handler ioss_interrupts_gpio_12_IRQHandler /* GPIO Port Interrupt #12 */
|
||||
def_irq_handler ioss_interrupts_gpio_13_IRQHandler /* GPIO Port Interrupt #13 */
|
||||
def_irq_handler ioss_interrupts_gpio_14_IRQHandler /* GPIO Port Interrupt #14 */
|
||||
def_irq_handler ioss_interrupt_gpio_IRQHandler /* GPIO All Ports */
|
||||
def_irq_handler ioss_interrupt_vdd_IRQHandler /* GPIO Supply Detect Interrupt */
|
||||
def_irq_handler lpcomp_interrupt_IRQHandler /* Low Power Comparator Interrupt */
|
||||
def_irq_handler scb_8_interrupt_IRQHandler /* Serial Communication Block #8 (DeepSleep capable) */
|
||||
def_irq_handler srss_interrupt_mcwdt_0_IRQHandler /* Multi Counter Watchdog Timer interrupt */
|
||||
def_irq_handler srss_interrupt_mcwdt_1_IRQHandler /* Multi Counter Watchdog Timer interrupt */
|
||||
def_irq_handler srss_interrupt_backup_IRQHandler /* Backup domain interrupt */
|
||||
def_irq_handler srss_interrupt_IRQHandler /* Other combined Interrupts for SRSS (LVD, WDT, CLKCAL) */
|
||||
def_irq_handler pass_interrupt_ctbs_IRQHandler /* CTBm Interrupt (all CTBms) */
|
||||
def_irq_handler bless_interrupt_IRQHandler /* Bluetooth Radio interrupt */
|
||||
def_irq_handler cpuss_interrupts_ipc_0_IRQHandler /* CPUSS Inter Process Communication Interrupt #0 */
|
||||
def_irq_handler cpuss_interrupts_ipc_1_IRQHandler /* CPUSS Inter Process Communication Interrupt #1 */
|
||||
def_irq_handler cpuss_interrupts_ipc_2_IRQHandler /* CPUSS Inter Process Communication Interrupt #2 */
|
||||
def_irq_handler cpuss_interrupts_ipc_3_IRQHandler /* CPUSS Inter Process Communication Interrupt #3 */
|
||||
def_irq_handler cpuss_interrupts_ipc_4_IRQHandler /* CPUSS Inter Process Communication Interrupt #4 */
|
||||
def_irq_handler cpuss_interrupts_ipc_5_IRQHandler /* CPUSS Inter Process Communication Interrupt #5 */
|
||||
def_irq_handler cpuss_interrupts_ipc_6_IRQHandler /* CPUSS Inter Process Communication Interrupt #6 */
|
||||
def_irq_handler cpuss_interrupts_ipc_7_IRQHandler /* CPUSS Inter Process Communication Interrupt #7 */
|
||||
def_irq_handler cpuss_interrupts_ipc_8_IRQHandler /* CPUSS Inter Process Communication Interrupt #8 */
|
||||
def_irq_handler cpuss_interrupts_ipc_9_IRQHandler /* CPUSS Inter Process Communication Interrupt #9 */
|
||||
def_irq_handler cpuss_interrupts_ipc_10_IRQHandler /* CPUSS Inter Process Communication Interrupt #10 */
|
||||
def_irq_handler cpuss_interrupts_ipc_11_IRQHandler /* CPUSS Inter Process Communication Interrupt #11 */
|
||||
def_irq_handler cpuss_interrupts_ipc_12_IRQHandler /* CPUSS Inter Process Communication Interrupt #12 */
|
||||
def_irq_handler cpuss_interrupts_ipc_13_IRQHandler /* CPUSS Inter Process Communication Interrupt #13 */
|
||||
def_irq_handler cpuss_interrupts_ipc_14_IRQHandler /* CPUSS Inter Process Communication Interrupt #14 */
|
||||
def_irq_handler cpuss_interrupts_ipc_15_IRQHandler /* CPUSS Inter Process Communication Interrupt #15 */
|
||||
def_irq_handler scb_0_interrupt_IRQHandler /* Serial Communication Block #0 */
|
||||
def_irq_handler scb_1_interrupt_IRQHandler /* Serial Communication Block #1 */
|
||||
def_irq_handler scb_2_interrupt_IRQHandler /* Serial Communication Block #2 */
|
||||
def_irq_handler scb_3_interrupt_IRQHandler /* Serial Communication Block #3 */
|
||||
def_irq_handler scb_4_interrupt_IRQHandler /* Serial Communication Block #4 */
|
||||
def_irq_handler scb_5_interrupt_IRQHandler /* Serial Communication Block #5 */
|
||||
def_irq_handler scb_6_interrupt_IRQHandler /* Serial Communication Block #6 */
|
||||
def_irq_handler scb_7_interrupt_IRQHandler /* Serial Communication Block #7 */
|
||||
def_irq_handler csd_interrupt_IRQHandler /* CSD (Capsense) interrupt */
|
||||
def_irq_handler cpuss_interrupts_dw0_0_IRQHandler /* CPUSS DataWire #0, Channel #0 */
|
||||
def_irq_handler cpuss_interrupts_dw0_1_IRQHandler /* CPUSS DataWire #0, Channel #1 */
|
||||
def_irq_handler cpuss_interrupts_dw0_2_IRQHandler /* CPUSS DataWire #0, Channel #2 */
|
||||
def_irq_handler cpuss_interrupts_dw0_3_IRQHandler /* CPUSS DataWire #0, Channel #3 */
|
||||
def_irq_handler cpuss_interrupts_dw0_4_IRQHandler /* CPUSS DataWire #0, Channel #4 */
|
||||
def_irq_handler cpuss_interrupts_dw0_5_IRQHandler /* CPUSS DataWire #0, Channel #5 */
|
||||
def_irq_handler cpuss_interrupts_dw0_6_IRQHandler /* CPUSS DataWire #0, Channel #6 */
|
||||
def_irq_handler cpuss_interrupts_dw0_7_IRQHandler /* CPUSS DataWire #0, Channel #7 */
|
||||
def_irq_handler cpuss_interrupts_dw0_8_IRQHandler /* CPUSS DataWire #0, Channel #8 */
|
||||
def_irq_handler cpuss_interrupts_dw0_9_IRQHandler /* CPUSS DataWire #0, Channel #9 */
|
||||
def_irq_handler cpuss_interrupts_dw0_10_IRQHandler /* CPUSS DataWire #0, Channel #10 */
|
||||
def_irq_handler cpuss_interrupts_dw0_11_IRQHandler /* CPUSS DataWire #0, Channel #11 */
|
||||
def_irq_handler cpuss_interrupts_dw0_12_IRQHandler /* CPUSS DataWire #0, Channel #12 */
|
||||
def_irq_handler cpuss_interrupts_dw0_13_IRQHandler /* CPUSS DataWire #0, Channel #13 */
|
||||
def_irq_handler cpuss_interrupts_dw0_14_IRQHandler /* CPUSS DataWire #0, Channel #14 */
|
||||
def_irq_handler cpuss_interrupts_dw0_15_IRQHandler /* CPUSS DataWire #0, Channel #15 */
|
||||
def_irq_handler cpuss_interrupts_dw1_0_IRQHandler /* CPUSS DataWire #1, Channel #0 */
|
||||
def_irq_handler cpuss_interrupts_dw1_1_IRQHandler /* CPUSS DataWire #1, Channel #1 */
|
||||
def_irq_handler cpuss_interrupts_dw1_2_IRQHandler /* CPUSS DataWire #1, Channel #2 */
|
||||
def_irq_handler cpuss_interrupts_dw1_3_IRQHandler /* CPUSS DataWire #1, Channel #3 */
|
||||
def_irq_handler cpuss_interrupts_dw1_4_IRQHandler /* CPUSS DataWire #1, Channel #4 */
|
||||
def_irq_handler cpuss_interrupts_dw1_5_IRQHandler /* CPUSS DataWire #1, Channel #5 */
|
||||
def_irq_handler cpuss_interrupts_dw1_6_IRQHandler /* CPUSS DataWire #1, Channel #6 */
|
||||
def_irq_handler cpuss_interrupts_dw1_7_IRQHandler /* CPUSS DataWire #1, Channel #7 */
|
||||
def_irq_handler cpuss_interrupts_dw1_8_IRQHandler /* CPUSS DataWire #1, Channel #8 */
|
||||
def_irq_handler cpuss_interrupts_dw1_9_IRQHandler /* CPUSS DataWire #1, Channel #9 */
|
||||
def_irq_handler cpuss_interrupts_dw1_10_IRQHandler /* CPUSS DataWire #1, Channel #10 */
|
||||
def_irq_handler cpuss_interrupts_dw1_11_IRQHandler /* CPUSS DataWire #1, Channel #11 */
|
||||
def_irq_handler cpuss_interrupts_dw1_12_IRQHandler /* CPUSS DataWire #1, Channel #12 */
|
||||
def_irq_handler cpuss_interrupts_dw1_13_IRQHandler /* CPUSS DataWire #1, Channel #13 */
|
||||
def_irq_handler cpuss_interrupts_dw1_14_IRQHandler /* CPUSS DataWire #1, Channel #14 */
|
||||
def_irq_handler cpuss_interrupts_dw1_15_IRQHandler /* CPUSS DataWire #1, Channel #15 */
|
||||
def_irq_handler cpuss_interrupts_fault_0_IRQHandler /* CPUSS Fault Structure Interrupt #0 */
|
||||
def_irq_handler cpuss_interrupts_fault_1_IRQHandler /* CPUSS Fault Structure Interrupt #1 */
|
||||
def_irq_handler cpuss_interrupt_crypto_IRQHandler /* CRYPTO Accelerator Interrupt */
|
||||
def_irq_handler cpuss_interrupt_fm_IRQHandler /* FLASH Macro Interrupt */
|
||||
def_irq_handler cpuss_interrupts_cm0_cti_0_IRQHandler /* CM0+ CTI #0 */
|
||||
def_irq_handler cpuss_interrupts_cm0_cti_1_IRQHandler /* CM0+ CTI #1 */
|
||||
def_irq_handler cpuss_interrupts_cm4_cti_0_IRQHandler /* CM4 CTI #0 */
|
||||
def_irq_handler cpuss_interrupts_cm4_cti_1_IRQHandler /* CM4 CTI #1 */
|
||||
def_irq_handler tcpwm_0_interrupts_0_IRQHandler /* TCPWM #0, Counter #0 */
|
||||
def_irq_handler tcpwm_0_interrupts_1_IRQHandler /* TCPWM #0, Counter #1 */
|
||||
def_irq_handler tcpwm_0_interrupts_2_IRQHandler /* TCPWM #0, Counter #2 */
|
||||
def_irq_handler tcpwm_0_interrupts_3_IRQHandler /* TCPWM #0, Counter #3 */
|
||||
def_irq_handler tcpwm_0_interrupts_4_IRQHandler /* TCPWM #0, Counter #4 */
|
||||
def_irq_handler tcpwm_0_interrupts_5_IRQHandler /* TCPWM #0, Counter #5 */
|
||||
def_irq_handler tcpwm_0_interrupts_6_IRQHandler /* TCPWM #0, Counter #6 */
|
||||
def_irq_handler tcpwm_0_interrupts_7_IRQHandler /* TCPWM #0, Counter #7 */
|
||||
def_irq_handler tcpwm_1_interrupts_0_IRQHandler /* TCPWM #1, Counter #0 */
|
||||
def_irq_handler tcpwm_1_interrupts_1_IRQHandler /* TCPWM #1, Counter #1 */
|
||||
def_irq_handler tcpwm_1_interrupts_2_IRQHandler /* TCPWM #1, Counter #2 */
|
||||
def_irq_handler tcpwm_1_interrupts_3_IRQHandler /* TCPWM #1, Counter #3 */
|
||||
def_irq_handler tcpwm_1_interrupts_4_IRQHandler /* TCPWM #1, Counter #4 */
|
||||
def_irq_handler tcpwm_1_interrupts_5_IRQHandler /* TCPWM #1, Counter #5 */
|
||||
def_irq_handler tcpwm_1_interrupts_6_IRQHandler /* TCPWM #1, Counter #6 */
|
||||
def_irq_handler tcpwm_1_interrupts_7_IRQHandler /* TCPWM #1, Counter #7 */
|
||||
def_irq_handler tcpwm_1_interrupts_8_IRQHandler /* TCPWM #1, Counter #8 */
|
||||
def_irq_handler tcpwm_1_interrupts_9_IRQHandler /* TCPWM #1, Counter #9 */
|
||||
def_irq_handler tcpwm_1_interrupts_10_IRQHandler /* TCPWM #1, Counter #10 */
|
||||
def_irq_handler tcpwm_1_interrupts_11_IRQHandler /* TCPWM #1, Counter #11 */
|
||||
def_irq_handler tcpwm_1_interrupts_12_IRQHandler /* TCPWM #1, Counter #12 */
|
||||
def_irq_handler tcpwm_1_interrupts_13_IRQHandler /* TCPWM #1, Counter #13 */
|
||||
def_irq_handler tcpwm_1_interrupts_14_IRQHandler /* TCPWM #1, Counter #14 */
|
||||
def_irq_handler tcpwm_1_interrupts_15_IRQHandler /* TCPWM #1, Counter #15 */
|
||||
def_irq_handler tcpwm_1_interrupts_16_IRQHandler /* TCPWM #1, Counter #16 */
|
||||
def_irq_handler tcpwm_1_interrupts_17_IRQHandler /* TCPWM #1, Counter #17 */
|
||||
def_irq_handler tcpwm_1_interrupts_18_IRQHandler /* TCPWM #1, Counter #18 */
|
||||
def_irq_handler tcpwm_1_interrupts_19_IRQHandler /* TCPWM #1, Counter #19 */
|
||||
def_irq_handler tcpwm_1_interrupts_20_IRQHandler /* TCPWM #1, Counter #20 */
|
||||
def_irq_handler tcpwm_1_interrupts_21_IRQHandler /* TCPWM #1, Counter #21 */
|
||||
def_irq_handler tcpwm_1_interrupts_22_IRQHandler /* TCPWM #1, Counter #22 */
|
||||
def_irq_handler tcpwm_1_interrupts_23_IRQHandler /* TCPWM #1, Counter #23 */
|
||||
def_irq_handler udb_interrupts_0_IRQHandler /* UDB Interrupt #0 */
|
||||
def_irq_handler udb_interrupts_1_IRQHandler /* UDB Interrupt #1 */
|
||||
def_irq_handler udb_interrupts_2_IRQHandler /* UDB Interrupt #2 */
|
||||
def_irq_handler udb_interrupts_3_IRQHandler /* UDB Interrupt #3 */
|
||||
def_irq_handler udb_interrupts_4_IRQHandler /* UDB Interrupt #4 */
|
||||
def_irq_handler udb_interrupts_5_IRQHandler /* UDB Interrupt #5 */
|
||||
def_irq_handler udb_interrupts_6_IRQHandler /* UDB Interrupt #6 */
|
||||
def_irq_handler udb_interrupts_7_IRQHandler /* UDB Interrupt #7 */
|
||||
def_irq_handler udb_interrupts_8_IRQHandler /* UDB Interrupt #8 */
|
||||
def_irq_handler udb_interrupts_9_IRQHandler /* UDB Interrupt #9 */
|
||||
def_irq_handler udb_interrupts_10_IRQHandler /* UDB Interrupt #10 */
|
||||
def_irq_handler udb_interrupts_11_IRQHandler /* UDB Interrupt #11 */
|
||||
def_irq_handler udb_interrupts_12_IRQHandler /* UDB Interrupt #12 */
|
||||
def_irq_handler udb_interrupts_13_IRQHandler /* UDB Interrupt #13 */
|
||||
def_irq_handler udb_interrupts_14_IRQHandler /* UDB Interrupt #14 */
|
||||
def_irq_handler udb_interrupts_15_IRQHandler /* UDB Interrupt #15 */
|
||||
def_irq_handler pass_interrupt_sar_IRQHandler /* SAR ADC interrupt */
|
||||
def_irq_handler audioss_interrupt_i2s_IRQHandler /* I2S Audio interrupt */
|
||||
def_irq_handler audioss_interrupt_pdm_IRQHandler /* PDM/PCM Audio interrupt */
|
||||
def_irq_handler profile_interrupt_IRQHandler /* Energy Profiler interrupt */
|
||||
def_irq_handler smif_interrupt_IRQHandler /* Serial Memory Interface interrupt */
|
||||
def_irq_handler usb_interrupt_hi_IRQHandler /* USB Interrupt */
|
||||
def_irq_handler usb_interrupt_med_IRQHandler /* USB Interrupt */
|
||||
def_irq_handler usb_interrupt_lo_IRQHandler /* USB Interrupt */
|
||||
def_irq_handler pass_interrupt_dacs_IRQHandler /* Consolidated interrrupt for all DACs */
|
||||
|
||||
.end
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,270 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy8c6xx7_cm4_dual.icf
|
||||
* \version 2.40
|
||||
*
|
||||
* Linker file for the IAR compiler.
|
||||
*
|
||||
* The main purpose of the linker script is to describe how the sections in the
|
||||
* input files should be mapped into the output file, and to control the memory
|
||||
* layout of the output file.
|
||||
*
|
||||
* \note The entry point is fixed and starts at 0x10000000. The valid application
|
||||
* image should be placed there.
|
||||
*
|
||||
* \note The linker files included with the PDL template projects must be generic
|
||||
* and handle all common use cases. Your project may not use every section
|
||||
* defined in the linker files. In that case you may see warnings during the
|
||||
* build process. In your project, you can simply comment out or remove the
|
||||
* relevant code in the linker file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||
/*-Editor annotation file-*/
|
||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_4.xml" */
|
||||
/*-Specials-*/
|
||||
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x10002000;
|
||||
}
|
||||
|
||||
/* MBED_APP_START is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_START
|
||||
* is equal to MBED_ROM_START
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = MBED_ROM_START;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x000FE000;
|
||||
}
|
||||
|
||||
/* MBED_APP_SIZE is being used by the bootloader build script and
|
||||
* will be calculate by the system. Without bootloader the MBED_APP_SIZE
|
||||
* is equal to MBED_ROM_SIZE
|
||||
*/
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x08002000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x00045800;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
/* The symbols below define the location and size of blocks of memory in the target.
|
||||
* Use these symbols to specify the memory regions available for allocation.
|
||||
*/
|
||||
|
||||
/* The following symbols control RAM and flash memory allocation for the CM4 core.
|
||||
* You can change the memory allocation by editing RAM and Flash symbols.
|
||||
* Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
|
||||
* Using this memory region for other purposes will lead to unexpected behavior.
|
||||
* Your changes must be aligned with the corresponding symbols for CM0+ core in 'xx_cm0plus.icf',
|
||||
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.icf'.
|
||||
*/
|
||||
/* RAM */
|
||||
define symbol __ICFEDIT_region_IRAM1_start__ = MBED_RAM_START;
|
||||
define symbol __ICFEDIT_region_IRAM1_end__ = (MBED_RAM_START + MBED_RAM_SIZE);
|
||||
/* Flash */
|
||||
define symbol __ICFEDIT_region_IROM1_start__ = MBED_APP_START;
|
||||
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_APP_START + MBED_APP_SIZE);
|
||||
|
||||
/* The following symbols define a 32K flash region used for EEPROM emulation.
|
||||
* This region can also be used as the general purpose flash.
|
||||
* You can assign sections to this memory region for only one of the cores.
|
||||
* Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
|
||||
* Therefore, repurposing this memory region will prevent such middleware from operation.
|
||||
*/
|
||||
define symbol __ICFEDIT_region_IROM2_start__ = 0x14000000;
|
||||
define symbol __ICFEDIT_region_IROM2_end__ = 0x14007FFF;
|
||||
|
||||
/* The following symbols define device specific memory regions and must not be changed. */
|
||||
/* Supervisory FLASH - User Data */
|
||||
define symbol __ICFEDIT_region_IROM3_start__ = 0x16000800;
|
||||
define symbol __ICFEDIT_region_IROM3_end__ = 0x160007FF;
|
||||
|
||||
/* Supervisory FLASH - Normal Access Restrictions (NAR) */
|
||||
define symbol __ICFEDIT_region_IROM4_start__ = 0x16001A00;
|
||||
define symbol __ICFEDIT_region_IROM4_end__ = 0x16001BFF;
|
||||
|
||||
/* Supervisory FLASH - Public Key */
|
||||
define symbol __ICFEDIT_region_IROM5_start__ = 0x16005A00;
|
||||
define symbol __ICFEDIT_region_IROM5_end__ = 0x160065FF;
|
||||
|
||||
/* Supervisory FLASH - Table of Content # 2 */
|
||||
define symbol __ICFEDIT_region_IROM6_start__ = 0x16007C00;
|
||||
define symbol __ICFEDIT_region_IROM6_end__ = 0x16007DFF;
|
||||
|
||||
/* Supervisory FLASH - Table of Content # 2 Copy */
|
||||
define symbol __ICFEDIT_region_IROM7_start__ = 0x16007E00;
|
||||
define symbol __ICFEDIT_region_IROM7_end__ = 0x16007FFF;
|
||||
|
||||
/* eFuse */
|
||||
define symbol __ICFEDIT_region_IROM8_start__ = 0x90700000;
|
||||
define symbol __ICFEDIT_region_IROM8_end__ = 0x907FFFFF;
|
||||
|
||||
/* XIP */
|
||||
define symbol __ICFEDIT_region_EROM1_start__ = 0x18000000;
|
||||
define symbol __ICFEDIT_region_EROM1_end__ = 0x1FFFFFFF;
|
||||
|
||||
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_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;
|
||||
/*-Sizes-*/
|
||||
if (!isdefinedsymbol(__STACK_SIZE)) {
|
||||
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
|
||||
} else {
|
||||
define symbol __ICFEDIT_size_cstack__ = __STACK_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(__HEAP_SIZE)) {
|
||||
define symbol __ICFEDIT_size_heap__ = 0x20000;
|
||||
} else {
|
||||
define symbol __ICFEDIT_size_heap__ = __HEAP_SIZE;
|
||||
}
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region IROM1_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__];
|
||||
define region IROM2_region = mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
|
||||
define region IROM3_region = mem:[from __ICFEDIT_region_IROM3_start__ to __ICFEDIT_region_IROM3_end__];
|
||||
define region IROM4_region = mem:[from __ICFEDIT_region_IROM4_start__ to __ICFEDIT_region_IROM4_end__];
|
||||
define region IROM5_region = mem:[from __ICFEDIT_region_IROM5_start__ to __ICFEDIT_region_IROM5_end__];
|
||||
define region IROM6_region = mem:[from __ICFEDIT_region_IROM6_start__ to __ICFEDIT_region_IROM6_end__];
|
||||
define region IROM7_region = mem:[from __ICFEDIT_region_IROM7_start__ to __ICFEDIT_region_IROM7_end__];
|
||||
define region IROM8_region = mem:[from __ICFEDIT_region_IROM8_start__ to __ICFEDIT_region_IROM8_end__];
|
||||
define region EROM1_region = mem:[from __ICFEDIT_region_EROM1_start__ to __ICFEDIT_region_EROM1_end__];
|
||||
define region IRAM1_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__];
|
||||
|
||||
define block RAM_DATA {readwrite section .data};
|
||||
define block RAM_OTHER {readwrite section * };
|
||||
define block RAM_NOINIT {readwrite section .noinit};
|
||||
define block RAM_BSS {readwrite section .bss};
|
||||
define block RAM with fixed order {block RAM_DATA, block RAM_OTHER, block RAM_NOINIT, block RAM_BSS};
|
||||
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
|
||||
define block RO {first section .intvec, readonly};
|
||||
|
||||
/*-Initializations-*/
|
||||
initialize by copy { readwrite };
|
||||
do not initialize { section .noinit, section .intvec_ram };
|
||||
|
||||
/*-Placement-*/
|
||||
|
||||
/* Flash */
|
||||
place at start of IROM1_region { block RO };
|
||||
".cy_app_signature" : place at address (__ICFEDIT_region_IROM1_end__ - 0x200) { section .cy_app_signature };
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
".cy_em_eeprom" : place at start of IROM2_region { section .cy_em_eeprom };
|
||||
|
||||
/* Supervisory Flash - User Data */
|
||||
".cy_sflash_user_data" : place at start of IROM3_region { section .cy_sflash_user_data };
|
||||
|
||||
/* Supervisory Flash - NAR */
|
||||
".cy_sflash_nar" : place at start of IROM4_region { section .cy_sflash_nar };
|
||||
|
||||
/* Supervisory Flash - Public Key */
|
||||
".cy_sflash_public_key" : place at start of IROM5_region { section .cy_sflash_public_key };
|
||||
|
||||
/* Supervisory Flash - TOC2 */
|
||||
".cy_toc_part2" : place at start of IROM6_region { section .cy_toc_part2 };
|
||||
|
||||
/* Supervisory Flash - RTOC2 */
|
||||
".cy_rtoc_part2" : place at start of IROM7_region { section .cy_rtoc_part2 };
|
||||
|
||||
/* eFuse */
|
||||
".cy_efuse" : place at start of IROM8_region { section .cy_efuse };
|
||||
|
||||
/* Execute in Place (XIP). See the smif driver documentation for details. */
|
||||
".cy_xip" : place at start of EROM1_region { section .cy_xip };
|
||||
|
||||
/* RAM */
|
||||
place at start of IRAM1_region { readwrite section .intvec_ram};
|
||||
place in IRAM1_region { block RAM};
|
||||
place in IRAM1_region { block HEAP};
|
||||
place at end of IRAM1_region { block CSTACK };
|
||||
|
||||
/* These sections are used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage. */
|
||||
".cymeta" : place at address mem : 0x90500000 { readonly section .cymeta };
|
||||
|
||||
|
||||
keep { section .cy_app_signature,
|
||||
section .cy_em_eeprom,
|
||||
section .cy_sflash_user_data,
|
||||
section .cy_sflash_nar,
|
||||
section .cy_sflash_public_key,
|
||||
section .cy_toc_part2,
|
||||
section .cy_rtoc_part2,
|
||||
section .cy_efuse,
|
||||
section .cy_xip,
|
||||
section .cymeta,
|
||||
};
|
||||
|
||||
|
||||
/* The following symbols used by the cymcuelftool. */
|
||||
/* Flash */
|
||||
define exported symbol __cy_memory_0_start = 0x10000000;
|
||||
define exported symbol __cy_memory_0_length = 0x00100000;
|
||||
define exported symbol __cy_memory_0_row_size = 0x200;
|
||||
|
||||
/* Emulated EEPROM Flash area */
|
||||
define exported symbol __cy_memory_1_start = 0x14000000;
|
||||
define exported symbol __cy_memory_1_length = 0x8000;
|
||||
define exported symbol __cy_memory_1_row_size = 0x200;
|
||||
|
||||
/* Supervisory Flash */
|
||||
define exported symbol __cy_memory_2_start = 0x16000000;
|
||||
define exported symbol __cy_memory_2_length = 0x8000;
|
||||
define exported symbol __cy_memory_2_row_size = 0x200;
|
||||
|
||||
/* XIP */
|
||||
define exported symbol __cy_memory_3_start = 0x18000000;
|
||||
define exported symbol __cy_memory_3_length = 0x08000000;
|
||||
define exported symbol __cy_memory_3_row_size = 0x200;
|
||||
|
||||
/* eFuse */
|
||||
define exported symbol __cy_memory_4_start = 0x90700000;
|
||||
define exported symbol __cy_memory_4_length = 0x100000;
|
||||
define exported symbol __cy_memory_4_row_size = 1;
|
||||
|
||||
/* EOF */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,51 @@
|
|||
Copyright (c) 2018-2019 Cypress Semiconductor Corporation
|
||||
|
||||
Permissive Binary License
|
||||
|
||||
Version 1.0, September 2015
|
||||
|
||||
Redistribution. Redistribution and use in binary form, without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1) Redistributions must reproduce the above copyright notice and the
|
||||
following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
2) Unless to the extent explicitly permitted by law, no reverse
|
||||
engineering, decompilation, or disassembly of this software is
|
||||
permitted.
|
||||
|
||||
3) Redistribution as part of a software development kit must include the
|
||||
accompanying file named "DEPENDENCIES" and any dependencies listed in
|
||||
that file.
|
||||
|
||||
4) Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
Limited patent license. The copyright holders (and contributors) grant a
|
||||
worldwide, non-exclusive, no-charge, royalty-free patent license to
|
||||
make, have made, use, offer to sell, sell, import, and otherwise
|
||||
transfer this software, where such license applies only to those patent
|
||||
claims licensable by the copyright holders (and contributors) that are
|
||||
necessarily infringed by this software. This patent license shall not
|
||||
apply to any combinations that include this software. No hardware is
|
||||
licensed hereunder.
|
||||
|
||||
If you institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the software
|
||||
itself infringes your patent(s), then your rights granted under this
|
||||
license shall terminate as of the date such litigation is filed.
|
||||
|
||||
DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
|
||||
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,18 @@
|
|||
README for pre-compiled PSoC 6 Cortex M0+ core images
|
||||
=====================================================
|
||||
|
||||
This folder contains precompiled program images for the CM0+ core of the
|
||||
PSoC 6 MCU suitable for use with Mbed OS applications running on CM4 core.
|
||||
|
||||
* `psoc6_01_cm0p_sleep.hex`
|
||||
|
||||
This image starts CM4 core at CY_CORTEX_M4_APPL_ADDR=0x10080000
|
||||
and puts CM0+ core into a deep sleep.
|
||||
|
||||
The images are 'bare metal' code prepared with Cypress ModusToolbox IDE
|
||||
and are toolchain agnostic, i.e. can be used with CM4 Mbed applications
|
||||
build with any supported toolchain.
|
||||
|
||||
**These images were prepared by Cypress Semiconductor Corporation
|
||||
and are made available under the conditions of Permissive Binary Licence,
|
||||
see file LICENSE.txt**
|
|
@ -0,0 +1,106 @@
|
|||
:020000041000EA
|
||||
:40000000002000080B0100100D0000006D01001000000000000000000000000000000000000000000000000000000000690100100000000000000000690100106901001083
|
||||
:4000400069010010690100106901001069010010690100106901001069010010690100106901001069010010690100106901001069010010690100106901001069010010E0
|
||||
:4000800069010010690100106901001069010010690100106901001069010010690100106901001069010010690100106901001069010010690100106901001069010010A0
|
||||
:4000C00010B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD6C050008000000000C150010044B10B5002B03D00349044800E000BF10BDC04600000000C9
|
||||
:40010000700500080C1500107047FFF7FDFF72B60F4C104DAC4209DA21686268A368043B02DBC858D050FAE70C34F3E70A490B4A0020521A02DD043A8850FCDC084809495F
|
||||
:400140000860BFF34F8F00F0F1F800F099F9FEE710150010281500106C0500087C0700080000000808ED00E0FEE7FEE700B504207146084202D0EFF3098001E0EFF30880B8
|
||||
:40018000043000F0DBFDFEE710B5002000F040FC10BD7047E02370B5544C9B00E2580F23D02113409A0089001219505807210840032860D0042861D0424250414C4A40426B
|
||||
:4001C00010404C4A8018002B67D1B223B1220321DB00D200E558A358A6581B0F360F0B400E4204D0A258120F0A40012A01D1EA0701D4032B11D1B0233F4ADB00E558A158EC
|
||||
:40020000E658C904C90C00F051FFAD03AD0B6843F101C90F013100F049FFE0239B00E3589B069B0FD840354B1860354B1C691969240A090E013100F039FF324BE1B2186075
|
||||
:40024000013100F033FF304B040018602F4B30491860304BC01800F029FFFA212E4B890018702E4BE01800F021FF2D4B18602D4BC003186070BD2C4A1068A4E7C021890084
|
||||
:4002800052581F210A40112A01D0132A02D18020000298E7FA20C00195E7012BBDD1C823C0220321DB00D200E558A358A6581B0F360F0B400E4204D0A258120F0A40012A7A
|
||||
:4002C00001D1EA0701D4032BA7D1C022D200A358A158A5587F221F261340090A3140584300F0E4FE290C314095E7C0460000264000DC0BFF00366E0184050000C80000087F
|
||||
:4003000000002140CC000008C0000008D400000840420F003F420F00DC000008E7030000D8000008D0000008C400000810B5244800F0C2F8B022E0213020224CD200A35838
|
||||
:4003400089005B005B08A35063588343635080235B04A3501C4B1D4AE250A02204339201E250FF221A4BE25000F08EFEC02201215200A3588B43A350FFF70BFFFFF70AFF17
|
||||
:40038000B0235B055A78002A02D05B78212B03D10022104BDA605A600F4A8021042000F09FFB0E4800F09EF90D4B1B6851331B78002B02D00B4800F001FA00F035F910BD3B
|
||||
:4003C0005C1200100000264084050000010002008C050000E000234088050008980500087807000828120010024BD86F032318407047C0460400214010B500F056F8074927
|
||||
:40040000074ACB6F1A40074B1343CB67102306490A681A42FCD000F04CF810BD04002140FCFF00000100FA058800214070B50F4C060000F03AF8E36F0500DB439B0701D106
|
||||
:40044000FFF7DAFFB0230A4A9B00D650E36F094A09491A40094B1343E36710230A681A42FCD0280000F025F870BDC0460400214000002140FCFF0000880021400300FA059F
|
||||
:4004800010B562B60348FFF7D1FF002000F066FDFBE7C046002000100230800803D001300238FCD1C046C0467047EFF3108072B6704780F310887047014B18607047C046A7
|
||||
:4004C000780700081D4B98420FD010D840282FD005D8002830D0102828D019481EE0802828D080235B009842F7D1144816E0154B984214D008D8A0231B0698421CD0124BDA
|
||||
:400500009842EAD1A0200BE0104B98420AD0104B984209D00F4B9842DFD10F487047A420C003FBE70D48F9E70D48F7E70D48F5E70D48F3E70D48F1E70020EFE706005200C0
|
||||
:40054000FF005200010000F0090000A0040000F0050000F0030000F001005200020052000300520001005000020050000500520070B50A4D04002B6831331B78834204D813
|
||||
:40058000C4210748FF3100F0C9FB2B681A00B03210884443186A201870BDC046780700081413001010B50020FFF7E2FF0A4B1C682300B4331B68C0180368002B0ADB074B03
|
||||
:4005C0001868FFF77FFF012263689A609A68002AFCD110BD0248FCE77807000818070008020050000D4B10B51860002804D0FE235B42038000234380094B1B681A00503201
|
||||
:400600001278002A08D051331B78002B04D002220449002000F06EF910BDC04628070008780700084D01000810B50248FFF7DAFF10BDC0462C0700080B4B70B51B6805005A
|
||||
:40064000B4331B680C00C3181B68002B09DA0B0C03D00649064800F061FB0020A4B26C6070BD0448FCE7C04678070008D50200001413001001008A00036870B505000C0060
|
||||
:40068000002B0ADAC2600B0C03D00549054800F045FB0020A4B2AC6070BD0348FCE7C046BB0200001413001001008A0070B505000C1E03D19921084800F030FB074B1B68D0
|
||||
:4006C000B4331B68EB181B68002B03DA0020EB68236070BD0248FCE77A1300107807000801008A00024B1A68002A00D11860704730070008F7B52C4D1F002B68040000915F
|
||||
:400700000192002B03D1B521284800F007FB2C23FF225C432B683D001C193B0A3F0CA760234F134063603B681540256031331B789D4204D3C4211F48FF3100F0EFFA3B689A
|
||||
:400740001A00B032128855431A6A3233AD1825611B7865689D4204D3E0211648FF3100F0DDFA3B6880351B6A6D01A668ED186561330C09D0FF210F4F4900380000F0CEFAB8
|
||||
:400780000D49380000F0CAFA33041A0C1343AB60019BE361009B23620023A361089B002B01D01B782373F7BD30070008DF1300107807000814130010FF010000F0B50400EE
|
||||
:4007C00085B0002803D15221214800F0A7FA6368032B03D954211E4800F0A0FAE36A002B03D158211A4800F099FA236B002B03D15921174800F092FAA36802AD2B70154BE0
|
||||
:4008000022681B68E16ADB8EE0689B186B706368A26A039300952369266A676AFFF76AFF00213B000A0000913000FFF763FF216B280000F01FFA0023EB56002B06DB1F22E6
|
||||
:4008400013401E3A9A401300034A136005B0F0BDDF1300107807000800E100E0F7B504000F00151E019303D1FD211C4800F056FA1B4E3368002B03D1FE21184800F04EFA9E
|
||||
:400880002C235C4332685F4314192669D719002E1FD0BB69002B1ED13368002B1BDA01226368140011009C407B6899402B6809049BB20B432B60019BF5607B62BA61230CC3
|
||||
:4008C00003D00849084800F029FA0020A4B2B460FEBD0648FCE70648FAE7C046DF13001030070008BB0200001413001004028A0007028A00F8B5114F04003B680E00150097
|
||||
:40090000002B04D1AF210E48490000F007FA2C2060433C682418236A002B04D1B1210848490000F0FBF9E369AB4204D90020236AAD00EE50F8BD0348FCE7C04630070008D6
|
||||
:40094000DF1300100A028A00002373B504000193984204D1D2212C48FF3100F0DFF92369002B04D1E9212848490000F0D7F96369002B04D1D4212448FF3100F0CFF9236A3D
|
||||
:40098000002B04D1EA212048490000F0C7F96269D5682B0C22D01B04136013681B4B20691B68B4331B68C3181B68002B16DA01A9FFF77CFE0026B0420CD10198E2690368DA
|
||||
:4009C0001E0CDBB29A4205D9226A9B009B58002B00D0984731002069FFF72EFEADB2002D09D063691D6000251B68636AAB4205D098476562A56163691B6873BDA36A002B6E
|
||||
:400A0000F8D09847F6E7C046DF1300107807000870B5084C05002368002B04D1B2210648FF3100F07BF92C20454320684019FFF78BFF70BD30070008DF13001070B50A4DC6
|
||||
:400A400004002B6831331B78834204D8C4210748FF3100F063F92B681A00B03210884443186A201870BDC0467807000814130010F8B5174B0D001B6831331B78834225D9E5
|
||||
:400A8000002923D01F240B681C401FD1FFF7D6FF07002B680F4EDA0821003060686800F091FB21003800FFF7C7FD21002A003068FFF7E2FD041E07D101003068FFF7BCFD6A
|
||||
:400AC00003002000002B00D00348F8BD0348FCE7780700083C07000801018A0003018A0010B50C00002A07D100290DD1FFF7A6FF064B1860200010BD002905D004490C60DC
|
||||
:400B00004A60FFF7B5FFF6E70248F4E73C0700083407000803018A00F7B5184F04003B680191DE683368834226D90025A94202D1FFF7BBFC050038680368002B1ADA1F2252
|
||||
:400B400001232240934064097268A4001419226813420DD09A43226000240021FFF76CFD019B002B02D12800FFF7A3FC2000FEBD034CF2E7034CF3E7034CF7E73C0700084A
|
||||
:400B8000020188000301880004018A000A4B1B68DB681A6882420DD959681F23420918401E3B8340920050581840431E9841034BC01870470248FCE73C07000800018800DC
|
||||
:400BC00004018A0070B51A4E050033680C001A0028321278012A15D182080721100088430FD103202840C00084401B68920020339B182200FF24844019684A4014404C4093
|
||||
:400C00001C6070BD5B8FDBB28B4203D17621094800F084F80720802205408020336892011B680006A4180543A400E550E9E7C04678070008451400100A4B70B59B680A4EC2
|
||||
:400C400010300D008400B34209D1002904D138210648FF3100F062F83059355170BD044B1859FBE700ED00E0000000084514001000000010F8B506000D00002841D04368E5
|
||||
:400C8000032B03D93221204800F048F800203056002828DB7178FFF795FF0024FF2200200327944630567168C3B21F40FF006646BA4089013140D243B940002815DB134E38
|
||||
:400CC00083089B009B19C026B6009F593A40114399510F4B9A680F4B9A4202D12900FFF7ABFF2000F8BD0C4CD8E70F263340083B074E9B089B009B19DE6932401143D9613B
|
||||
:400D0000E7E7054CEDE7C0464514001000E100E000ED00E0000000080100560070B50D00044C01001822200000F054FAA56101BEFEE7C04630050008FEE7000002680A4BB8
|
||||
:400D400010B5DA6142681A6282685A62C2689A620269DA6242691A6382695A63C2699A63FFF7EAFF10BDC04630050008B0235B055A782120002A01D05878C0B27047B023E6
|
||||
:400D80005B059A89002A02D0988980B2704780204000FBE710B5074C236831331B78002B04D1C4210448FF31FFF7B8FF2368186A10BDC046780700081413001030B50400B9
|
||||
:400DC00085B00D00042803D927492848FFF7A6FF6B1E012B07D9FB222B1F134203D024492248FFF79BFF234BA400E458042D01D0012D1AD100200FE0A3682B420BD1E3688C
|
||||
:400E000029001A685B6802920193039302A823689847194B1C606469002C04D0174B9842EAD1012DE8D105B030BD022D06D1124B1B68181EF7D01C6903E01C006369002BE7
|
||||
:400E4000FBD10020002CEED0A3682B4209D1E36829001A685B6802920193039302A8236898472469EEE7C046DC090000A9140010DD0900004407000840070008FF004200DC
|
||||
:400E800010B5041E03D111491148FFF747FFF222104BD2011B68DB689A582260F022D2019A5862600C4A9A58A2600C4A9A58E2600B4A9A5822610B4A9A5862610A4A9A5885
|
||||
:400EC000A2610A4A9B58E36110BDC046CB0A0000A91400107807000804780000087800000C78000010780000147800001878000010B5041E03D110491048FFF70FFFF022C2
|
||||
:400F00000F4B61681B68D201DB689950A1680D4A9950E1680C4A995021690C4A995061690B4A9950A1690B4A9950E1690A4A99502168E832995010BDF30A0000A914001078
|
||||
:400F40007807000804780000087800000C780000107800001478000018780000F7B50700012803D940494148FFF7D8FE404D6B68002B4AD1FFF799FA6B680190002B56D14B
|
||||
:400F80003C4E33681A0043321278002A07D09B68E0331B68DB0602D53748FFF771FFFFF7EEFE80235B00984246D1380000F034F9002433681A0043321278002A17D0002885
|
||||
:400FC00015D09B68E0331B68DB0610D5FFF7CEFE294B212808D032681300B033198807234B43126A9B18DB681800FFF781FF0198FFF75FFA002C0ED16B68002B03D0082180
|
||||
:401000000120FFF7DBFE2000FEBD01210800FFF7D5FE041EAED06B68002B03D002210120FFF7CCFE154B9C42EDD0154CEBE704210120FFF7C3FEA3E7FFF7ACFE3368B433A6
|
||||
:401040001B68C0180368002B0BDB04230D4A11690B431361012F02D030BF0020A8E720BFFBE70020054CA4E7A5020000A91400104407000878070008580700080500420086
|
||||
:40108000FF00420000ED00E0C0228020064952008B58C0059B009B0803438B50802388581B0603438B50704700002640002243088B4274D303098B425FD3030A8B4244D399
|
||||
:4010C000030B8B4228D3030C8B420DD3FF22090212BA030C8B4202D31212090265D0030B8B4219D300E0090AC30B8B4201D3CB03C01A5241830B8B4201D38B03C01A5241C3
|
||||
:40110000430B8B4201D34B03C01A5241030B8B4201D30B03C01A5241C30A8B4201D3CB02C01A5241830A8B4201D38B02C01A5241430A8B4201D34B02C01A5241030A8B4289
|
||||
:4011400001D30B02C01A5241CDD2C3098B4201D3CB01C01A524183098B4201D38B01C01A524143098B4201D34B01C01A524103098B4201D30B01C01A5241C3088B4201D37E
|
||||
:40118000CB00C01A524183088B4201D38B00C01A524143088B4201D34B00C01A5241411A00D20146524110467047FFE701B5002000F006F802BDC0460029F7D076E77047A8
|
||||
:4011C0007047C04603001218934200D1704719700133F9E730B50500002A00D130BD0C78013A6B1C2C700131002C05D19A189A42F4D01C700133FAE71D00EDE7F8B5C0468C
|
||||
:40120000F8BC08BC9E467047F8B5C046F8BC08BC9E4670470000000001B40248844601BC604700BFA9020008030000000100000001000000000000000503600004000000C5
|
||||
:401240000100000000000000010000000604600008000000F8060008890100100000214000002540000001400000344000002440000031400000324000001F4100002340D5
|
||||
:4012800000001140010101010101010101101010800019005500F0000501053B04101C01010000000FC000000004000001010101011D3A5778960008200010120800000068
|
||||
:4012C000001F00000010000F002000023F06080E00080009000A000B24282C3034000000100000009000000088000000080000008000000004F0000000F00000400200005B
|
||||
:401300002005A000D00100018001A0012000000010000000433A2F55736572732F766D65642F4D6F647573546F6F6C626F785F312E312F6C69627261726965732F70736FB1
|
||||
:40134000633673772D312E312F636F6D706F6E656E74732F70736F633670646C2F647269766572732F696E636C7564652F63795F6970635F6472762E6800433A2F5573655D
|
||||
:4013800072732F766D65642F4D6F647573546F6F6C626F785F312E312F6C69627261726965732F70736F633673772D312E312F636F6D706F6E656E74732F70736F633670B4
|
||||
:4013C000646C2F647269766572732F736F757263652F63795F6970635F6472762E6300433A2F55736572732F766D65642F4D6F647573546F6F6C626F785F312E312F6C69A3
|
||||
:40140000627261726965732F70736F633673772D312E312F636F6D706F6E656E74732F70736F633670646C2F647269766572732F736F757263652F63795F6970635F706968
|
||||
:4014400070652E6300433A2F55736572732F766D65642F4D6F647573546F6F6C626F785F312E312F6C69627261726965732F70736F633673772D312E312F636F6D706F6EF8
|
||||
:40148000656E74732F70736F633670646C2F647269766572732F736F757263652F63795F737973696E742E6300433A2F55736572732F766D65642F4D6F647573546F6F6C17
|
||||
:4014C000626F785F312E312F6C69627261726965732F70736F633673772D312E312F636F6D706F6E656E74732F70736F633670646C2F647269766572732F736F757263654A
|
||||
:401500002F63795F737973706D2E6300000000000000001000000008C000000030150010C0000008700400006C0500081002000000093D000048E80100127A0000093D0037
|
||||
:401540000000D00700093D00A00F000004000000E9000010C100001080B230B5C00020D0104B07221C682300B0331B885A43236AD31819680029FCDA3E210B4B062519606B
|
||||
:401580000A4B0B491960A3210A4BC9005D500A4958505858206A1218002050605A58002AFCDA30BD7807000804012640080126401E1F0000000026401C05000010B5437807
|
||||
:4015C000FF2B11D100F0CCF90400042000F0A8F9C3685A68012311681943116011681942FCD1200000F0C4F910BDF7B500900020019100F095F93F4D06002B681A005033B1
|
||||
:40160000B43214681B780419002B5AD000F090F9070003281BD000F0A3F9374A374B0500D358002B3EDA364A0121300000F0A8F9002837D10198FFF78FFF009B002B3ED027
|
||||
:401640002368002BFCDB00F07BF904002BE0062000F066F92B68B4331B68C0180368002B02DA284C2000FEBD002000F091F9264B9842F6D00023254A19001268012000F07E
|
||||
:4016800047F90025A842ECD1002000F081F91E4A1F4B904203D09D42E3D00135F4E79D42B9D1DEE7174C032F05D10121002000F04FF90028F9D1280000F05AF9D2E7154CF0
|
||||
:4016C000F1E700F04DF90E4A05000121300000F057F9002809D1009B002B08D02368002BFCDB00F02DF90400E5E7064CE3E7094CE1E7C04678070008000026401C0500008D
|
||||
:4017000018070008050052000101880028070008F049020001005000F7B56E4D04002A68536800931300B033198807234B43126A9B181A68002AFCDA00F0E2F82A68130024
|
||||
:40174000B033198807234B43212800D096E0116A5B180221D8680143D960D968C9072FD508208446944460461600D968C06F01911168883608183568076849190D683902BE
|
||||
:40178000FF273F040F40694689882D0A2D0639432943D960902103684F4D09012B400B430360136830681B18186805402943196013686246D26F9A18126832689B181B68F8
|
||||
:4017C000444D2A681300B033198807234B43126A9B1800225A600423404A11690B431361012C50D030BF2A681300B033198807234B43126A9B181A68002AFCDA00F080F849
|
||||
:40180000212842D1296807220B000124B0331B8800205A430B6AD318DD6825421CD0080008300D68C06F2C4E28180568DB6835401B0C1B061B0C2B4303600B0088331868DE
|
||||
:401840000B6818180B6A0568D318DB682E401B0E1B023343036020000B6A0221D218D3688B43D3601B4B1A681300B033198807234B43126A9B1800225A60FEBD126A9B181E
|
||||
:40188000174ADA609CE720BFADE70020009BFC331B698342E6D1A320124B1349134A144FC0000E681D5814680F6006271F503E20106010483E371F501F58002FFCDA009821
|
||||
:4018C0000D4FFC3007610E60A321C9005D5001201460C7E778070008FF00FFFF00ED00E0580700080000264008012640040126401E1F00001C050000AAAAAAAA000000000F
|
||||
:4019000001B40248844601BC604700BF6D0D001001B40248844601BC604700BF5D08001001B40248844601BC604700BF7105001001B40248844601BC604700BFE903001076
|
||||
:4019400001B40248844601BC604700BFA505001001B40248844601BC604700BF190B001001B40248844601BC604700BFAB04001001B40248844601BC604700BFB304001043
|
||||
:4019800001B40248844601BC604700BF7906001001B40248844601BC604700BF8D0B0010000000000000000000000000000000000000000000000000000000000000000018
|
||||
:4019C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E7
|
||||
:00000001FF
|
|
@ -0,0 +1,595 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6_cm4.c
|
||||
* \version 2.40
|
||||
*
|
||||
* The device system-source file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "cy_device.h"
|
||||
#include "device.h"
|
||||
#include "system_psoc6.h"
|
||||
#include "cy_device_headers.h"
|
||||
#include "psoc6_utils.h"
|
||||
#include "cy_syslib.h"
|
||||
#include "cy_wdt.h"
|
||||
#include "cycfg.h"
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
#include "cy_ipc_sema.h"
|
||||
#include "cy_ipc_pipe.h"
|
||||
#include "cy_ipc_drv.h"
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2)
|
||||
#include "cy_flash.h"
|
||||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
void mailbox_init(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate()
|
||||
*******************************************************************************/
|
||||
|
||||
/** Default HFClk frequency in Hz */
|
||||
#define CY_CLK_HFCLK0_FREQ_HZ_DEFAULT (8000000UL)
|
||||
|
||||
/** Default PeriClk frequency in Hz */
|
||||
#define CY_CLK_PERICLK_FREQ_HZ_DEFAULT (4000000UL)
|
||||
|
||||
/** Default SlowClk system core frequency in Hz */
|
||||
#define CY_CLK_SYSTEM_FREQ_HZ_DEFAULT (8000000UL)
|
||||
|
||||
/** IMO frequency in Hz */
|
||||
#define CY_CLK_IMO_FREQ_HZ (8000000UL)
|
||||
|
||||
/** HVILO frequency in Hz */
|
||||
#define CY_CLK_HVILO_FREQ_HZ (32000UL)
|
||||
|
||||
/** PILO frequency in Hz */
|
||||
#define CY_CLK_PILO_FREQ_HZ (32768UL)
|
||||
|
||||
/** WCO frequency in Hz */
|
||||
#define CY_CLK_WCO_FREQ_HZ (32768UL)
|
||||
|
||||
/** ALTLF frequency in Hz */
|
||||
#define CY_CLK_ALTLF_FREQ_HZ (32768UL)
|
||||
|
||||
|
||||
/**
|
||||
* Holds the SlowClk (Cortex-M0+) or FastClk (Cortex-M4) system core clock,
|
||||
* which is the system clock frequency supplied to the SysTick timer and the
|
||||
* processor core clock.
|
||||
* This variable implements CMSIS Core global variable.
|
||||
* Refer to the [CMSIS documentation]
|
||||
* (http://www.keil.com/pack/doc/CMSIS/Core/html/group__system__init__gr.html "System and Clock Configuration")
|
||||
* for more details.
|
||||
* This variable can be used by debuggers to query the frequency
|
||||
* of the debug timer or to configure the trace clock speed.
|
||||
*
|
||||
* \attention Compilers must be configured to avoid removing this variable in case
|
||||
* the application program is not using it. Debugging systems require the variable
|
||||
* to be physically present in memory so that it can be examined to configure the debugger. */
|
||||
uint32_t SystemCoreClock = CY_CLK_SYSTEM_FREQ_HZ_DEFAULT;
|
||||
|
||||
/** Holds the HFClk0 clock frequency. Updated by \ref SystemCoreClockUpdate(). */
|
||||
uint32_t cy_Hfclk0FreqHz = CY_CLK_HFCLK0_FREQ_HZ_DEFAULT;
|
||||
|
||||
/** Holds the PeriClk clock frequency. Updated by \ref SystemCoreClockUpdate(). */
|
||||
uint32_t cy_PeriClkFreqHz = CY_CLK_PERICLK_FREQ_HZ_DEFAULT;
|
||||
|
||||
/** Holds the Alternate high frequency clock in Hz. Updated by \ref SystemCoreClockUpdate(). */
|
||||
#if (defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL)) || defined (CY_DOXYGEN)
|
||||
uint32_t cy_BleEcoClockFreqHz = CY_CLK_ALTHF_FREQ_HZ;
|
||||
#endif /* (defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL)) || defined (CY_DOXYGEN) */
|
||||
|
||||
/* SCB->CPACR */
|
||||
#define SCB_CPACR_CP10_CP11_ENABLE (0xFUL << 20u)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemInit()
|
||||
*******************************************************************************/
|
||||
|
||||
/* CLK_FLL_CONFIG default values */
|
||||
#define CY_FB_CLK_FLL_CONFIG_VALUE (0x01000000u)
|
||||
#define CY_FB_CLK_FLL_CONFIG2_VALUE (0x00020001u)
|
||||
#define CY_FB_CLK_FLL_CONFIG3_VALUE (0x00002800u)
|
||||
#define CY_FB_CLK_FLL_CONFIG4_VALUE (0x000000FFu)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* SystemCoreClockUpdate (void)
|
||||
*******************************************************************************/
|
||||
|
||||
/* Do not use these definitions directly in your application */
|
||||
#define CY_DELAY_MS_OVERFLOW_THRESHOLD (0x8000u)
|
||||
#define CY_DELAY_1K_THRESHOLD (1000u)
|
||||
#define CY_DELAY_1K_MINUS_1_THRESHOLD (CY_DELAY_1K_THRESHOLD - 1u)
|
||||
#define CY_DELAY_1M_THRESHOLD (1000000u)
|
||||
#define CY_DELAY_1M_MINUS_1_THRESHOLD (CY_DELAY_1M_THRESHOLD - 1u)
|
||||
uint32_t cy_delayFreqHz = CY_CLK_SYSTEM_FREQ_HZ_DEFAULT;
|
||||
|
||||
uint32_t cy_delayFreqKhz = (CY_CLK_SYSTEM_FREQ_HZ_DEFAULT + CY_DELAY_1K_MINUS_1_THRESHOLD) /
|
||||
CY_DELAY_1K_THRESHOLD;
|
||||
|
||||
uint8_t cy_delayFreqMhz = (uint8_t)((CY_CLK_SYSTEM_FREQ_HZ_DEFAULT + CY_DELAY_1M_MINUS_1_THRESHOLD) /
|
||||
CY_DELAY_1M_THRESHOLD);
|
||||
|
||||
uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
|
||||
((CY_CLK_SYSTEM_FREQ_HZ_DEFAULT + CY_DELAY_1K_MINUS_1_THRESHOLD) / CY_DELAY_1K_THRESHOLD);
|
||||
|
||||
#define CY_ROOT_PATH_SRC_IMO (0UL)
|
||||
#define CY_ROOT_PATH_SRC_EXT (1UL)
|
||||
#if (SRSS_ECO_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_ECO (2UL)
|
||||
#endif /* (SRSS_ECO_PRESENT == 1U) */
|
||||
#if (SRSS_ALTHF_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_ALTHF (3UL)
|
||||
#endif /* (SRSS_ALTHF_PRESENT == 1U) */
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX (4UL)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_HVILO (16UL)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_WCO (17UL)
|
||||
#if (SRSS_ALTLF_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_ALTLF (18UL)
|
||||
#endif /* (SRSS_ALTLF_PRESENT == 1U) */
|
||||
#if (SRSS_PILO_PRESENT == 1U)
|
||||
#define CY_ROOT_PATH_SRC_DSI_MUX_PILO (19UL)
|
||||
#endif /* (SRSS_PILO_PRESENT == 1U) */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SystemInit
|
||||
****************************************************************************//**
|
||||
* \cond
|
||||
* Initializes the system:
|
||||
* - Restores FLL registers to the default state for single core devices.
|
||||
* - Unlocks and disables WDT.
|
||||
* - Calls Cy_PDL_Init() function to define the driver library.
|
||||
* - Calls the Cy_SystemInit() function, if compiled from PSoC Creator.
|
||||
* - Calls \ref SystemCoreClockUpdate().
|
||||
* \endcond
|
||||
*******************************************************************************/
|
||||
void SystemInit(void)
|
||||
{
|
||||
Cy_PDL_Init(CY_DEVICE_CFG);
|
||||
|
||||
#ifdef __CM0P_PRESENT
|
||||
#if (__CM0P_PRESENT == 0)
|
||||
/* Restore FLL registers to the default state as they are not restored by the ROM code */
|
||||
uint32_t copy = SRSS->CLK_FLL_CONFIG;
|
||||
copy &= ~SRSS_CLK_FLL_CONFIG_FLL_ENABLE_Msk;
|
||||
SRSS->CLK_FLL_CONFIG = copy;
|
||||
|
||||
copy = SRSS->CLK_ROOT_SELECT[0u];
|
||||
copy &= ~SRSS_CLK_ROOT_SELECT_ROOT_DIV_Msk; /* Set ROOT_DIV = 0*/
|
||||
SRSS->CLK_ROOT_SELECT[0u] = copy;
|
||||
|
||||
SRSS->CLK_FLL_CONFIG = CY_FB_CLK_FLL_CONFIG_VALUE;
|
||||
SRSS->CLK_FLL_CONFIG2 = CY_FB_CLK_FLL_CONFIG2_VALUE;
|
||||
SRSS->CLK_FLL_CONFIG3 = CY_FB_CLK_FLL_CONFIG3_VALUE;
|
||||
SRSS->CLK_FLL_CONFIG4 = CY_FB_CLK_FLL_CONFIG4_VALUE;
|
||||
|
||||
/* Unlock and disable WDT */
|
||||
Cy_WDT_Unlock();
|
||||
Cy_WDT_Disable();
|
||||
#endif /* (__CM0P_PRESENT == 0) */
|
||||
#endif /* __CM0P_PRESENT */
|
||||
|
||||
Cy_SystemInit();
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
|
||||
#ifdef __CM0P_PRESENT
|
||||
#if (__CM0P_PRESENT == 0)
|
||||
/* Allocate and initialize semaphores for the system operations. */
|
||||
static uint32_t ipcSemaArray[CY_IPC_SEMA_COUNT / CY_IPC_SEMA_PER_WORD];
|
||||
(void) Cy_IPC_Sema_Init(CY_IPC_CHAN_SEMA, CY_IPC_SEMA_COUNT, ipcSemaArray);
|
||||
#else
|
||||
(void) Cy_IPC_Sema_Init(CY_IPC_CHAN_SEMA, 0ul, NULL);
|
||||
#endif /* (__CM0P_PRESENT) */
|
||||
#else
|
||||
(void) Cy_IPC_Sema_Init(CY_IPC_CHAN_SEMA, 0ul, NULL);
|
||||
#endif /* __CM0P_PRESENT */
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
*
|
||||
* Initializes the system pipes. The system pipes are used by BLE and Flash.
|
||||
*
|
||||
* If the default startup file is not used, or SystemInit() is not called in your
|
||||
* project, call the following three functions prior to executing any flash or
|
||||
* EmEEPROM write or erase operation:
|
||||
* -# Cy_IPC_Sema_Init()
|
||||
* -# Cy_IPC_Pipe_Config()
|
||||
* -# Cy_IPC_Pipe_Init()
|
||||
* -# Cy_Flash_Init()
|
||||
*
|
||||
*******************************************************************************/
|
||||
/* Create an array of endpoint structures */
|
||||
static cy_stc_ipc_pipe_ep_t systemIpcPipeEpArray[CY_IPC_MAX_ENDPOINTS];
|
||||
|
||||
Cy_IPC_Pipe_Config(systemIpcPipeEpArray);
|
||||
|
||||
static cy_ipc_pipe_callback_ptr_t systemIpcPipeSysCbArray[CY_SYS_CYPIPE_CLIENT_CNT];
|
||||
|
||||
static const cy_stc_ipc_pipe_config_t systemIpcPipeConfigCm4 =
|
||||
{
|
||||
/* .ep0ConfigData */
|
||||
{
|
||||
/* .ipcNotifierNumber */ CY_IPC_INTR_CYPIPE_EP0,
|
||||
/* .ipcNotifierPriority */ CY_SYS_INTR_CYPIPE_PRIOR_EP0,
|
||||
/* .ipcNotifierMuxNumber */ CY_SYS_INTR_CYPIPE_MUX_EP0,
|
||||
/* .epAddress */ CY_IPC_EP_CYPIPE_CM0_ADDR,
|
||||
/* .epConfig */ CY_SYS_CYPIPE_CONFIG_EP0
|
||||
},
|
||||
/* .ep1ConfigData */
|
||||
{
|
||||
/* .ipcNotifierNumber */ CY_IPC_INTR_CYPIPE_EP1,
|
||||
/* .ipcNotifierPriority */ CY_SYS_INTR_CYPIPE_PRIOR_EP1,
|
||||
/* .ipcNotifierMuxNumber */ 0u,
|
||||
/* .epAddress */ CY_IPC_EP_CYPIPE_CM4_ADDR,
|
||||
/* .epConfig */ CY_SYS_CYPIPE_CONFIG_EP1
|
||||
},
|
||||
/* .endpointClientsCount */ CY_SYS_CYPIPE_CLIENT_CNT,
|
||||
/* .endpointsCallbacksArray */ systemIpcPipeSysCbArray,
|
||||
/* .userPipeIsrHandler */ &Cy_SysIpcPipeIsrCm4
|
||||
};
|
||||
|
||||
if (cy_device->flashPipeRequired != 0u)
|
||||
{
|
||||
Cy_IPC_Pipe_Init(&systemIpcPipeConfigCm4);
|
||||
}
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2)
|
||||
Cy_Flash_Init();
|
||||
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */
|
||||
|
||||
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: mbed_sdk_init
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Mbed's post-memory-initialization function.
|
||||
* Used here to initialize common parts of the Cypress libraries.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void mbed_sdk_init(void)
|
||||
{
|
||||
#if !defined(COMPONENT_SPM_MAILBOX)
|
||||
/* Disable global interrupts */
|
||||
__disable_irq();
|
||||
#endif
|
||||
|
||||
/* Initialize shared resource manager */
|
||||
cy_srm_initialize();
|
||||
|
||||
/* Initialize system and clocks. */
|
||||
/* Placed here as it must be done after proper LIBC initialization. */
|
||||
SystemInit();
|
||||
|
||||
#if defined(COMPONENT_SPM_MAILBOX)
|
||||
mailbox_init();
|
||||
#endif
|
||||
|
||||
/* Set up the device based on configurator selections */
|
||||
init_cycfg_all();
|
||||
|
||||
/* Enable global interrupts */
|
||||
__enable_irq();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SystemInit
|
||||
****************************************************************************//**
|
||||
*
|
||||
* The function is called during device startup. Once project compiled as part of
|
||||
* the PSoC Creator project, the Cy_SystemInit() function is generated by the
|
||||
* PSoC Creator.
|
||||
*
|
||||
* The function generated by PSoC Creator performs all of the necessary device
|
||||
* configuration based on the design settings. This includes settings from the
|
||||
* Design Wide Resources (DWR) such as Clocks and Pins as well as any component
|
||||
* configuration that is necessary.
|
||||
*
|
||||
*******************************************************************************/
|
||||
__WEAK void Cy_SystemInit(void)
|
||||
{
|
||||
/* Empty weak function. The actual implementation to be in the PSoC Creator
|
||||
* generated strong function.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SystemCoreClockUpdate
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Gets core clock frequency and updates \ref SystemCoreClock, \ref
|
||||
* cy_Hfclk0FreqHz, and \ref cy_PeriClkFreqHz.
|
||||
*
|
||||
* Updates global variables used by the \ref Cy_SysLib_Delay(), \ref
|
||||
* Cy_SysLib_DelayUs(), and \ref Cy_SysLib_DelayCycles().
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
uint32_t srcFreqHz;
|
||||
uint32_t pathFreqHz;
|
||||
uint32_t fastClkDiv;
|
||||
uint32_t periClkDiv;
|
||||
uint32_t rootPath;
|
||||
uint32_t srcClk;
|
||||
|
||||
/* Get root path clock for the high-frequency clock # 0 */
|
||||
rootPath = _FLD2VAL(SRSS_CLK_ROOT_SELECT_ROOT_MUX, SRSS->CLK_ROOT_SELECT[0u]);
|
||||
|
||||
/* Get source of the root path clock */
|
||||
srcClk = _FLD2VAL(SRSS_CLK_PATH_SELECT_PATH_MUX, SRSS->CLK_PATH_SELECT[rootPath]);
|
||||
|
||||
/* Get frequency of the source */
|
||||
switch (srcClk)
|
||||
{
|
||||
case CY_ROOT_PATH_SRC_IMO:
|
||||
srcFreqHz = CY_CLK_IMO_FREQ_HZ;
|
||||
break;
|
||||
|
||||
case CY_ROOT_PATH_SRC_EXT:
|
||||
srcFreqHz = CY_CLK_EXT_FREQ_HZ;
|
||||
break;
|
||||
|
||||
#if (SRSS_ECO_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_ECO:
|
||||
srcFreqHz = CY_CLK_ECO_FREQ_HZ;
|
||||
break;
|
||||
#endif /* (SRSS_ECO_PRESENT == 1U) */
|
||||
|
||||
#if defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL) && (SRSS_ALTHF_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_ALTHF:
|
||||
srcFreqHz = cy_BleEcoClockFreqHz;
|
||||
break;
|
||||
#endif /* defined (CY_IP_MXBLESS) && (CY_IP_MXBLESS == 1UL) && (SRSS_ALTHF_PRESENT == 1U) */
|
||||
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX:
|
||||
{
|
||||
uint32_t dsi_src;
|
||||
dsi_src = _FLD2VAL(SRSS_CLK_DSI_SELECT_DSI_MUX, SRSS->CLK_DSI_SELECT[rootPath]);
|
||||
switch (dsi_src)
|
||||
{
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_HVILO:
|
||||
srcFreqHz = CY_CLK_HVILO_FREQ_HZ;
|
||||
break;
|
||||
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_WCO:
|
||||
srcFreqHz = CY_CLK_WCO_FREQ_HZ;
|
||||
break;
|
||||
|
||||
#if (SRSS_ALTLF_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_ALTLF:
|
||||
srcFreqHz = CY_CLK_ALTLF_FREQ_HZ;
|
||||
break;
|
||||
#endif /* (SRSS_ALTLF_PRESENT == 1U) */
|
||||
|
||||
#if (SRSS_PILO_PRESENT == 1U)
|
||||
case CY_ROOT_PATH_SRC_DSI_MUX_PILO:
|
||||
srcFreqHz = CY_CLK_PILO_FREQ_HZ;
|
||||
break;
|
||||
#endif /* (SRSS_PILO_PRESENT == 1U) */
|
||||
|
||||
default:
|
||||
srcFreqHz = CY_CLK_HVILO_FREQ_HZ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
srcFreqHz = CY_CLK_EXT_FREQ_HZ;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rootPath == 0UL)
|
||||
{
|
||||
/* FLL */
|
||||
bool fllLocked = ( 0UL != _FLD2VAL(SRSS_CLK_FLL_STATUS_LOCKED, SRSS->CLK_FLL_STATUS));
|
||||
bool fllOutputOutput = ( 3UL == _FLD2VAL(SRSS_CLK_FLL_CONFIG3_BYPASS_SEL, SRSS->CLK_FLL_CONFIG3));
|
||||
bool fllOutputAuto = ((0UL == _FLD2VAL(SRSS_CLK_FLL_CONFIG3_BYPASS_SEL, SRSS->CLK_FLL_CONFIG3)) ||
|
||||
(1UL == _FLD2VAL(SRSS_CLK_FLL_CONFIG3_BYPASS_SEL, SRSS->CLK_FLL_CONFIG3)));
|
||||
if ((fllOutputAuto && fllLocked) || fllOutputOutput)
|
||||
{
|
||||
uint32_t fllMult;
|
||||
uint32_t refDiv;
|
||||
uint32_t outputDiv;
|
||||
|
||||
fllMult = _FLD2VAL(SRSS_CLK_FLL_CONFIG_FLL_MULT, SRSS->CLK_FLL_CONFIG);
|
||||
refDiv = _FLD2VAL(SRSS_CLK_FLL_CONFIG2_FLL_REF_DIV, SRSS->CLK_FLL_CONFIG2);
|
||||
outputDiv = _FLD2VAL(SRSS_CLK_FLL_CONFIG_FLL_OUTPUT_DIV, SRSS->CLK_FLL_CONFIG) + 1UL;
|
||||
|
||||
pathFreqHz = ((srcFreqHz / refDiv) * fllMult) / outputDiv;
|
||||
}
|
||||
else
|
||||
{
|
||||
pathFreqHz = srcFreqHz;
|
||||
}
|
||||
}
|
||||
else if ((rootPath == 1UL) || (rootPath == 2UL))
|
||||
{
|
||||
/* PLL */
|
||||
bool pllLocked = ( 0UL != _FLD2VAL(SRSS_CLK_PLL_STATUS_LOCKED, SRSS->CLK_PLL_STATUS[rootPath - 1UL]));
|
||||
bool pllOutputOutput = ( 3UL == _FLD2VAL(SRSS_CLK_PLL_CONFIG_BYPASS_SEL, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]));
|
||||
bool pllOutputAuto = ((0UL == _FLD2VAL(SRSS_CLK_PLL_CONFIG_BYPASS_SEL, SRSS->CLK_PLL_CONFIG[rootPath - 1UL])) ||
|
||||
(1UL == _FLD2VAL(SRSS_CLK_PLL_CONFIG_BYPASS_SEL, SRSS->CLK_PLL_CONFIG[rootPath - 1UL])));
|
||||
if ((pllOutputAuto && pllLocked) || pllOutputOutput)
|
||||
{
|
||||
uint32_t feedbackDiv;
|
||||
uint32_t referenceDiv;
|
||||
uint32_t outputDiv;
|
||||
|
||||
feedbackDiv = _FLD2VAL(SRSS_CLK_PLL_CONFIG_FEEDBACK_DIV, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]);
|
||||
referenceDiv = _FLD2VAL(SRSS_CLK_PLL_CONFIG_REFERENCE_DIV, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]);
|
||||
outputDiv = _FLD2VAL(SRSS_CLK_PLL_CONFIG_OUTPUT_DIV, SRSS->CLK_PLL_CONFIG[rootPath - 1UL]);
|
||||
|
||||
pathFreqHz = ((srcFreqHz * feedbackDiv) / referenceDiv) / outputDiv;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pathFreqHz = srcFreqHz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Direct */
|
||||
pathFreqHz = srcFreqHz;
|
||||
}
|
||||
|
||||
/* Get frequency after hf_clk pre-divider */
|
||||
pathFreqHz = pathFreqHz >> _FLD2VAL(SRSS_CLK_ROOT_SELECT_ROOT_DIV, SRSS->CLK_ROOT_SELECT[0u]);
|
||||
cy_Hfclk0FreqHz = pathFreqHz;
|
||||
|
||||
/* Fast Clock Divider */
|
||||
fastClkDiv = 1u + _FLD2VAL(CPUSS_CM4_CLOCK_CTL_FAST_INT_DIV, CPUSS->CM4_CLOCK_CTL);
|
||||
|
||||
/* Peripheral Clock Divider */
|
||||
periClkDiv = 1u + _FLD2VAL(CPUSS_CM0_CLOCK_CTL_PERI_INT_DIV, CPUSS->CM0_CLOCK_CTL);
|
||||
cy_PeriClkFreqHz = pathFreqHz / periClkDiv;
|
||||
|
||||
pathFreqHz = pathFreqHz / fastClkDiv;
|
||||
SystemCoreClock = pathFreqHz;
|
||||
|
||||
/* Sets clock frequency for Delay API */
|
||||
cy_delayFreqHz = SystemCoreClock;
|
||||
cy_delayFreqMhz = (uint8_t)((cy_delayFreqHz + CY_DELAY_1M_MINUS_1_THRESHOLD) / CY_DELAY_1M_THRESHOLD);
|
||||
cy_delayFreqKhz = (cy_delayFreqHz + CY_DELAY_1K_MINUS_1_THRESHOLD) / CY_DELAY_1K_THRESHOLD;
|
||||
cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD * cy_delayFreqKhz;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SystemInitFpuEnable
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Enables the FPU if it is used. The function is called from the startup file.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SystemInitFpuEnable(void)
|
||||
{
|
||||
#if defined (__FPU_USED) && (__FPU_USED == 1U)
|
||||
uint32_t interruptState;
|
||||
interruptState = Cy_SysLib_EnterCriticalSection();
|
||||
SCB->CPACR |= SCB_CPACR_CP10_CP11_ENABLE;
|
||||
__DSB();
|
||||
__ISB();
|
||||
Cy_SysLib_ExitCriticalSection(interruptState);
|
||||
#endif /* (__FPU_USED) && (__FPU_USED == 1U) */
|
||||
}
|
||||
|
||||
|
||||
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_SysIpcPipeIsrCm4
|
||||
****************************************************************************//**
|
||||
*
|
||||
* This is the interrupt service routine for the system pipe.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_SysIpcPipeIsrCm4(void)
|
||||
{
|
||||
Cy_IPC_Pipe_ExecuteCallback(CY_IPC_EP_CYPIPE_CM4_ADDR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_MemorySymbols
|
||||
****************************************************************************//**
|
||||
*
|
||||
* The intention of the function is to declare boundaries of the memories for the
|
||||
* MDK compilers. For the rest of the supported compilers, this is done using
|
||||
* linker configuration files. The following symbols used by the cymcuelftool.
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
|
||||
__asm void Cy_MemorySymbols(void)
|
||||
{
|
||||
/* Flash */
|
||||
EXPORT __cy_memory_0_start
|
||||
EXPORT __cy_memory_0_length
|
||||
EXPORT __cy_memory_0_row_size
|
||||
|
||||
/* Working Flash */
|
||||
EXPORT __cy_memory_1_start
|
||||
EXPORT __cy_memory_1_length
|
||||
EXPORT __cy_memory_1_row_size
|
||||
|
||||
/* Supervisory Flash */
|
||||
EXPORT __cy_memory_2_start
|
||||
EXPORT __cy_memory_2_length
|
||||
EXPORT __cy_memory_2_row_size
|
||||
|
||||
/* XIP */
|
||||
EXPORT __cy_memory_3_start
|
||||
EXPORT __cy_memory_3_length
|
||||
EXPORT __cy_memory_3_row_size
|
||||
|
||||
/* eFuse */
|
||||
EXPORT __cy_memory_4_start
|
||||
EXPORT __cy_memory_4_length
|
||||
EXPORT __cy_memory_4_row_size
|
||||
|
||||
/* Flash */
|
||||
__cy_memory_0_start EQU __cpp(CY_FLASH_BASE)
|
||||
__cy_memory_0_length EQU __cpp(CY_FLASH_SIZE)
|
||||
__cy_memory_0_row_size EQU 0x200
|
||||
|
||||
/* Flash region for EEPROM emulation */
|
||||
__cy_memory_1_start EQU __cpp(CY_EM_EEPROM_BASE)
|
||||
__cy_memory_1_length EQU __cpp(CY_EM_EEPROM_SIZE)
|
||||
__cy_memory_1_row_size EQU 0x200
|
||||
|
||||
/* Supervisory Flash */
|
||||
__cy_memory_2_start EQU __cpp(CY_SFLASH_BASE)
|
||||
__cy_memory_2_length EQU __cpp(CY_SFLASH_SIZE)
|
||||
__cy_memory_2_row_size EQU 0x200
|
||||
|
||||
/* XIP */
|
||||
__cy_memory_3_start EQU __cpp(CY_XIP_BASE)
|
||||
__cy_memory_3_length EQU __cpp(CY_XIP_SIZE)
|
||||
__cy_memory_3_row_size EQU 0x200
|
||||
|
||||
/* eFuse */
|
||||
__cy_memory_4_start EQU __cpp(0x90700000)
|
||||
__cy_memory_4_length EQU __cpp(0x100000)
|
||||
__cy_memory_4_row_size EQU __cpp(1)
|
||||
}
|
||||
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,670 @@
|
|||
/***************************************************************************//**
|
||||
* \file system_psoc6.h
|
||||
* \version 2.40
|
||||
*
|
||||
* \brief Device system header file.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SYSTEM_PSOC6_H_
|
||||
#define _SYSTEM_PSOC6_H_
|
||||
|
||||
/**
|
||||
* \addtogroup group_system_config
|
||||
* \{
|
||||
* Provides device startup, system configuration, and linker script files.
|
||||
* The system startup provides the followings features:
|
||||
* - See \ref group_system_config_device_initialization for the:
|
||||
* * \ref group_system_config_dual_core_device_initialization
|
||||
* * \ref group_system_config_single_core_device_initialization
|
||||
* - \ref group_system_config_device_memory_definition
|
||||
* - \ref group_system_config_heap_stack_config
|
||||
* - \ref group_system_config_merge_apps
|
||||
* - \ref group_system_config_default_handlers
|
||||
* - \ref group_system_config_device_vector_table
|
||||
* - \ref group_system_config_cm4_functions
|
||||
*
|
||||
* \section group_system_config_configuration Configuration Considerations
|
||||
*
|
||||
* \subsection group_system_config_device_memory_definition Device Memory Definition
|
||||
* The flash and RAM allocation for each CPU is defined by the linker scripts.
|
||||
* For dual-core devices, the physical flash and RAM memory is shared between the CPU cores.
|
||||
* 2 KB of RAM (allocated at the end of RAM) are reserved for system use.
|
||||
* For Single-Core devices the system reserves additional 80 bytes of RAM.
|
||||
* Using the reserved memory area for other purposes will lead to unexpected behavior.
|
||||
*
|
||||
* \note The linker files provided with the PDL are generic and handle all common
|
||||
* use cases. Your project may not use every section defined in the linker files.
|
||||
* In that case you may see warnings during the build process. To eliminate build
|
||||
* warnings in your project, you can simply comment out or remove the relevant
|
||||
* code in the linker file.
|
||||
*
|
||||
* <b>ARM GCC</b>\n
|
||||
* The flash and RAM sections for the CPU are defined in the linker files:
|
||||
* 'xx_yy.ld', where 'xx' is the device group, and 'yy' is the target CPU; for example,
|
||||
* 'cy8c6xx7_cm0plus.ld' and 'cy8c6xx7_cm4_dual.ld'.
|
||||
* \note If the start of the Cortex-M4 application image is changed, the value
|
||||
* of the of the \ref CY_CORTEX_M4_APPL_ADDR should also be changed. The
|
||||
* \ref CY_CORTEX_M4_APPL_ADDR macro should be used as the parameter for the
|
||||
* Cy_SysEnableCM4() function call.
|
||||
*
|
||||
* Change the flash and RAM sizes by editing the macros value in the
|
||||
* linker files for both CPUs:
|
||||
* - 'xx_cm0plus.ld', where 'xx' is the device group:
|
||||
* \code
|
||||
* flash (rx) : ORIGIN = 0x10000000, LENGTH = 0x00080000
|
||||
* ram (rwx) : ORIGIN = 0x08000000, LENGTH = 0x00024000
|
||||
* \endcode
|
||||
* - 'xx_cm4_dual.ld', where 'xx' is the device group:
|
||||
* \code
|
||||
* flash (rx) : ORIGIN = 0x10080000, LENGTH = 0x00080000
|
||||
* ram (rwx) : ORIGIN = 0x08024000, LENGTH = 0x00023800
|
||||
* \endcode
|
||||
*
|
||||
* Change the value of the \ref CY_CORTEX_M4_APPL_ADDR macro to the rom ORIGIN's
|
||||
* value in the 'xx_cm4_dual.ld' file, where 'xx' is the device group. Do this
|
||||
* by either:
|
||||
* - Passing the following commands to the compiler:\n
|
||||
* \code -D CY_CORTEX_M4_APPL_ADDR=0x10080000 \endcode
|
||||
* - Editing the \ref CY_CORTEX_M4_APPL_ADDR value in the 'system_xx.h', where 'xx' is device family:\n
|
||||
* \code #define CY_CORTEX_M4_APPL_ADDR (0x10080000u) \endcode
|
||||
*
|
||||
* <b>ARM MDK</b>\n
|
||||
* The flash and RAM sections for the CPU are defined in the linker files:
|
||||
* 'xx_yy.scat', where 'xx' is the device group, and 'yy' is the target CPU; for example,
|
||||
* 'cy8c6xx7_cm0plus.scat' and 'cy8c6xx7_cm4_dual.scat'.
|
||||
* \note If the start of the Cortex-M4 application image is changed, the value
|
||||
* of the of the \ref CY_CORTEX_M4_APPL_ADDR should also be changed. The
|
||||
* \ref CY_CORTEX_M4_APPL_ADDR macro should be used as the parameter for the \ref
|
||||
* Cy_SysEnableCM4() function call.
|
||||
*
|
||||
* \note The linker files provided with the PDL are generic and handle all common
|
||||
* use cases. Your project may not use every section defined in the linker files.
|
||||
* In that case you may see the warnings during the build process:
|
||||
* L6314W (no section matches pattern) and/or L6329W
|
||||
* (pattern only matches removed unused sections). In your project, you can
|
||||
* suppress the warning by passing the "--diag_suppress=L6314W,L6329W" option to
|
||||
* the linker. You can also comment out or remove the relevant code in the linker
|
||||
* file.
|
||||
*
|
||||
* Change the flash and RAM sizes by editing the macros value in the
|
||||
* linker files for both CPUs:
|
||||
* - 'xx_cm0plus.scat', where 'xx' is the device group:
|
||||
* \code
|
||||
* #define FLASH_START 0x10000000
|
||||
* #define FLASH_SIZE 0x00080000
|
||||
* #define RAM_START 0x08000000
|
||||
* #define RAM_SIZE 0x00024000
|
||||
* \endcode
|
||||
* - 'xx_cm4_dual.scat', where 'xx' is the device group:
|
||||
* \code
|
||||
* #define FLASH_START 0x10080000
|
||||
* #define FLASH_SIZE 0x00080000
|
||||
* #define RAM_START 0x08024000
|
||||
* #define RAM_SIZE 0x00023800
|
||||
* \endcode
|
||||
*
|
||||
* Change the value of the \ref CY_CORTEX_M4_APPL_ADDR macro to the FLASH_START
|
||||
* value in the 'xx_cm4_dual.scat' file,
|
||||
* where 'xx' is the device group. Do this by either:
|
||||
* - Passing the following commands to the compiler:\n
|
||||
* \code -D CY_CORTEX_M4_APPL_ADDR=0x10080000 \endcode
|
||||
* - Editing the \ref CY_CORTEX_M4_APPL_ADDR value in the 'system_xx.h', where
|
||||
* 'xx' is device family:\n
|
||||
* \code #define CY_CORTEX_M4_APPL_ADDR (0x10080000u) \endcode
|
||||
*
|
||||
* <b>IAR</b>\n
|
||||
* The flash and RAM sections for the CPU are defined in the linker files:
|
||||
* 'xx_yy.icf', where 'xx' is the device group, and 'yy' is the target CPU; for example,
|
||||
* 'cy8c6xx7_cm0plus.icf' and 'cy8c6xx7_cm4_dual.icf'.
|
||||
* \note If the start of the Cortex-M4 application image is changed, the value
|
||||
* of the of the \ref CY_CORTEX_M4_APPL_ADDR should also be changed. The
|
||||
* \ref CY_CORTEX_M4_APPL_ADDR macro should be used as the parameter for the \ref
|
||||
* Cy_SysEnableCM4() function call.
|
||||
*
|
||||
* Change the flash and RAM sizes by editing the macros value in the
|
||||
* linker files for both CPUs:
|
||||
* - 'xx_cm0plus.icf', where 'xx' is the device group:
|
||||
* \code
|
||||
* define symbol __ICFEDIT_region_IROM1_start__ = 0x10000000;
|
||||
* define symbol __ICFEDIT_region_IROM1_end__ = 0x10080000;
|
||||
* define symbol __ICFEDIT_region_IRAM1_start__ = 0x08000000;
|
||||
* define symbol __ICFEDIT_region_IRAM1_end__ = 0x08024000;
|
||||
* \endcode
|
||||
* - 'xx_cm4_dual.icf', where 'xx' is the device group:
|
||||
* \code
|
||||
* define symbol __ICFEDIT_region_IROM1_start__ = 0x10080000;
|
||||
* define symbol __ICFEDIT_region_IROM1_end__ = 0x10100000;
|
||||
* define symbol __ICFEDIT_region_IRAM1_start__ = 0x08024000;
|
||||
* define symbol __ICFEDIT_region_IRAM1_end__ = 0x08047800;
|
||||
* \endcode
|
||||
*
|
||||
* Change the value of the \ref CY_CORTEX_M4_APPL_ADDR macro to the
|
||||
* __ICFEDIT_region_IROM1_start__ value in the 'xx_cm4_dual.icf' file, where 'xx'
|
||||
* is the device group. Do this by either:
|
||||
* - Passing the following commands to the compiler:\n
|
||||
* \code -D CY_CORTEX_M4_APPL_ADDR=0x10080000 \endcode
|
||||
* - Editing the \ref CY_CORTEX_M4_APPL_ADDR value in the 'system_xx.h', where
|
||||
* 'xx' is device family:\n
|
||||
* \code #define CY_CORTEX_M4_APPL_ADDR (0x10080000u) \endcode
|
||||
*
|
||||
* \subsection group_system_config_device_initialization Device Initialization
|
||||
* After a power-on-reset (POR), the boot process is handled by the boot code
|
||||
* from the on-chip ROM that is always executed by the Cortex-M0+ core. The boot
|
||||
* code passes the control to the Cortex-M0+ startup code located in flash.
|
||||
*
|
||||
* \subsubsection group_system_config_dual_core_device_initialization Dual-Core Devices
|
||||
* The Cortex-M0+ startup code performs the device initialization by a call to
|
||||
* SystemInit() and then calls the main() function. The Cortex-M4 core is disabled
|
||||
* by default. Enable the core using the \ref Cy_SysEnableCM4() function.
|
||||
* See \ref group_system_config_cm4_functions for more details.
|
||||
* \note Startup code executes SystemInit() function for the both Cortex-M0+ and Cortex-M4 cores.
|
||||
* The function has a separate implementation on each core.
|
||||
* Both function implementations unlock and disable the WDT.
|
||||
* Therefore enable the WDT after both cores have been initialized.
|
||||
*
|
||||
* \subsubsection group_system_config_single_core_device_initialization Single-Core Devices
|
||||
* The Cortex-M0+ core is not user-accessible on these devices. In this case the
|
||||
* Flash Boot handles setup of the CM0+ core and starts the Cortex-M4 core.
|
||||
*
|
||||
* \subsection group_system_config_heap_stack_config Heap and Stack Configuration
|
||||
* There are two ways to adjust heap and stack configurations:
|
||||
* -# Editing source code files
|
||||
* -# Specifying via command line
|
||||
*
|
||||
* By default, the stack size is set to 0x00001000 and the heap size is set to 0x00000400.
|
||||
*
|
||||
* \subsubsection group_system_config_heap_stack_config_gcc ARM GCC
|
||||
* - <b>Editing source code files</b>\n
|
||||
* The heap and stack sizes are defined in the assembler startup files
|
||||
* (e.g. startup_psoc6_01_cm0plus.S and startup_psoc6_01_cm4.S).
|
||||
* Change the heap and stack sizes by modifying the following lines:\n
|
||||
* \code .equ Stack_Size, 0x00001000 \endcode
|
||||
* \code .equ Heap_Size, 0x00000400 \endcode
|
||||
*
|
||||
* - <b>Specifying via command line</b>\n
|
||||
* Change the heap and stack sizes passing the following commands to the compiler:\n
|
||||
* \code -D __STACK_SIZE=0x000000400 \endcode
|
||||
* \code -D __HEAP_SIZE=0x000000100 \endcode
|
||||
*
|
||||
* \subsubsection group_system_config_heap_stack_config_mdk ARM MDK
|
||||
* - <b>Editing source code files</b>\n
|
||||
* The heap and stack sizes are defined in the assembler startup files
|
||||
* (e.g. startup_psoc6_01_cm0plus.s and startup_psoc6_01_cm4.s).
|
||||
* Change the heap and stack sizes by modifying the following lines:\n
|
||||
* \code Stack_Size EQU 0x00001000 \endcode
|
||||
* \code Heap_Size EQU 0x00000400 \endcode
|
||||
*
|
||||
* - <b>Specifying via command line</b>\n
|
||||
* Change the heap and stack sizes passing the following commands to the assembler:\n
|
||||
* \code "--predefine=___STACK_SIZE SETA 0x000000400" \endcode
|
||||
* \code "--predefine=__HEAP_SIZE SETA 0x000000100" \endcode
|
||||
*
|
||||
* \subsubsection group_system_config_heap_stack_config_iar IAR
|
||||
* - <b>Editing source code files</b>\n
|
||||
* The heap and stack sizes are defined in the linker scatter files: 'xx_yy.icf',
|
||||
* where 'xx' is the device family, and 'yy' is the target CPU; for example,
|
||||
* cy8c6xx7_cm0plus.icf and cy8c6xx7_cm4_dual.icf.
|
||||
* Change the heap and stack sizes by modifying the following lines:\n
|
||||
* \code Stack_Size EQU 0x00001000 \endcode
|
||||
* \code Heap_Size EQU 0x00000400 \endcode
|
||||
*
|
||||
* - <b>Specifying via command line</b>\n
|
||||
* Change the heap and stack sizes passing the following commands to the
|
||||
* linker (including quotation marks):\n
|
||||
* \code --define_symbol __STACK_SIZE=0x000000400 \endcode
|
||||
* \code --define_symbol __HEAP_SIZE=0x000000100 \endcode
|
||||
*
|
||||
* \subsection group_system_config_merge_apps Merging CM0+ and CM4 Executables
|
||||
* The CM0+ project and linker script build the CM0+ application image. Similarly,
|
||||
* the CM4 linker script builds the CM4 application image. Each specifies
|
||||
* locations, sizes, and contents of sections in memory. See
|
||||
* \ref group_system_config_device_memory_definition for the symbols and default
|
||||
* values.
|
||||
*
|
||||
* The cymcuelftool is invoked by a post-build command. The precise project
|
||||
* setting is IDE-specific.
|
||||
*
|
||||
* The cymcuelftool combines the two executables. The tool examines the
|
||||
* executables to ensure that memory regions either do not overlap, or contain
|
||||
* identical bytes (shared). If there are no problems, it creates a new ELF file
|
||||
* with the merged image, without changing any of the addresses or data.
|
||||
*
|
||||
* \subsection group_system_config_default_handlers Default Interrupt Handlers Definition
|
||||
* The default interrupt handler functions are defined as weak functions to a dummy
|
||||
* handler in the startup file. The naming convention for the interrupt handler names
|
||||
* is \<interrupt_name\>_IRQHandler. A default interrupt handler can be overwritten in
|
||||
* user code by defining the handler function using the same name. For example:
|
||||
* \code
|
||||
* void scb_0_interrupt_IRQHandler(void)
|
||||
*{
|
||||
* ...
|
||||
*}
|
||||
* \endcode
|
||||
*
|
||||
* \subsection group_system_config_device_vector_table Vectors Table Copy from Flash to RAM
|
||||
* This process uses memory sections defined in the linker script. The startup
|
||||
* code actually defines the contents of the vector table and performs the copy.
|
||||
* \subsubsection group_system_config_device_vector_table_gcc ARM GCC
|
||||
* The linker script file is 'xx_yy.ld', where 'xx' is the device family, and
|
||||
* 'yy' is the target CPU; for example, cy8c6xx7_cm0plus.ld and cy8c6xx7_cm4_dual.ld.
|
||||
* It defines sections and locations in memory.\n
|
||||
* Copy interrupt vectors from flash to RAM: \n
|
||||
* From: \code LONG (__Vectors) \endcode
|
||||
* To: \code LONG (__ram_vectors_start__) \endcode
|
||||
* Size: \code LONG (__Vectors_End - __Vectors) \endcode
|
||||
* The vector table address (and the vector table itself) are defined in the
|
||||
* assembler startup files (e.g. startup_psoc6_01_cm0plus.S and startup_psoc6_01_cm4.S).
|
||||
* The code in these files copies the vector table from Flash to RAM.
|
||||
* \subsubsection group_system_config_device_vector_table_mdk ARM MDK
|
||||
* The linker script file is 'xx_yy.scat', where 'xx' is the device family,
|
||||
* and 'yy' is the target CPU; for example, cy8c6xx7_cm0plus.scat and
|
||||
* cy8c6xx7_cm4_dual.scat. The linker script specifies that the vector table
|
||||
* (RESET_RAM) shall be first in the RAM section.\n
|
||||
* RESET_RAM represents the vector table. It is defined in the assembler startup
|
||||
* files (e.g. startup_psoc6_01_cm0plus.s and startup_psoc6_01_cm4.s).
|
||||
* The code in these files copies the vector table from Flash to RAM.
|
||||
*
|
||||
* \subsubsection group_system_config_device_vector_table_iar IAR
|
||||
* The linker script file is 'xx_yy.icf', where 'xx' is the device family, and
|
||||
* 'yy' is the target CPU; for example, cy8c6xx7_cm0plus.icf and cy8c6xx7_cm4_dual.icf.
|
||||
* This file defines the .intvec_ram section and its location.
|
||||
* \code place at start of IRAM1_region { readwrite section .intvec_ram}; \endcode
|
||||
* The vector table address (and the vector table itself) are defined in the
|
||||
* assembler startup files (e.g. startup_psoc6_01_cm0plus.s and startup_psoc6_01_cm4.s).
|
||||
* The code in these files copies the vector table from Flash to RAM.
|
||||
*
|
||||
* \section group_system_config_more_information More Information
|
||||
* Refer to the <a href="..\..\pdl_user_guide.pdf">PDL User Guide</a> for the
|
||||
* more details.
|
||||
*
|
||||
* \section group_system_config_MISRA MISRA Compliance
|
||||
*
|
||||
* <table class="doxtable">
|
||||
* <tr>
|
||||
* <th>MISRA Rule</th>
|
||||
* <th>Rule Class (Required/Advisory)</th>
|
||||
* <th>Rule Description</th>
|
||||
* <th>Description of Deviation(s)</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.3</td>
|
||||
* <td>R</td>
|
||||
* <td>The character sequence // shall not be used within a comment.</td>
|
||||
* <td>The comments provide a useful WEB link to the documentation.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section group_system_config_changelog Changelog
|
||||
* <table class="doxtable">
|
||||
* <tr>
|
||||
* <th>Version</th>
|
||||
* <th>Changes</th>
|
||||
* <th>Reason for Change</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.40</td>
|
||||
* <td>Updated assembler files, C files, linker scripts.</td>
|
||||
* <td>Added Arm Compiler 6 support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2">2.30</td>
|
||||
* <td>Added assembler files, linker scripts for Mbed OS.</td>
|
||||
* <td>Added Arm Mbed OS embedded operating system support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Updated linker scripts to extend the Flash and Ram memories size available for the CM4 core.</td>
|
||||
* <td>Enhanced PDL usability.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2.20</td>
|
||||
* <td>Moved the Cy_IPC_SystemSemaInit(), Cy_IPC_SystemPipeInit() functions implementation from IPC to Startup.</td>
|
||||
* <td>Changed the IPC driver configuration method from compile time to run time.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2"> 2.10</td>
|
||||
* <td>Added constructor attribute to SystemInit() function declaration for ARM MDK compiler. \n
|
||||
* Removed $Sub$$main symbol for ARM MDK compiler.
|
||||
* </td>
|
||||
* <td>uVision Debugger support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Updated description of the Startup behavior for Single-Core Devices. \n
|
||||
* Added note about WDT disabling by SystemInit() function.
|
||||
* </td>
|
||||
* <td>Documentation improvement.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="4"> 2.0</td>
|
||||
* <td>Added restoring of FLL registers to the default state in SystemInit() API for single core devices.
|
||||
* Single core device support.
|
||||
* </td>
|
||||
* <td></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Added Normal Access Restrictions, Public Key, TOC part2 and TOC part2 copy to Supervisory flash linker memory regions. \n
|
||||
* Renamed 'wflash' memory region to 'em_eeprom'.
|
||||
* </td>
|
||||
* <td>Linker scripts usability improvement.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Added Cy_IPC_SystemSemaInit(), Cy_IPC_SystemPipeInit(), Cy_Flash_Init() functions call to SystemInit() API.</td>
|
||||
* <td>Reserved system resources for internal operations.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Added clearing and releasing of IPC structure #7 (reserved for the Deep-Sleep operations) to SystemInit() API.</td>
|
||||
* <td>To avoid deadlocks in case of SW or WDT reset during Deep-Sleep entering.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>1.0</td>
|
||||
* <td>Initial version</td>
|
||||
* <td></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
*
|
||||
* \defgroup group_system_config_macro Macro
|
||||
* \{
|
||||
* \defgroup group_system_config_system_macro System
|
||||
* \defgroup group_system_config_cm4_status_macro Cortex-M4 Status
|
||||
* \defgroup group_system_config_user_settings_macro User Settings
|
||||
* \}
|
||||
* \defgroup group_system_config_functions Functions
|
||||
* \{
|
||||
* \defgroup group_system_config_system_functions System
|
||||
* \defgroup group_system_config_cm4_functions Cortex-M4 Control
|
||||
* \}
|
||||
* \defgroup group_system_config_globals Global Variables
|
||||
*
|
||||
* \}
|
||||
*/
|
||||
|
||||
/**
|
||||
* \addtogroup group_system_config_system_functions
|
||||
* \{
|
||||
* \details
|
||||
* The following system functions implement CMSIS Core functions.
|
||||
* Refer to the [CMSIS documentation]
|
||||
* (http://www.keil.com/pack/doc/CMSIS/Core/html/group__system__init__gr.html "System and Clock Configuration")
|
||||
* for more details.
|
||||
* \}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
*******************************************************************************/
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Global preprocessor symbols/macros ('define')
|
||||
*******************************************************************************/
|
||||
#if ((defined(__GNUC__) && (__ARM_ARCH == 6) && (__ARM_ARCH_6M__ == 1)) || \
|
||||
(defined (__ICCARM__) && (__CORE__ == __ARM6M__)) || \
|
||||
(defined(__ARMCC_VERSION) && (__TARGET_ARCH_THUMB == 3)))
|
||||
#define CY_SYSTEM_CPU_CM0P 1UL
|
||||
#else
|
||||
#define CY_SYSTEM_CPU_CM0P 0UL
|
||||
#endif
|
||||
|
||||
#if defined (CY_PSOC_CREATOR_USED) && (CY_PSOC_CREATOR_USED == 1U)
|
||||
#include "cyfitter.h"
|
||||
#endif /* (CY_PSOC_CREATOR_USED) && (CY_PSOC_CREATOR_USED == 1U) */
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* START OF USER SETTINGS HERE
|
||||
* ===========================
|
||||
*
|
||||
* All lines with '<<<' can be set by user.
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
/**
|
||||
* \addtogroup group_system_config_user_settings_macro
|
||||
* \{
|
||||
*/
|
||||
|
||||
#if defined (CYDEV_CLK_EXTCLK__HZ)
|
||||
#define CY_CLK_EXT_FREQ_HZ (CYDEV_CLK_EXTCLK__HZ)
|
||||
#else
|
||||
/***************************************************************************//**
|
||||
* External Clock Frequency (in Hz, [value]UL). If compiled within
|
||||
* PSoC Creator and the clock is enabled in the DWR, the value from DWR used.
|
||||
* Otherwise, edit the value below.
|
||||
* <i>(USER SETTING)</i>
|
||||
*******************************************************************************/
|
||||
#define CY_CLK_EXT_FREQ_HZ (24000000UL) /* <<< 24 MHz */
|
||||
#endif /* (CYDEV_CLK_EXTCLK__HZ) */
|
||||
|
||||
|
||||
#if defined (CYDEV_CLK_ECO__HZ)
|
||||
#define CY_CLK_ECO_FREQ_HZ (CYDEV_CLK_ECO__HZ)
|
||||
#else
|
||||
/***************************************************************************//**
|
||||
* \brief External crystal oscillator frequency (in Hz, [value]UL). If compiled
|
||||
* within PSoC Creator and the clock is enabled in the DWR, the value from DWR
|
||||
* used.
|
||||
* <i>(USER SETTING)</i>
|
||||
*******************************************************************************/
|
||||
#define CY_CLK_ECO_FREQ_HZ (24000000UL) /* <<< 24 MHz */
|
||||
#endif /* (CYDEV_CLK_ECO__HZ) */
|
||||
|
||||
|
||||
#if defined (CYDEV_CLK_ALTHF__HZ)
|
||||
#define CY_CLK_ALTHF_FREQ_HZ (CYDEV_CLK_ALTHF__HZ)
|
||||
#else
|
||||
/***************************************************************************//**
|
||||
* \brief Alternate high frequency (in Hz, [value]UL). If compiled within
|
||||
* PSoC Creator and the clock is enabled in the DWR, the value from DWR used.
|
||||
* Otherwise, edit the value below.
|
||||
* <i>(USER SETTING)</i>
|
||||
*******************************************************************************/
|
||||
#define CY_CLK_ALTHF_FREQ_HZ (32000000UL) /* <<< 32 MHz */
|
||||
#endif /* (CYDEV_CLK_ALTHF__HZ) */
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* \brief Start address of the Cortex-M4 application ([address]UL)
|
||||
* <i>(USER SETTING)</i>
|
||||
*******************************************************************************/
|
||||
#if !defined (CY_CORTEX_M4_APPL_ADDR)
|
||||
#define CY_CORTEX_M4_APPL_ADDR (CY_FLASH_BASE + 0x2000U) /* <<< 8 kB of flash is reserved for the Cortex-M0+ application */
|
||||
#endif /* (CY_CORTEX_M4_APPL_ADDR) */
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* \brief IPC Semaphores allocation ([value]UL).
|
||||
* <i>(USER SETTING)</i>
|
||||
*******************************************************************************/
|
||||
#define CY_IPC_SEMA_COUNT (128UL) /* <<< This will allow 128 (4*32) semaphores */
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* \brief IPC Pipe definitions ([value]UL).
|
||||
* <i>(USER SETTING)</i>
|
||||
*******************************************************************************/
|
||||
#define CY_IPC_MAX_ENDPOINTS (8UL) /* <<< 8 endpoints */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* END OF USER SETTINGS HERE
|
||||
* =========================
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
/** \} group_system_config_user_settings_macro */
|
||||
|
||||
|
||||
/**
|
||||
* \addtogroup group_system_config_system_macro
|
||||
* \{
|
||||
*/
|
||||
|
||||
#if (CY_SYSTEM_CPU_CM0P == 1UL) || defined(CY_DOXYGEN)
|
||||
/** The Cortex-M0+ startup driver identifier */
|
||||
#define CY_STARTUP_M0P_ID ((uint32_t)((uint32_t)((0x0EU) & 0x3FFFU) << 18U))
|
||||
#endif /* (CY_SYSTEM_CPU_CM0P == 1UL) */
|
||||
|
||||
#if (CY_SYSTEM_CPU_CM0P != 1UL) || defined(CY_DOXYGEN)
|
||||
/** The Cortex-M4 startup driver identifier */
|
||||
#define CY_STARTUP_M4_ID ((uint32_t)((uint32_t)((0x0FU) & 0x3FFFU) << 18U))
|
||||
#endif /* (CY_SYSTEM_CPU_CM0P != 1UL) */
|
||||
|
||||
/** \} group_system_config_system_macro */
|
||||
|
||||
|
||||
/**
|
||||
* \addtogroup group_system_config_system_functions
|
||||
* \{
|
||||
*/
|
||||
extern void SystemInit(void);
|
||||
|
||||
extern void SystemCoreClockUpdate(void);
|
||||
/** \} group_system_config_system_functions */
|
||||
|
||||
|
||||
/**
|
||||
* \addtogroup group_system_config_cm4_functions
|
||||
* \{
|
||||
*/
|
||||
extern uint32_t Cy_SysGetCM4Status(void);
|
||||
extern void Cy_SysEnableCM4(uint32_t vectorTableOffset);
|
||||
extern void Cy_SysDisableCM4(void);
|
||||
extern void Cy_SysRetainCM4(void);
|
||||
extern void Cy_SysResetCM4(void);
|
||||
/** \} group_system_config_cm4_functions */
|
||||
|
||||
|
||||
/** \cond */
|
||||
extern void Default_Handler (void);
|
||||
|
||||
void Cy_SysIpcPipeIsrCm0(void);
|
||||
void Cy_SysIpcPipeIsrCm4(void);
|
||||
|
||||
extern void Cy_SystemInit(void);
|
||||
extern void Cy_SystemInitFpuEnable(void);
|
||||
|
||||
extern uint32_t cy_delayFreqHz;
|
||||
extern uint32_t cy_delayFreqKhz;
|
||||
extern uint8_t cy_delayFreqMhz;
|
||||
extern uint32_t cy_delay32kMs;
|
||||
/** \endcond */
|
||||
|
||||
|
||||
#if (CY_SYSTEM_CPU_CM0P == 1UL) || defined(CY_DOXYGEN)
|
||||
/**
|
||||
* \addtogroup group_system_config_cm4_status_macro
|
||||
* \{
|
||||
*/
|
||||
#define CY_SYS_CM4_STATUS_ENABLED (3U) /**< The Cortex-M4 core is enabled: power on, clock on, no isolate, no reset and no retain. */
|
||||
#define CY_SYS_CM4_STATUS_DISABLED (0U) /**< The Cortex-M4 core is disabled: power off, clock off, isolate, reset and no retain. */
|
||||
#define CY_SYS_CM4_STATUS_RETAINED (2U) /**< The Cortex-M4 core is retained. power off, clock off, isolate, no reset and retain. */
|
||||
#define CY_SYS_CM4_STATUS_RESET (1U) /**< The Cortex-M4 core is in the Reset mode: clock off, no isolated, no retain and reset. */
|
||||
/** \} group_system_config_cm4_status_macro */
|
||||
|
||||
#endif /* (CY_SYSTEM_CPU_CM0P == 1UL) */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* IPC Configuration
|
||||
* =========================
|
||||
*******************************************************************************/
|
||||
/* IPC CY_PIPE default configuration */
|
||||
#define CY_SYS_CYPIPE_CLIENT_CNT (8UL)
|
||||
|
||||
#define CY_SYS_INTR_CYPIPE_MUX_EP0 (1UL) /* IPC CYPRESS PIPE */
|
||||
#define CY_SYS_INTR_CYPIPE_PRIOR_EP0 (1UL) /* Notifier Priority */
|
||||
#define CY_SYS_INTR_CYPIPE_PRIOR_EP1 (1UL) /* Notifier Priority */
|
||||
|
||||
#define CY_SYS_CYPIPE_CHAN_MASK_EP0 (0x0001UL << CY_IPC_CHAN_CYPIPE_EP0)
|
||||
#define CY_SYS_CYPIPE_CHAN_MASK_EP1 (0x0001UL << CY_IPC_CHAN_CYPIPE_EP1)
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/*
|
||||
* The System pipe configuration defines the IPC channel number, interrupt
|
||||
* number, and the pipe interrupt mask for the endpoint.
|
||||
*
|
||||
* The format of the endPoint configuration
|
||||
* Bits[31:16] Interrupt Mask
|
||||
* Bits[15:8 ] IPC interrupt
|
||||
* Bits[ 7:0 ] IPC channel
|
||||
*/
|
||||
|
||||
/* System Pipe addresses */
|
||||
/* CyPipe defines */
|
||||
|
||||
#define CY_SYS_CYPIPE_INTR_MASK ( CY_SYS_CYPIPE_CHAN_MASK_EP0 | CY_SYS_CYPIPE_CHAN_MASK_EP1 )
|
||||
|
||||
#define CY_SYS_CYPIPE_CONFIG_EP0 ( (CY_SYS_CYPIPE_INTR_MASK << CY_IPC_PIPE_CFG_IMASK_Pos) \
|
||||
| (CY_IPC_INTR_CYPIPE_EP0 << CY_IPC_PIPE_CFG_INTR_Pos) \
|
||||
| CY_IPC_CHAN_CYPIPE_EP0)
|
||||
#define CY_SYS_CYPIPE_CONFIG_EP1 ( (CY_SYS_CYPIPE_INTR_MASK << CY_IPC_PIPE_CFG_IMASK_Pos) \
|
||||
| (CY_IPC_INTR_CYPIPE_EP1 << CY_IPC_PIPE_CFG_INTR_Pos) \
|
||||
| CY_IPC_CHAN_CYPIPE_EP1)
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
/** \addtogroup group_system_config_globals
|
||||
* \{
|
||||
*/
|
||||
|
||||
extern uint32_t SystemCoreClock;
|
||||
extern uint32_t cy_BleEcoClockFreqHz;
|
||||
extern uint32_t cy_Hfclk0FreqHz;
|
||||
extern uint32_t cy_PeriClkFreqHz;
|
||||
|
||||
/** \} group_system_config_globals */
|
||||
|
||||
|
||||
|
||||
/** \cond INTERNAL */
|
||||
/*******************************************************************************
|
||||
* Backward compatibility macro. The following code is DEPRECATED and must
|
||||
* not be used in new projects
|
||||
*******************************************************************************/
|
||||
|
||||
/* BWC defines for functions related to enter/exit critical section */
|
||||
#define Cy_SaveIRQ Cy_SysLib_EnterCriticalSection
|
||||
#define Cy_RestoreIRQ Cy_SysLib_ExitCriticalSection
|
||||
#define CY_SYS_INTR_CYPIPE_EP0 (CY_IPC_INTR_CYPIPE_EP0)
|
||||
#define CY_SYS_INTR_CYPIPE_EP1 (CY_IPC_INTR_CYPIPE_EP1)
|
||||
|
||||
/** \endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SYSTEM_PSOC6_H_ */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -22,6 +22,10 @@
|
|||
|
||||
#if DEVICE_FLASH
|
||||
|
||||
/** Flash effective page size */
|
||||
#define CY_FLASH_EFFECTIVE_PAGE_SIZE 32
|
||||
|
||||
|
||||
int32_t flash_init(flash_t *obj)
|
||||
{
|
||||
(void)(obj);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_flash.h
|
||||
* \version 3.20
|
||||
* \version 3.30
|
||||
*
|
||||
* Provides the API declarations of the Flash driver.
|
||||
*
|
||||
|
@ -104,7 +104,7 @@
|
|||
* Crypto).
|
||||
* -# If you do not use the default startup, perform the following steps
|
||||
* before any flash write/erase operations:
|
||||
* \snippet flash\3.20\snippet\main.c Flash Initialization
|
||||
* \snippet flash/snippet/main.c Flash Initialization
|
||||
*
|
||||
* \subsection group_flash_config_rww Partially Blocking:
|
||||
* This method has a much shorter time window during which Flash accesses are not
|
||||
|
@ -112,7 +112,7 @@
|
|||
* Flash Write duration, for both cores. Blocking duration depends upon the API
|
||||
* sequence used.
|
||||
*
|
||||
* For API sequence Cy_Flash_StartErase() + Cy_Flash_StartProgram() there are
|
||||
* For API sequence Cy_Flash_StartEraseRow() + Cy_Flash_StartProgram() there are
|
||||
* four block-out regions during which the read is blocked using the software
|
||||
* driver (PDL). See <b>Figure 1</b>.
|
||||
*
|
||||
|
@ -216,7 +216,7 @@
|
|||
* (DMA and Crypto).
|
||||
* -# If you do not use the default startup, perform the following steps
|
||||
* before any flash write/erase operations:
|
||||
* \snippet flash\3.20\snippet\main.c Flash Initialization
|
||||
* \snippet flash/snippet/main.c Flash Initialization
|
||||
*
|
||||
* \subsection group_flash_config_emeeprom EEPROM section use:
|
||||
* If you plan to use "cy_em_eeprom" section for different purposes for both of
|
||||
|
@ -255,6 +255,21 @@
|
|||
* <table class="doxtable">
|
||||
* <tr><th>Version</th><th style="width: 52%;">Changes</th><th>Reason for Change</th></tr>
|
||||
* <tr>
|
||||
* <td rowspan="3">3.30</td>
|
||||
* <td>Moved ipcWaitMessageStc structure to the RAM section called ".cy_sharedmem".</td>
|
||||
* <td>Support Secure Boot devices.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Renamed Function Cy_Flash_StartErase() to Cy_Flash_StartEraseRow().</td>
|
||||
* <td>The driver improvements based on the usability feedback.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Added new API functions \ref Cy_Flash_EraseSector,
|
||||
* \ref Cy_Flash_StartEraseSector, \ref Cy_Flash_EraseSubsector,
|
||||
* \ref Cy_Flash_StartEraseSubsector </td>
|
||||
* <td>The driver improvements based on the usability feedback.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="3">3.20</td>
|
||||
* <td>Flattened the organization of the driver source code into the single source directory and the single include directory.</td>
|
||||
* <td>Driver library directory-structure simplification.</td>
|
||||
|
@ -359,7 +374,7 @@ extern "C" {
|
|||
#define CY_FLASH_DRV_VERSION_MAJOR 3
|
||||
|
||||
/** Driver minor version */
|
||||
#define CY_FLASH_DRV_VERSION_MINOR 20
|
||||
#define CY_FLASH_DRV_VERSION_MINOR 30
|
||||
|
||||
#define CY_FLASH_ID (CY_PDL_DRV_ID(0x14UL)) /**< FLASH PDL ID */
|
||||
|
||||
|
@ -377,8 +392,6 @@ extern "C" {
|
|||
|
||||
/** Flash row size */
|
||||
#define CY_FLASH_SIZEOF_ROW (CPUSS_FLASHC_PA_SIZE * 4u)
|
||||
/** Flash effective page size */
|
||||
#define CY_FLASH_EFFECTIVE_PAGE_SIZE 32
|
||||
/** Long words flash row size */
|
||||
#define CY_FLASH_SIZEOF_ROW_LONG_UNITS (CY_FLASH_SIZEOF_ROW / sizeof(uint32_t))
|
||||
|
||||
|
@ -430,11 +443,15 @@ typedef enum cy_en_flashdrv_status
|
|||
*/
|
||||
void Cy_Flash_Init(void);
|
||||
cy_en_flashdrv_status_t Cy_Flash_EraseRow(uint32_t rowAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartEraseRow(uint32_t rowAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_EraseSector(uint32_t sectorAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartEraseSector(uint32_t sectorAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_EraseSubsector(uint32_t subSectorAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartEraseSubsector(uint32_t subSectorAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_ProgramRow(uint32_t rowAddr, const uint32_t* data);
|
||||
cy_en_flashdrv_status_t Cy_Flash_WriteRow(uint32_t rowAddr, const uint32_t* data);
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartWrite(uint32_t rowAddr, const uint32_t* data);
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartProgram(uint32_t rowAddr, const uint32_t* data);
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartErase(uint32_t rowAddr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_IsOperationComplete(void);
|
||||
cy_en_flashdrv_status_t Cy_Flash_RowChecksum(uint32_t rowAddr, uint32_t* checksumPtr);
|
||||
cy_en_flashdrv_status_t Cy_Flash_CalculateHash(const uint32_t* data, uint32_t numberOfBytes, uint32_t* hashPtr);
|
||||
|
@ -451,11 +468,15 @@ uint32_t Cy_Flash_GetExternalStatus(void);
|
|||
void Cy_Flash_ResumeIrqHandler(void);
|
||||
#endif
|
||||
|
||||
/* Macros to backward compatibility */
|
||||
/*******************************************************************************
|
||||
Backward compatibility macro. The following code is DEPRECATED and must
|
||||
not be used in new projects
|
||||
*******************************************************************************/
|
||||
#define Cy_Flash_IsWriteComplete(...) Cy_Flash_IsOperationComplete()
|
||||
#define Cy_Flash_IsProgramComplete(...) Cy_Flash_IsOperationComplete()
|
||||
#define Cy_Flash_IsEraseComplete(...) Cy_Flash_IsOperationComplete()
|
||||
#define CY_FLASH_NUMBER_ROWS (CY_FLASH_SIZE / CY_FLASH_SIZEOF_ROW)
|
||||
#define Cy_Flash_StartErase Cy_Flash_StartEraseRow
|
||||
|
||||
/** \endcond */
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_ipc_drv.h
|
||||
* \version 1.30
|
||||
* \version 1.40
|
||||
*
|
||||
* Provides an API declaration of the IPC driver.
|
||||
*
|
||||
|
@ -81,8 +81,8 @@
|
|||
* conduit to transfer messages or data to and from multiple processes or CPUs.
|
||||
*
|
||||
* A pipe has two endpoints, one on each core. Each endpoint contains a dedicated
|
||||
* IPC channel and an interrupt. IPC channels 0-7 and IPC interrupts 0-7 are
|
||||
* reserved for system use.
|
||||
* IPC channel and an interrupt. IPC channels 0-7(8 for the CYB064XX devices)
|
||||
* and IPC interrupts 0-7 are reserved for system use.
|
||||
*
|
||||
* The pipe also contains the number of clients it supports, and for each client
|
||||
* a callback function. So the pipe can service a number of clients, each with a
|
||||
|
@ -251,6 +251,11 @@
|
|||
* <table class="doxtable">
|
||||
* <tr><th>Version</th><th>Changes</th><th>Reason for Change</th></tr>
|
||||
* <tr>
|
||||
* <td rowspan="1">1.40</td>
|
||||
* <td>Moved cy_semaData structure to the RAM section called ".cy_sharedmem".</td>
|
||||
* <td>Support Secure Boot devices.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="3">1.30</td>
|
||||
* <td>Flattened the organization of the driver source code into the single source directory and the single include directory.</td>
|
||||
* <td>Driver library directory-structure simplification.</td>
|
||||
|
@ -338,7 +343,7 @@
|
|||
#define CY_IPC_DRV_VERSION_MAJOR 1
|
||||
|
||||
/** Driver minor version */
|
||||
#define CY_IPC_DRV_VERSION_MINOR 30
|
||||
#define CY_IPC_DRV_VERSION_MINOR 40
|
||||
|
||||
/** Defines a value to indicate that no notification events are needed */
|
||||
#define CY_IPC_NO_NOTIFICATION (uint32_t)(0x00000000ul)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_ipc_pipe.h
|
||||
* \version 1.30
|
||||
* \version 1.40
|
||||
*
|
||||
* Description:
|
||||
* IPC Pipe Driver - This header file contains all the function prototypes,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_ipc_sema.h
|
||||
* \version 1.30
|
||||
* \version 1.40
|
||||
*
|
||||
* \brief
|
||||
* Header file for IPC SEM functions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_syslib.h
|
||||
* \version 2.20
|
||||
* \version 2.30
|
||||
*
|
||||
* Provides an API declaration of the SysLib driver.
|
||||
*
|
||||
|
@ -159,6 +159,19 @@
|
|||
* <table class="doxtable">
|
||||
* <tr><th>Version</th><th>Changes</th><th>Reason for Change</th></tr>
|
||||
* <tr>
|
||||
* <td rowspan="3">2.30</td>
|
||||
* <td>Updated implementation of the Cy_SysLib_AsmInfiniteLoop() function to be compatible with ARMC6.</td>
|
||||
* <td>Provided support for the ARM Compiler 6.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Minor documentation edits.</td>
|
||||
* <td>Documentation update and clarification.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Added new macroses CY_RAMFUNC_BEGIN and CY_RAMFUNC_END for convenient placement function in RAM for all supported compilers.</td>
|
||||
* <td>Improve user experience.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td rowspan="2">2.20</td>
|
||||
* <td>Updated implementation of the \ref Cy_SysLib_AssertFailed() function to be available in Release and Debug modes.</td>
|
||||
* <td>Provided support for the PDL static library in Release mode.</td>
|
||||
|
@ -440,7 +453,7 @@ typedef enum
|
|||
#define CY_SYSLIB_DRV_VERSION_MAJOR 2
|
||||
|
||||
/** The driver minor version */
|
||||
#define CY_SYSLIB_DRV_VERSION_MINOR 20
|
||||
#define CY_SYSLIB_DRV_VERSION_MINOR 30
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -477,19 +490,29 @@ typedef enum
|
|||
* attributes at the first place of declaration/definition.
|
||||
* For example: CY_NOINIT uint32_t noinitVar;
|
||||
*/
|
||||
#if (__ARMCC_VERSION >= 6010050)
|
||||
#define CY_NOINIT __attribute__ ((section(".noinit")))
|
||||
#else
|
||||
#define CY_NOINIT __attribute__ ((section(".noinit"), zero_init))
|
||||
#endif /* (__ARMCC_VERSION >= 6010050) */
|
||||
#define CY_SECTION(name) __attribute__ ((section(name)))
|
||||
#define CY_UNUSED __attribute__ ((unused))
|
||||
#define CY_NOINLINE __attribute__ ((noinline))
|
||||
/* Specifies the minimum alignment (in bytes) for variables of the specified type. */
|
||||
#define CY_ALIGN(align) __ALIGNED(align)
|
||||
#define CY_RAMFUNC_BEGIN __attribute__ ((section(".cy_ramfunc")))
|
||||
#define CY_RAMFUNC_END
|
||||
#elif defined (__GNUC__)
|
||||
#if defined (__clang__)
|
||||
#define CY_NOINIT __attribute__ ((section("__DATA, __noinit")))
|
||||
#define CY_SECTION(name) __attribute__ ((section("__DATA, "name)))
|
||||
#define CY_RAMFUNC_BEGIN __attribute__ ((section("__DATA, .cy_ramfunc")))
|
||||
#define CY_RAMFUNC_END
|
||||
#else
|
||||
#define CY_NOINIT __attribute__ ((section(".noinit")))
|
||||
#define CY_SECTION(name) __attribute__ ((section(name)))
|
||||
#define CY_RAMFUNC_BEGIN __attribute__ ((section(".cy_ramfunc")))
|
||||
#define CY_RAMFUNC_END
|
||||
#endif
|
||||
|
||||
#define CY_UNUSED __attribute__ ((unused))
|
||||
|
@ -501,6 +524,8 @@ typedef enum
|
|||
#define CY_SECTION(name) CY_PRAGMA(location = name)
|
||||
#define CY_UNUSED
|
||||
#define CY_NOINLINE CY_PRAGMA(optimize = no_inline)
|
||||
#define CY_RAMFUNC_BEGIN CY_PRAGMA(diag_suppress = Ta023) __ramfunc CY_PRAGMA(location = ".cy_ramfunc")
|
||||
#define CY_RAMFUNC_END CY_PRAGMA(diag_default = Ta023)
|
||||
#if (__VER__ < 8010001)
|
||||
#define CY_ALIGN(align) CY_PRAGMA(data_alignment = align)
|
||||
#else
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;-------------------------------------------------------------------------------
|
||||
; \file cy_syslib_mdk.s
|
||||
; \version 2.20
|
||||
; \version 2.30
|
||||
;
|
||||
; \brief Assembly routines for ARMCC.
|
||||
;
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_flash.c
|
||||
* \version 3.20
|
||||
* \version 3.30
|
||||
*
|
||||
* \brief
|
||||
* Provides the public functions for the API for the PSoC 6 Flash Driver.
|
||||
|
@ -72,6 +72,10 @@ typedef struct
|
|||
#define CY_FLASH_OPCODE_PROGRAM_ROW ((0x06UL) << 24UL)
|
||||
/** SROM API opcode for row erase operation */
|
||||
#define CY_FLASH_OPCODE_ERASE_ROW ((0x1CUL) << 24UL)
|
||||
/** SROM API opcode for sub sector erase operation */
|
||||
#define CY_FLASH_OPCODE_ERASE_SUB_SECTOR ((0x1DUL) << 24UL)
|
||||
/** SROM API opcode for sector erase operation */
|
||||
#define CY_FLASH_OPCODE_ERASE_SECTOR ((0x14UL) << 24UL)
|
||||
/** SROM API opcode for flash checksum operation */
|
||||
#define CY_FLASH_OPCODE_CHECKSUM ((0x0BUL) << 24UL)
|
||||
/** SROM API opcode for flash hash operation */
|
||||
|
@ -146,9 +150,9 @@ typedef cy_en_flashdrv_status_t (*Cy_Flash_Proxy)(cy_stc_flash_context_t *contex
|
|||
#define CY_FLASH_START_PROGRAM_DELAY_TICKS (6000UL)
|
||||
/* Delay time for StartProgram function in us */
|
||||
#define CY_FLASH_START_PROGRAM_DELAY_TIME (900UL + CY_FLASH_DELAY_CORRECTIVE(CY_FLASH_START_PROGRAM_DELAY_TICKS))
|
||||
/* Number of the CM0P ticks for StartErase function delay corrective time */
|
||||
/* Number of the CM0P ticks for StartErase functions delay corrective time */
|
||||
#define CY_FLASH_START_ERASE_DELAY_TICKS (9500UL)
|
||||
/* Delay time for StartErase function in us */
|
||||
/* Delay time for StartErase functions in us */
|
||||
#define CY_FLASH_START_ERASE_DELAY_TIME (2200UL + CY_FLASH_DELAY_CORRECTIVE(CY_FLASH_START_ERASE_DELAY_TICKS))
|
||||
/* Number of the CM0P ticks for StartWrite function delay corrective time */
|
||||
#define CY_FLASH_START_WRITE_DELAY_TICKS (19000UL)
|
||||
|
@ -228,23 +232,23 @@ static volatile cy_stc_flash_context_t flashContext;
|
|||
{
|
||||
ipcWaitMessage->clientID = CY_FLASH_IPC_CLIENT_ID;
|
||||
ipcWaitMessage->pktType = CY_FLASH_ENTER_WAIT_LOOP;
|
||||
ipcWaitMessage->intrRelMask = 0u;
|
||||
ipcWaitMessage->intrRelMask = 0U;
|
||||
}
|
||||
|
||||
if (cy_device->flashRwwRequired != 0u)
|
||||
if (cy_device->flashRwwRequired != 0U)
|
||||
{
|
||||
#if (CY_CPU_CORTEX_M4)
|
||||
cy_stc_sysint_t flashIntConfig =
|
||||
{
|
||||
(IRQn_Type)cy_device->cpussFmIrq, /* .intrSrc */
|
||||
0u /* .intrPriority */
|
||||
0U /* .intrPriority */
|
||||
};
|
||||
|
||||
(void)Cy_SysInt_Init(&flashIntConfig, &Cy_Flash_ResumeIrqHandler);
|
||||
NVIC_EnableIRQ(flashIntConfig.intrSrc);
|
||||
#endif
|
||||
|
||||
if (cy_device->flashPipeRequired != 0u)
|
||||
if (cy_device->flashPipeRequired != 0U)
|
||||
{
|
||||
(void)Cy_IPC_Pipe_RegisterCallback(CY_IPC_EP_CYPIPE_ADDR, &Cy_Flash_NotifyHandler,
|
||||
(uint32_t)CY_FLASH_IPC_CLIENT_ID);
|
||||
|
@ -320,12 +324,13 @@ static volatile cy_stc_flash_context_t flashContext;
|
|||
* and erase operations. If the default startup file is not used, or the function
|
||||
* SystemInit() is not called in your project, ensure to perform the following steps
|
||||
* before any flash or EmEEPROM write/erase operations:
|
||||
* \snippet flash\3.20\snippet\main.c Flash Initialization
|
||||
* \snippet flash/snippet/main.c Flash Initialization
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Cy_Flash_Init(void)
|
||||
{
|
||||
#if !defined(CY_FLASH_RWW_DRV_SUPPORT_DISABLED)
|
||||
CY_SECTION(".cy_sharedmem")
|
||||
CY_ALIGN(4) static cy_stc_flash_notify_t ipcWaitMessageStc;
|
||||
|
||||
Cy_Flash_InitExt(&ipcWaitMessageStc);
|
||||
|
@ -368,7 +373,7 @@ static cy_en_flashdrv_status_t Cy_Flash_SendCmd(uint32_t mode, uint32_t microsec
|
|||
uint32_t intr;
|
||||
uint32_t semaTryCount = 0uL;
|
||||
|
||||
if (cy_device->flashRwwRequired != 0u)
|
||||
if (cy_device->flashRwwRequired != 0U)
|
||||
{
|
||||
/* Check for active core is CM0+, or CM4 on single core device */
|
||||
#if (CY_CPU_CORTEX_M0P)
|
||||
|
@ -376,7 +381,7 @@ static cy_en_flashdrv_status_t Cy_Flash_SendCmd(uint32_t mode, uint32_t microsec
|
|||
#else
|
||||
bool isPeerCoreEnabled = false;
|
||||
|
||||
if (SFLASH_SINGLE_CORE == 0u)
|
||||
if (SFLASH_SINGLE_CORE == 0U)
|
||||
{
|
||||
isPeerCoreEnabled = true;
|
||||
}
|
||||
|
@ -429,7 +434,7 @@ static cy_en_flashdrv_status_t Cy_Flash_SendCmd(uint32_t mode, uint32_t microsec
|
|||
}
|
||||
else
|
||||
{
|
||||
while (0u != _FLD2VAL(IPC_STRUCT_ACQUIRE_SUCCESS, *ipcLockStatus))
|
||||
while (0U != _FLD2VAL(IPC_STRUCT_ACQUIRE_SUCCESS, *ipcLockStatus))
|
||||
{
|
||||
/* Polls whether the IPC is released and the Flash operation is performed */
|
||||
}
|
||||
|
@ -476,7 +481,7 @@ static cy_en_flashdrv_status_t Cy_Flash_SendCmd(uint32_t mode, uint32_t microsec
|
|||
}
|
||||
else
|
||||
{
|
||||
while (0u != _FLD2VAL(IPC_STRUCT_ACQUIRE_SUCCESS, *ipcLockStatus))
|
||||
while (0U != _FLD2VAL(IPC_STRUCT_ACQUIRE_SUCCESS, *ipcLockStatus))
|
||||
{
|
||||
/* Polls whether the IPC is released and the Flash operation is performed */
|
||||
}
|
||||
|
@ -623,7 +628,7 @@ static cy_en_flashdrv_status_t Cy_Flash_SendCmd(uint32_t mode, uint32_t microsec
|
|||
* a reason for failure. Does not return until the Write operation is
|
||||
* complete. Returns immediately and reports a \ref CY_FLASH_DRV_IPC_BUSY error in
|
||||
* the case when another process is writing to flash or erasing the row.
|
||||
* User firmware should not enter the Hibernate or Deep-Sleep mode until flash Erase
|
||||
* User firmware should not enter the Hibernate or Deep Sleep mode until flash Erase
|
||||
* is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the Flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, low-voltage
|
||||
|
@ -654,7 +659,7 @@ cy_en_flashdrv_status_t Cy_Flash_EraseRow(uint32_t rowAddr)
|
|||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0u)
|
||||
if (cy_device->flashEraseDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
|
@ -668,6 +673,292 @@ cy_en_flashdrv_status_t Cy_Flash_EraseRow(uint32_t rowAddr)
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_StartEraseRow
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Starts erasing a single row of flash. Returns immediately
|
||||
* and reports a successful start or reason for failure.
|
||||
* Reports a \ref CY_FLASH_DRV_IPC_BUSY error in the case when IPC structure is locked
|
||||
* by another process. User firmware should not enter the Hibernate or Deep Sleep mode until
|
||||
* flash Erase is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, the low-voltage
|
||||
* detect circuits should be configured to generate an interrupt instead of a reset.
|
||||
* Otherwise, portions of flash may undergo unexpected changes.
|
||||
* \note Before reading data from previously programmed/erased flash rows, the
|
||||
* user must clear the flash cache with the Cy_SysLib_ClearFlashCacheAndBuffer()
|
||||
* function.
|
||||
*
|
||||
* \param rowAddr Address of the flash row number.
|
||||
* The Read-while-Write violation occurs when the flash read operation is
|
||||
* initiated in the same flash sector where the flash erase operation is
|
||||
* performing. Refer to the device datasheet for the details.
|
||||
* Address must match row start address.
|
||||
*
|
||||
* \return Returns the status of the Flash operation,
|
||||
* see \ref cy_en_flashdrv_status_t.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartEraseRow(uint32_t rowAddr)
|
||||
{
|
||||
cy_en_flashdrv_status_t result = CY_FLASH_DRV_INVALID_INPUT_PARAMETERS;
|
||||
|
||||
if (Cy_Flash_BoundsCheck(rowAddr) != false)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
/* Prepares arguments to be passed to SROM API */
|
||||
flashContext.opcode = CY_FLASH_OPCODE_ERASE_ROW;
|
||||
if (SFLASH_SINGLE_CORE != 0U)
|
||||
{
|
||||
flashContext.opcode |= CY_FLASH_BLOCKING_MODE;
|
||||
}
|
||||
|
||||
flashContext.arg1 = rowAddr;
|
||||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_NO_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_EraseSector
|
||||
****************************************************************************//**
|
||||
*
|
||||
* This function erases a 256KB sector of flash. Reports success or
|
||||
* a reason for failure. Does not return until the Erase operation is
|
||||
* complete. Returns immediately and reports a \ref CY_FLASH_DRV_IPC_BUSY error in
|
||||
* the case when another process is writing to flash or erasing the row.
|
||||
* User firmware should not enter the Hibernate or Deep Sleep mode until flash Erase
|
||||
* is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the Flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, low-voltage
|
||||
* detect circuits should be configured to generate an interrupt instead of a
|
||||
* reset. Otherwise, portions of flash may undergo unexpected changes.
|
||||
*
|
||||
* \param sectorAddr Address of the flash row number.
|
||||
* The Read-while-Write violation occurs when the flash read operation is
|
||||
* initiated in the same flash sector where the flash write operation is
|
||||
* performing. Refer to the device datasheet for the details.
|
||||
* Address must match row start address.
|
||||
*
|
||||
* \return Returns the status of the Flash operation,
|
||||
* see \ref cy_en_flashdrv_status_t.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cy_en_flashdrv_status_t Cy_Flash_EraseSector(uint32_t sectorAddr)
|
||||
{
|
||||
cy_en_flashdrv_status_t result = CY_FLASH_DRV_INVALID_INPUT_PARAMETERS;
|
||||
|
||||
/* Prepares arguments to be passed to SROM API */
|
||||
if (Cy_Flash_BoundsCheck(sectorAddr) != false)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
flashContext.opcode = CY_FLASH_OPCODE_ERASE_SECTOR | CY_FLASH_BLOCKING_MODE;
|
||||
flashContext.arg1 = sectorAddr;
|
||||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_NO_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_StartEraseSector
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Starts erasing a 256KB sector of flash. Returns immediately
|
||||
* and reports a successful start or reason for failure.
|
||||
* Reports a \ref CY_FLASH_DRV_IPC_BUSY error in the case when IPC structure is locked
|
||||
* by another process. User firmware should not enter the Hibernate or Deep Sleep mode until
|
||||
* flash Erase is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, the low-voltage
|
||||
* detect circuits should be configured to generate an interrupt instead of a reset.
|
||||
* Otherwise, portions of flash may undergo unexpected changes.
|
||||
* \note Before reading data from previously programmed/erased flash rows, the
|
||||
* user must clear the flash cache with the Cy_SysLib_ClearFlashCacheAndBuffer()
|
||||
* function.
|
||||
*
|
||||
* \param rowAddr Address of the flash row number.
|
||||
* The Read-while-Write violation occurs when the flash read operation is
|
||||
* initiated in the same flash sector where the flash erase operation is
|
||||
* performing. Refer to the device datasheet for the details.
|
||||
* Address must match row start address.
|
||||
*
|
||||
* \return Returns the status of the Flash operation,
|
||||
* see \ref cy_en_flashdrv_status_t.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartEraseSector(uint32_t sectorAddr)
|
||||
{
|
||||
cy_en_flashdrv_status_t result = CY_FLASH_DRV_INVALID_INPUT_PARAMETERS;
|
||||
|
||||
if (Cy_Flash_BoundsCheck(sectorAddr) != false)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
/* Prepares arguments to be passed to SROM API */
|
||||
flashContext.opcode = CY_FLASH_OPCODE_ERASE_SECTOR;
|
||||
if (SFLASH_SINGLE_CORE != 0U)
|
||||
{
|
||||
flashContext.opcode |= CY_FLASH_BLOCKING_MODE;
|
||||
}
|
||||
|
||||
flashContext.arg1 = sectorAddr;
|
||||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_NO_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_EraseSubsector
|
||||
****************************************************************************//**
|
||||
*
|
||||
* This function erases an 8-row subsector of flash. Reports success or
|
||||
* a reason for failure. Does not return until the Write operation is
|
||||
* complete. Returns immediately and reports a \ref CY_FLASH_DRV_IPC_BUSY error in
|
||||
* the case when another process is writing to flash or erasing the row.
|
||||
* User firmware should not enter the Hibernate or Deep-Sleep mode until flash Erase
|
||||
* is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the Flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, low-voltage
|
||||
* detect circuits should be configured to generate an interrupt instead of a
|
||||
* reset. Otherwise, portions of flash may undergo unexpected changes.
|
||||
*
|
||||
* \param rowAddr Address of the flash row number.
|
||||
* The Read-while-Write violation occurs when the flash read operation is
|
||||
* initiated in the same flash sector where the flash write operation is
|
||||
* performing. Refer to the device datasheet for the details.
|
||||
* Address must match row start address.
|
||||
*
|
||||
* \return Returns the status of the Flash operation,
|
||||
* see \ref cy_en_flashdrv_status_t.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cy_en_flashdrv_status_t Cy_Flash_EraseSubsector(uint32_t subSectorAddr)
|
||||
{
|
||||
cy_en_flashdrv_status_t result = CY_FLASH_DRV_INVALID_INPUT_PARAMETERS;
|
||||
|
||||
/* Prepares arguments to be passed to SROM API */
|
||||
if (Cy_Flash_BoundsCheck(subSectorAddr) != false)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
flashContext.opcode = CY_FLASH_OPCODE_ERASE_SUB_SECTOR | CY_FLASH_BLOCKING_MODE;
|
||||
flashContext.arg1 = subSectorAddr;
|
||||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_NO_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_StartEraseSubsector
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Starts erasing an 8-row subsector of flash. Returns immediately
|
||||
* and reports a successful start or reason for failure.
|
||||
* Reports a \ref CY_FLASH_DRV_IPC_BUSY error in the case when IPC structure is locked
|
||||
* by another process. User firmware should not enter the Hibernate or Deep-Sleep mode until
|
||||
* flash Erase is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, the low-voltage
|
||||
* detect circuits should be configured to generate an interrupt instead of a reset.
|
||||
* Otherwise, portions of flash may undergo unexpected changes.
|
||||
* \note Before reading data from previously programmed/erased flash rows, the
|
||||
* user must clear the flash cache with the Cy_SysLib_ClearFlashCacheAndBuffer()
|
||||
* function.
|
||||
*
|
||||
* \param rowAddr Address of the flash row number.
|
||||
* The Read-while-Write violation occurs when the flash read operation is
|
||||
* initiated in the same flash sector where the flash erase operation is
|
||||
* performing. Refer to the device datasheet for the details.
|
||||
* Address must match row start address.
|
||||
*
|
||||
* \return Returns the status of the Flash operation,
|
||||
* see \ref cy_en_flashdrv_status_t.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartEraseSubsector(uint32_t subSectorAddr)
|
||||
{
|
||||
cy_en_flashdrv_status_t result = CY_FLASH_DRV_INVALID_INPUT_PARAMETERS;
|
||||
|
||||
if (Cy_Flash_BoundsCheck(subSectorAddr) != false)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
/* Prepares arguments to be passed to SROM API */
|
||||
flashContext.opcode = CY_FLASH_OPCODE_ERASE_SUB_SECTOR;
|
||||
if (SFLASH_SINGLE_CORE != 0U)
|
||||
{
|
||||
flashContext.opcode |= CY_FLASH_BLOCKING_MODE;
|
||||
}
|
||||
|
||||
flashContext.arg1 = subSectorAddr;
|
||||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_NO_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_ProgramRow
|
||||
****************************************************************************//**
|
||||
|
@ -720,7 +1011,7 @@ cy_en_flashdrv_status_t Cy_Flash_ProgramRow(uint32_t rowAddr, const uint32_t* da
|
|||
flashContext.arg2 = rowAddr;
|
||||
flashContext.arg3 = (uint32_t)data;
|
||||
|
||||
if (cy_device->flashProgramDelay != 0u)
|
||||
if (cy_device->flashProgramDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_START_PROGRAM_DELAY);
|
||||
}
|
||||
|
@ -782,7 +1073,7 @@ cy_en_flashdrv_status_t Cy_Flash_WriteRow(uint32_t rowAddr, const uint32_t* data
|
|||
flashContext.arg2 = rowAddr;
|
||||
flashContext.arg3 = (uint32_t)data;
|
||||
|
||||
if (cy_device->flashWriteDelay != 0u)
|
||||
if (cy_device->flashWriteDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_BLOCKING_MODE, CY_FLASH_START_WRITE_DELAY);
|
||||
}
|
||||
|
@ -836,7 +1127,7 @@ cy_en_flashdrv_status_t Cy_Flash_StartWrite(uint32_t rowAddr, const uint32_t* da
|
|||
/* Checks whether the input parameters are valid */
|
||||
if ((Cy_Flash_BoundsCheck(rowAddr) != false) && (NULL != data))
|
||||
{
|
||||
result = Cy_Flash_StartErase(rowAddr);
|
||||
result = Cy_Flash_StartEraseRow(rowAddr);
|
||||
|
||||
if (CY_FLASH_DRV_OPERATION_STARTED == result)
|
||||
{
|
||||
|
@ -874,66 +1165,6 @@ cy_en_flashdrv_status_t Cy_Flash_IsOperationComplete(void)
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_StartErase
|
||||
****************************************************************************//**
|
||||
*
|
||||
* Starts erasing a single row of flash. Returns immediately
|
||||
* and reports a successful start or reason for failure.
|
||||
* Reports a \ref CY_FLASH_DRV_IPC_BUSY error in the case when IPC structure is locked
|
||||
* by another process. User firmware should not enter the Hibernate or Deep-Sleep mode until
|
||||
* flash Erase is complete. The Flash operation is allowed in Sleep mode.
|
||||
* During the flash operation, the device should not be reset, including the
|
||||
* XRES pin, a software reset, and watchdog reset sources. Also, the low-voltage
|
||||
* detect circuits should be configured to generate an interrupt instead of a reset.
|
||||
* Otherwise, portions of flash may undergo unexpected changes.
|
||||
* \note Before reading data from previously programmed/erased flash rows, the
|
||||
* user must clear the flash cache with the Cy_SysLib_ClearFlashCacheAndBuffer()
|
||||
* function.
|
||||
*
|
||||
* \param rowAddr Address of the flash row number.
|
||||
* The Read-while-Write violation occurs when the flash read operation is
|
||||
* initiated in the same flash sector where the flash erase operation is
|
||||
* performing. Refer to the device datasheet for the details.
|
||||
* Address must match row start address.
|
||||
*
|
||||
* \return Returns the status of the Flash operation,
|
||||
* see \ref cy_en_flashdrv_status_t.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cy_en_flashdrv_status_t Cy_Flash_StartErase(uint32_t rowAddr)
|
||||
{
|
||||
cy_en_flashdrv_status_t result = CY_FLASH_DRV_INVALID_INPUT_PARAMETERS;
|
||||
|
||||
if (Cy_Flash_BoundsCheck(rowAddr) != false)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
/* Prepares arguments to be passed to SROM API */
|
||||
flashContext.opcode = CY_FLASH_OPCODE_ERASE_ROW;
|
||||
if (SFLASH_SINGLE_CORE != 0u)
|
||||
{
|
||||
flashContext.opcode |= CY_FLASH_BLOCKING_MODE;
|
||||
}
|
||||
|
||||
flashContext.arg1 = rowAddr;
|
||||
flashContext.arg2 = 0UL;
|
||||
flashContext.arg3 = 0UL;
|
||||
|
||||
if (cy_device->flashEraseDelay != 0u)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_START_ERASE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_NO_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Cy_Flash_StartProgram
|
||||
****************************************************************************//**
|
||||
|
@ -948,7 +1179,7 @@ cy_en_flashdrv_status_t Cy_Flash_StartErase(uint32_t rowAddr)
|
|||
* detect circuits should be configured to generate an interrupt instead of a reset.
|
||||
* Otherwise, portions of flash may undergo unexpected changes.\n
|
||||
* Before calling this function, the target flash region must be erased by
|
||||
* the StartErase/EraseRow function.\n
|
||||
* the StartEraseRow/EraseRow function.\n
|
||||
* Data to be programmed must be located in the SRAM memory region.
|
||||
* \note Before reading data from previously programmed/erased flash rows, the
|
||||
* user must clear the flash cache with the Cy_SysLib_ClearFlashCacheAndBuffer()
|
||||
|
@ -979,7 +1210,7 @@ cy_en_flashdrv_status_t Cy_Flash_StartProgram(uint32_t rowAddr, const uint32_t*
|
|||
/* Prepares arguments to be passed to SROM API */
|
||||
flashContext.opcode = CY_FLASH_OPCODE_PROGRAM_ROW;
|
||||
|
||||
if (SFLASH_SINGLE_CORE != 0u)
|
||||
if (SFLASH_SINGLE_CORE != 0U)
|
||||
{
|
||||
flashContext.opcode |= CY_FLASH_BLOCKING_MODE;
|
||||
}
|
||||
|
@ -988,7 +1219,7 @@ cy_en_flashdrv_status_t Cy_Flash_StartProgram(uint32_t rowAddr, const uint32_t*
|
|||
flashContext.arg2 = rowAddr;
|
||||
flashContext.arg3 = (uint32_t)data;
|
||||
|
||||
if (cy_device->flashProgramDelay != 0u)
|
||||
if (cy_device->flashProgramDelay != 0U)
|
||||
{
|
||||
result = Cy_Flash_SendCmd(CY_FLASH_NON_BLOCKING_MODE, CY_FLASH_START_PROGRAM_DELAY);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_ipc_drv.c
|
||||
* \version 1.30
|
||||
* \version 1.40
|
||||
*
|
||||
* \brief
|
||||
* IPC Driver - This source file contains the low-level driver code for
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_ipc_pipe.c
|
||||
* \version 1.30
|
||||
* \version 1.40
|
||||
*
|
||||
* Description:
|
||||
* IPC Pipe Driver - This source file includes code for the Pipe layer on top
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_ipc_sema.c
|
||||
* \version 1.30
|
||||
* \version 1.40
|
||||
*
|
||||
* Description:
|
||||
* IPC Semaphore Driver - This source file contains the source code for the
|
||||
|
@ -73,6 +73,7 @@ cy_en_ipcsema_status_t Cy_IPC_Sema_Init(uint32_t ipcChannel,
|
|||
uint32_t count, uint32_t memPtr[])
|
||||
{
|
||||
/* Structure containing semaphores control data */
|
||||
CY_SECTION(".cy_sharedmem")
|
||||
static cy_stc_ipc_sema_t cy_semaData;
|
||||
|
||||
cy_en_ipcsema_status_t retStatus = CY_IPC_SEMA_BAD_PARAM;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************//**
|
||||
* \file cy_syslib.c
|
||||
* \version 2.20
|
||||
* \version 2.30
|
||||
*
|
||||
* Description:
|
||||
* Provides system API implementation for the SysLib driver.
|
||||
|
@ -52,7 +52,11 @@
|
|||
#endif /* (CY_ARM_FAULT_DEBUG == CY_ARM_FAULT_DEBUG_ENABLED) */
|
||||
|
||||
#if defined(__ARMCC_VERSION)
|
||||
#if (__ARMCC_VERSION >= 6010050)
|
||||
static void Cy_SysLib_AsmInfiniteLoop(void) { __ASM (" b . "); };
|
||||
#else
|
||||
static __ASM void Cy_SysLib_AsmInfiniteLoop(void) { b . };
|
||||
#endif /* (__ARMCC_VERSION >= 6010050) */
|
||||
#endif /* (__ARMCC_VERSION) */
|
||||
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -8157,7 +8157,7 @@
|
|||
"inherits": ["Target"],
|
||||
"macros": ["MBED_MPU_CUSTOM"],
|
||||
"default_toolchain": "GCC_ARM",
|
||||
"supported_toolchains": ["GCC_ARM", "IAR", "ARMC5"],
|
||||
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
|
||||
"core": "Cortex-M4F",
|
||||
"OUTPUT_EXT": "hex",
|
||||
"device_has": [
|
||||
|
@ -8203,7 +8203,7 @@
|
|||
"CY8CKIT_062_WIFI_BT_M0": {
|
||||
"inherits": ["MCU_PSOC6_M0"],
|
||||
"supported_form_factors": ["ARDUINO"],
|
||||
"extra_labels_add": ["CY8C62XX", "CY8CKIT_062_WIFI_BT"],
|
||||
"extra_labels_add": ["CY8CKIT_062_WIFI_BT"],
|
||||
"macros_add": ["CY8C6247BZI_D54", "PSOC6_DYNSRM_DISABLE=1"],
|
||||
"detect_code": ["1900"],
|
||||
"post_binary_hook": {
|
||||
|
@ -8214,7 +8214,7 @@
|
|||
"inherits": ["MCU_PSOC6_M4"],
|
||||
"features": ["BLE"],
|
||||
"supported_form_factors": ["ARDUINO"],
|
||||
"extra_labels_add": ["PSOC6_01", "WICED", "CYW43XXX", "CYW4343X", "CORDIO", "CY8C62XX"],
|
||||
"extra_labels_add": ["PSOC6_01", "WICED", "CYW43XXX", "CYW4343X", "CORDIO"],
|
||||
"macros_add": ["CY8C6247BZI_D54", "PSOC6_DYNSRM_DISABLE=1"],
|
||||
"detect_code": ["1900"],
|
||||
"hex_filename": "psoc6_01_cm0p_sleep.hex",
|
||||
|
@ -8234,7 +8234,6 @@
|
|||
"MBED_TICKLESS",
|
||||
"MBEDTLS_PSA_CRYPTO_SPM",
|
||||
"MBEDTLS_PSA_CRYPTO_C",
|
||||
"CY_IPC_DEFAULT_CFG_DISABLE",
|
||||
"PU_ENABLE"
|
||||
],
|
||||
"deliver_to_target": "CY8CKIT_062_WIFI_BT_PSA",
|
||||
|
@ -8328,7 +8327,7 @@
|
|||
},
|
||||
"CYW943012P6EVB_01_M0": {
|
||||
"inherits": ["MCU_PSOC6_M0"],
|
||||
"extra_labels_add": ["CY8C62XX", "CYW943012P6EVB_01"],
|
||||
"extra_labels_add": ["CYW943012P6EVB_01"],
|
||||
"macros_add": ["CY8C6247BZI_D54", "PSOC6_DYNSRM_DISABLE=1"],
|
||||
"post_binary_hook": {
|
||||
"function": "PSOC6Code.complete"
|
||||
|
@ -8337,7 +8336,7 @@
|
|||
"CYW943012P6EVB_01": {
|
||||
"inherits": ["MCU_PSOC6_M4"],
|
||||
"features": ["BLE"],
|
||||
"extra_labels_add": ["PSOC6_01", "WICED", "CYW43XXX", "CYW43012", "CORDIO", "CY8C62XX"],
|
||||
"extra_labels_add": ["PSOC6_01", "WICED", "CYW43XXX", "CYW43012", "CORDIO"],
|
||||
"macros_add": ["CY8C6247BZI_D54", "PSOC6_DYNSRM_DISABLE=1"],
|
||||
"detect_code": ["1906"],
|
||||
"hex_filename": "psoc6_01_cm0p_sleep.hex",
|
||||
|
@ -8350,7 +8349,6 @@
|
|||
},
|
||||
"FUTURE_SEQUANA_M0": {
|
||||
"inherits": ["MCU_PSOC6_M0"],
|
||||
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
|
||||
"supported_form_factors": ["ARDUINO"],
|
||||
"extra_labels_add": ["PSOC6_FUTURE", "CY8C63XX", "FUTURE_SEQUANA"],
|
||||
"extra_labels_remove": ["PSOC6"],
|
||||
|
@ -8380,7 +8378,6 @@
|
|||
},
|
||||
"FUTURE_SEQUANA": {
|
||||
"inherits": ["MCU_PSOC6_M4"],
|
||||
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
|
||||
"supported_form_factors": ["ARDUINO"],
|
||||
"extra_labels_add": ["PSOC6_FUTURE", "CY8C63XX", "CORDIO"],
|
||||
"extra_labels_remove": ["PSOC6"],
|
||||
|
|
Loading…
Reference in New Issue