Skip to content

FUTURE_SEQUANA: Add suport for ARMC6 #10346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
* (.noinit)
}

ARM_LIB_STACK RAM_START+RAM_SIZE EMPTY -Stack_Size
; Application heap area (HEAP)
ARM_LIB_HEAP +0
{
* (HEAP)
}

ARM_LIB_STACK RAM_START + RAM_SIZE EMPTY - Stack_Size
{ ; Stack region growing down
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "ipc_rpc.h"
#include "rpc_defs.h"
#include "cy_ipc_config.h"
#include "ipc/cy_ipc_pipe.h"
#include "cy_ipc_pipe.h"

#define RPC_GEN RPC_GEN_IMPLEMENTATION
#include "rpc_api.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

#if defined(CY_DEVICE_PSOC6ABLE2)
#if !defined(CY_PSOC6ABLE2_REV_0A_SUPPORT_DISABLE)
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"
#endif /* !defined(CY_PSOC6ABLE2_REV_0A_SUPPORT_DISABLE) */
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
#include "ipc/cy_ipc_drv.h"
#include "flash/cy_flash.h"
#include "cy_ipc_drv.h"
#include "cy_flash.h"
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
#endif /* defined(CY_DEVICE_PSOC6ABLE2) */

Expand Down Expand Up @@ -583,7 +583,7 @@ void Cy_SysResetCM4(void)
* linker configuration files. The following symbols used by the cymcuelftool.
*
*******************************************************************************/
#if defined (__ARMCC_VERSION)
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
__asm void Cy_MemorySymbols(void)
{
/* Flash */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,23 @@ LR_IROM1 FLASH_START FLASH_SIZE
.ANY (+RW, +ZI)
}

ARM_LIB_STACK RAM_START+RAM_SIZE EMPTY -Stack_Size
{ ; Stack region growing down
}

; 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)
}

ARM_LIB_STACK RAM_START + RAM_SIZE EMPTY - Stack_Size
{ ; Stack region growing down
}

; Used for the digital signature of the secure application and the
; Bootloader SDK appication. The size of the section depends on the required
; data size.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "Semaphore.h"
#include "mbed_assert.h"
#include "cy_ipc_config.h"
#include "ipc/cy_ipc_pipe.h"
#include "cy_ipc_pipe.h"
#include <stdarg.h>
#include "platform/SingletonPtr.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "psoc6_utils.h"

#if defined(CY_DEVICE_PSOC6ABLE2) && !defined(CY_IPC_DEFAULT_CFG_DISABLE)
#include "ipc/cy_ipc_drv.h"
#include "flash/cy_flash.h"
#include "cy_ipc_drv.h"
#include "cy_flash.h"
#endif /* defined(CY_DEVICE_PSOC6ABLE2) && !defined(CY_IPC_DEFAULT_CFG_DISABLE) */


