Skip to content

Commit 7c8cbd6

Browse files
author
Edmund Hsu
committed
Add ARMC6 feature to EV_COG_AD4050LZ and EV_COG_AD3029LZ
1 parent a519b84 commit 7c8cbd6

File tree

17 files changed

+30
-82
lines changed

17 files changed

+30
-82
lines changed

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TARGET_EV_COG_AD3029LZ/device/startup_ADuCM3029.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
*
4646
*****************************************************************************/
4747
#include <stdint.h>
48-
#ifdef __CC_ARM
48+
#ifdef __ARMCC_VERSION
4949
#include <rt_misc.h>
5050
#endif
5151
#include <cmsis.h>
@@ -61,8 +61,8 @@ extern void SramInit(void);
6161
/*----------------------------------------------------------------------------
6262
Checksum options
6363
*----------------------------------------------------------------------------*/
64-
#if defined (__CC_ARM)
65-
__attribute__ ((at(0x000001A0u)))
64+
#if defined (__ARMCC_VERSION)
65+
__attribute__((section(".ARM.__at_0x000001A0")))
6666
#elif defined( __ICCARM__)
6767
__root
6868
#endif /* __ICCARM__ */
@@ -151,7 +151,7 @@ const pFunc SECTION_PLACE(IVT_NAME[104],VECTOR_SECTION) =
151151
/*----------------------------------------------------------------------------
152152
* Initialize .bss and .data for GNU
153153
*----------------------------------------------------------------------------*/
154-
#if defined( __GNUC__) && !defined (__CC_ARM)
154+
#if defined( __GNUC__) && !defined (__ARMCC_VERSION)
155155
void zero_bss(void)
156156
{
157157
uint32_t *pSrc, *pDest;
@@ -248,7 +248,7 @@ void Reset_Handler(void)
248248
may reside in DSRAM bank B. */
249249
SramInit();
250250

251-
#if defined(__GNUC__) && !defined (__CC_ARM)
251+
#if defined(__GNUC__) && !defined (__ARMCC_VERSION)
252252
/* Clear the bss section for GCC build only */
253253
zero_bss();
254254
#endif
@@ -263,7 +263,7 @@ void Reset_Handler(void)
263263
/*----------------------------------------------------------------------------
264264
Default Handler for Exceptions / Interrupts
265265
*----------------------------------------------------------------------------*/
266-
#if defined(__CC_ARM) || defined (__GNUC__)
266+
#if defined(__ARMCC_VERSION) || defined (__GNUC__)
267267
void Default_Handler(void)
268268
{
269269
while(1);

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TARGET_EV_COG_AD3029LZ/device/startup_ADuCM3029.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,14 @@ RESET_EXCPT_HNDLR
6363

6464
#define VECTOR_SECTION ".vectors"
6565

66-
#ifdef __CC_ARM
67-
extern unsigned Image$$ADUCM_HEAP$$Base[];
68-
extern unsigned Image$$ADUCM_HEAP$$ZI$$Limit[];
66+
#ifdef __ARMCC_VERSION
6967
void Default_Handler(void);
70-
#define SECTION_NAME(sectionname) __attribute__ ((section(sectionname)))
71-
#define SECTION_PLACE(def,sectionname) def __attribute__ ((section(sectionname)))
68+
#define SECTION_NAME(sectionname) __attribute__((section(sectionname)))
69+
#define SECTION_PLACE(def,sectionname) def __attribute__((section(sectionname)))
7270
#define IVT_NAME __Vectors
7371
#define RESET_EXCPT_HNDLR __main
7472
#define COMPILER_NAME "ARMCC"
75-
#define WEAK_FUNCTION(x) void x (void) __attribute__ ((weak, alias("Default_Handler")));
73+
#define WEAK_FUNCTION(x) void x (void) __attribute__((weak, alias("Default_Handler")));
7674

7775
#elif defined(__ICCARM__)
7876
#pragma diag_suppress=Pm093,Pm140

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/trng_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#define TRNG_PRESCALER 2
5656

5757
/* RNG Device memory */
58-
static uint8_t RngDevMem[ADI_RNG_MEMORY_SIZE];
58+
static uint32_t RngDevMem[(ADI_RNG_MEMORY_SIZE + 3)/4];
5959

6060
void trng_init(trng_t *obj)
6161
{

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/ADuCM3029_typedefs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6262
#pragma diag_suppress=Pm008,Pm093
6363
#endif /* __ICCARM__ */
6464

65-
#if defined (__CC_ARM)
66-
#pragma anon_unions
67-
#endif /* __CC_ARM */
68-
6965
#define __ADI_NO_DECL_STRUCT_ADI_CRYPT_CFG_t__
7066

7167
#include <sys/ADuCM302x_typedefs.h>

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/crypto/adi_crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ POSSIBILITY OF SUCH DAMAGE.
123123
#define __ADI_BYTE_SWAP(X) __REV(X)
124124
#elif defined (__GNUC__)
125125
#define __ADI_BYTE_SWAP(X) __builtin_bswap32(X)
126-
#elif defined (__CC_ARM)
126+
#elif defined (__ARMCC_VERSION)
127127
#define __ADI_BYTE_SWAP(X) __rev(X)
128128
#else
129129
#error "This toolchain is not supported"

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/dma/adi_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ ADI_DMA_RESULT adi_dma_RegisterCallback (
272272
/* ARM Cortex-M3/M4, GNU-ARM compiler */
273273
#define ADI_CLZ(X) __builtin_clz(X)
274274

275-
#elif defined(__CC_ARM)
275+
#elif defined(__ARMCC_VERSION)
276276

277277
/* ARM Cortex-M3/M4, Keil compiler */
278278
#define ADI_CLZ(X) __clz(X)

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/drivers/general/adi_drivers_general.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8282
#define ADI_ALIGNED_ATTRIBUTE(num)
8383
#define ADI_ALIGNED_PRAGMA(num) PRAGMA(data_alignment=num)
8484
#define ADI_UNUSED_ATTRIBUTE
85-
#elif defined (__CC_ARM)
85+
#elif defined (__ARMCC_VERSION)
8686
/* Keil uses a decorator which is placed in the same position as pragmas */
8787
#define ADI_ALIGNED_ATTRIBUTE(num)
88-
#define ADI_ALIGNED_PRAGMA(num) __align(##num)
88+
#define ADI_ALIGNED_PRAGMA(num) __attribute__((aligned(num)))
8989
#define ADI_UNUSED_ATTRIBUTE ATTRIBUTE(unused)
9090
#else
9191
#error "Toolchain not supported"

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/sys/ADuCM302x_device.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
/* pickup register bitfield and bit masks */
2626
#include "ADuCM302x_typedefs.h"
2727

28-
#if defined ( __CC_ARM )
29-
#pragma push
30-
#pragma anon_unions
31-
#endif
32-
33-
3428
#ifndef __IO
3529
#ifdef __cplusplus
3630
#define __I volatile /* read-only */
@@ -1209,9 +1203,4 @@ typedef enum
12091203
#pragma diag(pop)
12101204
#endif /* _MISRA_RULES */
12111205

1212-
1213-
#if defined (__CC_ARM)
1214-
#pragma pop
1215-
#endif
1216-
12171206
#endif

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/sys/ADuCM302x_typedefs.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
#include <stdint.h>
2323
#endif /* _LANGUAGE_C */
2424

25-
#if defined ( __CC_ARM )
26-
#pragma push
27-
#pragma anon_unions
28-
#endif
29-
30-
3125
#if defined (_MISRA_RULES)
3226
/*
3327
anonymous unions violate ISO 9899:1990 and therefore MISRA Rule 1.1.
@@ -9556,9 +9550,4 @@ typedef struct _ADI_NVIC_INTCID3_t {
95569550
#pragma diag(pop)
95579551
#endif /* _MISRA_RULES */
95589552

9559-
9560-
#if defined (__CC_ARM)
9561-
#pragma pop
9562-
#endif
9563-
95649553
#endif

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TARGET_EV_COG_AD4050LZ/device/startup_ADuCM4050.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
4444
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
*
4646
*****************************************************************************/
47-
#ifdef __CC_ARM
47+
#ifdef __ARMCC_VERSION
4848
#include <stdint.h>
4949
#include <rt_misc.h>
5050
#endif
@@ -55,8 +55,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5555
/*----------------------------------------------------------------------------
5656
Checksum options
5757
*----------------------------------------------------------------------------*/
58-
#if defined (__CC_ARM)
59-
__attribute__ ((at(0x000001A0u)))
58+
#if defined (__ARMCC_VERSION)
59+
__attribute__((section(".ARM.__at_0x000001A0")))
6060
#elif defined(__ICCARM__)
6161
__root
6262
#endif
@@ -155,7 +155,7 @@ const pFunc SECTION_PLACE(IVT_NAME[104],VECTOR_SECTION) = {
155155
/*----------------------------------------------------------------------------
156156
* Initialize .bss and .data for GNU
157157
*----------------------------------------------------------------------------*/
158-
#if defined( __GNUC__) && !defined (__CC_ARM)
158+
#if defined( __GNUC__) && !defined (__ARMCC_VERSION)
159159
void zero_bss(void)
160160
{
161161
uint32_t *pSrc, *pDest;
@@ -251,7 +251,7 @@ void Reset_Handler(void)
251251
/* Initialize SRAM configuration. */
252252
SramInit();
253253

254-
#if defined(__GNUC__) && !defined (__CC_ARM)
254+
#if defined(__GNUC__) && !defined (__ARMCC_VERSION)
255255
zero_bss();
256256
#endif
257257

@@ -265,7 +265,7 @@ void Reset_Handler(void)
265265
/*----------------------------------------------------------------------------
266266
Default Handler for Exceptions / Interrupts
267267
*----------------------------------------------------------------------------*/
268-
#if defined(__CC_ARM) || defined (__GNUC__)
268+
#if defined(__ARMCC_VERSION) || defined (__GNUC__)
269269
void Default_Handler(void)
270270
{
271271
while(1);

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TARGET_EV_COG_AD4050LZ/device/startup_ADuCM4050.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,14 @@ RESET_EXCPT_HNDLR
6363

6464
#include <adi_types.h>
6565
#define VECTOR_SECTION ".vectors"
66-
#ifdef __CC_ARM
67-
extern unsigned Image$$ADUCM_HEAP$$Base[];
68-
extern unsigned Image$$ADUCM_HEAP$$ZI$$Limit[];
66+
#ifdef __ARMCC_VERSION
6967
void Default_Handler(void);
70-
#define SECTION_NAME(sectionname) __attribute__ ((section(sectionname)))
71-
#define SECTION_PLACE(def,sectionname) def __attribute__ ((section(sectionname)))
68+
#define SECTION_NAME(sectionname) __attribute__((section(sectionname)))
69+
#define SECTION_PLACE(def,sectionname) def __attribute__((section(sectionname)))
7270
#define IVT_NAME __Vectors
7371
#define RESET_EXCPT_HNDLR __main
7472
#define COMPILER_NAME "ARMCC"
75-
#define WEAK_FUNCTION(x) void x (void) __attribute__ ((weak, alias("Default_Handler")));
73+
#define WEAK_FUNCTION(x) void x (void) __attribute__((weak, alias("Default_Handler")));
7674
#elif defined(__ICCARM__)
7775
/*
7876
* IAR MISRA C 2004 error suppressions:

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/crypto/adi_crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ POSSIBILITY OF SUCH DAMAGE.
121121
#define __ADI_BYTE_SWAP(X) __REV(X)
122122
#elif defined (__GNUC__)
123123
#define __ADI_BYTE_SWAP(X) __builtin_bswap32(X)
124-
#elif defined (__CC_ARM)
124+
#elif defined (__ARMCC_VERSION)
125125
#define __ADI_BYTE_SWAP(X) __rev(X)
126126
#else
127127
#error "This toolchain is not supported"

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/dma/adi_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ ADI_DMA_RESULT adi_dma_RegisterCallback (
272272
/* ARM Cortex-M3/M4, GNU-ARM compiler */
273273
#define ADI_CLZ(X) __builtin_clz(X)
274274

275-
#elif defined(__CC_ARM)
275+
#elif defined(__ARMCC_VERSION)
276276

277277
/* ARM Cortex-M3/M4, Keil compiler */
278278
#define ADI_CLZ(X) __clz(X)

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/drivers/general/adi_drivers_general.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8282
#define ADI_ALIGNED_ATTRIBUTE(num)
8383
#define ADI_ALIGNED_PRAGMA(num) PRAGMA(data_alignment=num)
8484
#define ADI_UNUSED_ATTRIBUTE
85-
#elif defined (__CC_ARM)
85+
#elif defined (__ARMCC_VERSION)
8686
/* Keil uses a decorator which is placed in the same position as pragmas */
8787
#define ADI_ALIGNED_ATTRIBUTE(num)
88-
#define ADI_ALIGNED_PRAGMA(num) __align(##num)
88+
#define ADI_ALIGNED_PRAGMA(num) __attribute__((aligned(num)))
8989
#define ADI_UNUSED_ATTRIBUTE ATTRIBUTE(unused)
9090
#else
9191
#error "Toolchain not supported"

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/sys/adi_ADuCM4050_device.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
/* pickup register bitfield and bit masks */
2626
#include "adi_ADuCM4050_typedefs.h"
2727

28-
#if defined ( __CC_ARM )
29-
#pragma push
30-
#pragma anon_unions
31-
#endif
32-
33-
3428
#ifndef __IO
3529
#ifdef __cplusplus
3630
#define __I volatile /* read-only */
@@ -1330,9 +1324,4 @@ typedef enum
13301324
#pragma diag(pop)
13311325
#endif /* _MISRA_RULES */
13321326

1333-
1334-
#if defined (__CC_ARM)
1335-
#pragma pop
1336-
#endif
1337-
13381327
#endif

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/sys/adi_ADuCM4050_typedefs.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
#include <stdint.h>
2323
#endif /* _LANGUAGE_C */
2424

25-
#if defined ( __CC_ARM )
26-
#pragma push
27-
#pragma anon_unions
28-
#endif
29-
30-
3125
#if defined (_MISRA_RULES)
3226
/*
3327
anonymous unions violate ISO 9899:1990 and therefore MISRA Rule 1.1.
@@ -11244,9 +11238,4 @@ typedef struct _ADI_NVIC_INTCID3_t {
1124411238
#pragma diag(pop)
1124511239
#endif /* _MISRA_RULES */
1124611240

11247-
11248-
#if defined (__CC_ARM)
11249-
#pragma pop
11250-
#endif
11251-
1125211241
#endif

targets/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@
622622
},
623623
"EV_COG_AD4050LZ": {
624624
"inherits": ["Target"],
625-
"core": "Cortex-M4",
625+
"core": "Cortex-M4F",
626626
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
627627
"macros": ["__ADUCM4050__", "EV_COG_AD4050LZ"],
628628
"extra_labels": ["Analog_Devices", "ADUCM4X50", "ADUCM4050", "EV_COG_AD4050LZ", "FLASH_CMSIS_ALGO"],

0 commit comments

Comments
 (0)