Expand Down Expand Up @@ -409,7 +409,7 @@ void Cy_SystemInitFpuEnable(void)
* linker configuration files. The following symbols used by the cymcuelftool.
*
*******************************************************************************/
#if defined (__ARMCC_VERSION)
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
__asm void Cy_MemorySymbols(void)
{
/* Flash */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

#include "ipc/cy_ipc_drv.h"
#include "ipc/cy_ipc_pipe.h"
#include "ipc/cy_ipc_sema.h"
#include "cy_ipc_drv.h"
#include "cy_ipc_pipe.h"
#include "cy_ipc_sema.h"

#include "cy_ipc_config.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@

#include <string.h>
#include "device.h"
#include "gpio/cy_gpio.h"
#include "syslib/cy_syslib.h"
#include "sysclk/cy_sysclk.h"
#include "systick/cy_systick.h"
#include "sysanalog/cy_sysanalog.h"
#include "cy_gpio.h"
#include "cy_syslib.h"
#include "cy_sysclk.h"
#include "cy_systick.h"
#include "cy_sysanalog.h"

#if FEATURE_BLE
#include "ble/cy_ble_clk.h"
#endif // FEATURE_BLE

#define CY_NEED_CYCLOCKSTARTUPERROR 1
#include "syspm/cy_syspm.h"
#include "cy_syspm.h"

#include "psoc6_utils.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@
#include <stdbool.h>
#include <stddef.h>
#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "sysanalog/cy_sysanalog.h"
#include "cy_syslib.h"
#include "cy_sysanalog.h"

#ifndef CY_IP_MXS40PASS_CTB
#error "The CTB driver is not supported on this device"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@
#include <stdbool.h>
#include <stddef.h>
#include "cy_device_headers.h"
#include "syspm/cy_syspm.h"
#include "syslib/cy_syslib.h"
#include "sysclk/cy_sysclk.h"
#include "cy_syspm.h"
#include "cy_syslib.h"
#include "cy_sysclk.h"

#ifndef CY_IP_MXS40PASS_CTDAC
#error "The CTDAC driver is not supported on this device"
Expand Down Expand Up @@ -922,10 +922,12 @@ __STATIC_INLINE uint32_t Cy_CTDAC_GetInterruptStatus(const CTDAC_Type *base)
*******************************************************************************/
__STATIC_INLINE void Cy_CTDAC_ClearInterrupt(CTDAC_Type *base)
{
uint32_t unused;

base->INTR = CTDAC_INTR_VDAC_EMPTY_Msk;

/* Dummy read for buffered writes. */
(void) base->INTR;
unused = base->INTR;
}

/*******************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"
#include "cy_device_headers.h"

#ifndef CY_IP_M4CPUSS_DMA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
*/

#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"

/***************************************
* Macro Definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
*/

#include <cy_device_headers.h>
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"

#if defined(__cplusplus)
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
#define CY_GPIO_H

#include <stddef.h>
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"
#include "cy_device_headers.h"

#if defined(__cplusplus)
Expand Down Expand Up @@ -1566,15 +1566,17 @@ __STATIC_INLINE uint32_t Cy_GPIO_GetInterruptStatus(GPIO_PRT_Type* base, uint32_
*******************************************************************************/
__STATIC_INLINE void Cy_GPIO_ClearInterrupt(GPIO_PRT_Type* base, uint32_t pinNum)
{
uint32_t unused;

CY_ASSERT_L2(CY_GPIO_IS_FILTER_PIN_VALID(pinNum));

/* Any INTR MMIO registers AHB clearing must be preceded with an AHB read access */
(void)base->INTR;
unused = base->INTR;

base->INTR = CY_GPIO_INTR_STATUS_MASK << pinNum;

/* This read ensures that the initial write has been flushed out to the hardware */
(void)base->INTR;
unused = base->INTR;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@

#include <stddef.h>
#include <stdbool.h>
#include "syslib/cy_syslib.h"
#include "syspm/cy_syspm.h"
#include "cy_syslib.h"
#include "cy_syspm.h"

#ifndef CY_IP_MXAUDIOSS
#error "The I2S driver is not supported on this device"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
/******************************************************************************/
/* Include files */
/******************************************************************************/
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"
#include "cy_device_headers.h"
#include "cy_ipc_config.h"
#include <stddef.h>
Expand Down Expand Up @@ -615,11 +615,13 @@ __STATIC_INLINE void Cy_IPC_Drv_SetInterrupt(IPC_INTR_STRUCT_Type* base, uint32
*******************************************************************************/
__STATIC_INLINE void Cy_IPC_Drv_ClearInterrupt(IPC_INTR_STRUCT_Type* base, uint32_t ipcReleaseMask, uint32_t ipcNotifyMask)
{
uint32_t unused;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you should add volatile so the compiler wont optimize that out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about it, but the ARM clang reference manual states (section 7.12 Qualifiers):

Value computation of an lvalue expression with a volatile qualified type constitutes an access to the corresponding object, even when the value is discarded.

So I think it's ok, as it's hw register (data field), that is declared volatile. Variable unused could be skipped.
Same holds true for GCC.


CY_ASSERT_L1(0ul == (ipcNotifyMask & ~(uint32_t)(IPC_STRUCT_NOTIFY_INTR_NOTIFY_Msk)));
CY_ASSERT_L1(0ul == (ipcReleaseMask & ~(uint32_t)(IPC_STRUCT_RELEASE_INTR_RELEASE_Msk)));
base->INTR = _VAL2FLD(IPC_INTR_STRUCT_INTR_NOTIFY, ipcNotifyMask) |
_VAL2FLD(IPC_INTR_STRUCT_INTR_RELEASE, ipcReleaseMask);
(void)base->INTR; /* Read the register to flush the cache */
unused = base->INTR; /* Read the register to flush the cache */
}

/** \} group_ipc_functions */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/******************************************************************************/
/* Include files */
/******************************************************************************/
#include "ipc/cy_ipc_drv.h"
#include "syslib/cy_syslib.h"
#include "sysint/cy_sysint.h"
#include "cy_ipc_drv.h"
#include "cy_syslib.h"
#include "cy_sysint.h"

/**
* \addtogroup group_ipc_pipe IPC pipes layer (IPC_PIPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
#include <stdbool.h>
#include <stddef.h>
#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "syspm/cy_syspm.h"
#include "cy_syslib.h"
#include "cy_syspm.h"

#ifndef CY_IP_MXLPCOMP
#error "The LPCOMP driver is not supported on this device"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
#if !defined CY_LVD_H
#define CY_LVD_H

#include "syspm/cy_syspm.h"
#include "cy_syspm.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern "C" {
#include <stdbool.h>
#include <stddef.h>
#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"

#ifndef CY_IP_MXS40SRSS_MCWDT
#error "The MCWDT driver is not supported on this device"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
/******************************************************************************/

#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "syspm/cy_syspm.h"
#include "cy_syslib.h"
#include "cy_syspm.h"
#include <stddef.h>
#include <stdbool.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
#define CY_PROFILE_H

#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"
#include <stddef.h>

#ifndef CY_IP_MXPROFILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@

#include <stdbool.h>
#include <stddef.h>
#include "syslib/cy_syslib.h"
#include "cy_syslib.h"
#include "cy_device_headers.h"

#if defined(__cplusplus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@
#include <stddef.h>
#include <stdbool.h>
#include "cy_device_headers.h"
#include "syslib/cy_syslib.h"
#include "syspm/cy_syspm.h"
#include "cy_syslib.h"
#include "cy_syspm.h"

#ifndef CY_IP_MXS40SRSS_RTC
#error "The RTC driver is not supported on this device"
Expand Down
Loading