Skip to content

Commit 47195bf

Browse files
yeaissadleach02
authored andcommitted
mcux: Add conn_fwk connected_mcu platform files
Based on : https://github.com/nxp-mcuxpresso/mcux-sdk-middleware-connectivity-framework/tree/MCUX_2.16.000 Minimal version
1 parent 9702923 commit 47195bf

File tree

11 files changed

+3067
-1
lines changed

11 files changed

+3067
-1
lines changed

mcux/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Origin:
1717

1818
NXP MCUXpresso SDK Connectivity Framework
1919
https://github.com/nxp-mcuxpresso/mcux-sdk-middleware-connectivity-framework
20-
TAG: MCUX_2.15.000_RW610_RC1
20+
TAG: MCUX_2.15.000_RW610_RC1 - MCUX_2.16.000(For connected_mcu platform files used by MCXW71)
2121

2222
Status:
2323
Some older Kinetis W family SoCs are not supported in MCUXpresso SDK, but
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
/*! *********************************************************************************
2+
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3+
* Copyright 2016-2023 NXP
4+
*
5+
* \file
6+
*
7+
* SPDX-License-Identifier: BSD-3-Clause
8+
********************************************************************************** */
9+
10+
#ifndef EMBEDDEDTYPES_H
11+
#define EMBEDDEDTYPES_H
12+
13+
/************************************************************************************
14+
*
15+
* INCLUDES
16+
*
17+
************************************************************************************/
18+
19+
#include <stdint.h>
20+
21+
#if defined(__IAR_SYSTEMS_ICC__)
22+
#include "iccarm_builtin.h"
23+
#endif /* (__IAR_SYSTEMS_ICC__) */
24+
25+
/************************************************************************************
26+
*
27+
* TYPE DEFINITIONS
28+
*
29+
************************************************************************************/
30+
#if defined(__IAR_SYSTEMS_ICC__)
31+
/* __get_LR() declaration included from "iccarm_builtin.h" to avoid compatibility issues with different versions of IAR
32+
* compiler */
33+
#elif defined(__GNUC__)
34+
#define __get_LR() __builtin_return_address(0)
35+
#elif defined(__CC_ARM)
36+
#define __get_LR() __return_address()
37+
#endif
38+
39+
/* boolean types */
40+
#ifndef HAVE_BOOL_T_DEFINED
41+
typedef uint8_t bool_t; /* boolean data type */
42+
/* Prevent from any further definition by setting and checking HAVE_BOOL_T_DEFINED
43+
Make sure bool_t is defined to uint8_t on other places */
44+
#define HAVE_BOOL_T_DEFINED
45+
#endif
46+
typedef uint8_t index_t;
47+
48+
/* TRUE/FALSE definition*/
49+
#ifndef TRUE
50+
#define TRUE (0 == 0)
51+
#endif
52+
53+
#ifndef FALSE
54+
#define FALSE (0 != 0)
55+
#endif
56+
57+
/* null pointer definition*/
58+
#ifndef NULL
59+
#define NULL ((void *)(0x0UL))
60+
#endif
61+
62+
#if defined(__GNUC__)
63+
#define PACKED_STRUCT struct __attribute__((__packed__))
64+
#define PACKED_UNION union __attribute__((__packed__))
65+
#elif defined(__IAR_SYSTEMS_ICC__)
66+
#define PACKED_STRUCT __packed struct
67+
#define PACKED_UNION __packed union
68+
#elif defined(__CC_ARM)
69+
#define PACKED_STRUCT struct __attribute__((packed))
70+
#define PACKED_UNION union __attribute__((packed))
71+
#else
72+
#warning No definition for PACKED_STRUCT and PACKED_UNION!
73+
#endif
74+
75+
#ifndef WEAK
76+
#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__)
77+
#define WEAK __attribute__((__weak__))
78+
#elif defined(__CC_ARM)
79+
#define WEAK __weak
80+
#endif
81+
#endif
82+
83+
typedef unsigned char uintn8_t;
84+
typedef unsigned long uintn32_t;
85+
86+
typedef unsigned char uchar_t;
87+
88+
#if !defined(MIN)
89+
#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
90+
#endif
91+
92+
#if !defined(MAX)
93+
#define MAX(a, b) (((a) >= (b)) ? (a) : (b))
94+
#endif
95+
96+
/* Compute the number of elements of an array */
97+
#define NumberOfElements(x) (sizeof(x) / sizeof((x)[0]))
98+
99+
/* Compute the size of a string initialized with quotation marks */
100+
#define SizeOfString(string) (sizeof(string) - 1)
101+
102+
#define GetRelAddr(strct, member) ((uint32_t) & (((strct *)(void *)0)->member))
103+
#define GetSizeOfMember(strct, member) sizeof(((strct *)(void *)0)->member)
104+
105+
/* Type definitions for link configuration of instantiable layers */
106+
#define gInvalidInstanceId_c (instanceId_t)(-1)
107+
typedef uint32_t instanceId_t;
108+
109+
/* Bit shift definitions */
110+
#define BIT0 0x01U
111+
#define BIT1 0x02U
112+
#define BIT2 0x04U
113+
#define BIT3 0x08U
114+
#define BIT4 0x10U
115+
#define BIT5 0x20U
116+
#define BIT6 0x40U
117+
#define BIT7 0x80U
118+
#define BIT8 0x100U
119+
#define BIT9 0x200U
120+
#define BIT10 0x400U
121+
#define BIT11 0x800U
122+
#define BIT12 0x1000U
123+
#define BIT13 0x2000U
124+
#define BIT14 0x4000U
125+
#define BIT15 0x8000U
126+
#define BIT16 0x10000U
127+
#define BIT17 0x20000U
128+
#define BIT18 0x40000U
129+
#define BIT19 0x80000U
130+
#define BIT20 0x100000U
131+
#define BIT21 0x200000U
132+
#define BIT22 0x400000U
133+
#define BIT23 0x800000U
134+
#define BIT24 0x1000000U
135+
#define BIT25 0x2000000U
136+
#define BIT26 0x4000000U
137+
#define BIT27 0x8000000U
138+
#define BIT28 0x10000000U
139+
#define BIT29 0x20000000U
140+
#define BIT30 0x40000000U
141+
#define BIT31 0x80000000U
142+
143+
/* Shift definitions */
144+
#define SHIFT0 (0U)
145+
#define SHIFT1 (1U)
146+
#define SHIFT2 (2U)
147+
#define SHIFT3 (3U)
148+
#define SHIFT4 (4U)
149+
#define SHIFT5 (5U)
150+
#define SHIFT6 (6U)
151+
#define SHIFT7 (7U)
152+
#define SHIFT8 (8U)
153+
#define SHIFT9 (9U)
154+
#define SHIFT10 (10U)
155+
#define SHIFT11 (11U)
156+
#define SHIFT12 (12U)
157+
#define SHIFT13 (13U)
158+
#define SHIFT14 (14U)
159+
#define SHIFT15 (15U)
160+
#define SHIFT16 (16U)
161+
#define SHIFT17 (17U)
162+
#define SHIFT18 (18U)
163+
#define SHIFT19 (19U)
164+
#define SHIFT20 (20U)
165+
#define SHIFT21 (21U)
166+
#define SHIFT22 (22U)
167+
#define SHIFT23 (23U)
168+
#define SHIFT24 (24U)
169+
#define SHIFT25 (25U)
170+
#define SHIFT26 (26U)
171+
#define SHIFT27 (27U)
172+
#define SHIFT28 (28U)
173+
#define SHIFT29 (29U)
174+
#define SHIFT30 (30U)
175+
#define SHIFT31 (31U)
176+
177+
#define SHIFT32 (32U)
178+
#define SHIFT33 (33U)
179+
#define SHIFT34 (34U)
180+
#define SHIFT35 (35U)
181+
#define SHIFT36 (36U)
182+
#define SHIFT37 (37U)
183+
#define SHIFT38 (38U)
184+
#define SHIFT39 (39U)
185+
#define SHIFT40 (40U)
186+
#define SHIFT41 (41U)
187+
#define SHIFT42 (42U)
188+
#define SHIFT43 (43U)
189+
#define SHIFT44 (44U)
190+
#define SHIFT45 (45U)
191+
#define SHIFT46 (46U)
192+
#define SHIFT47 (47U)
193+
#define SHIFT48 (48U)
194+
#define SHIFT49 (49U)
195+
#define SHIFT50 (50U)
196+
#define SHIFT51 (51U)
197+
#define SHIFT52 (52U)
198+
#define SHIFT53 (53U)
199+
#define SHIFT54 (54U)
200+
#define SHIFT55 (55U)
201+
#define SHIFT56 (56U)
202+
#define SHIFT57 (57U)
203+
#define SHIFT58 (58U)
204+
#define SHIFT59 (59U)
205+
#define SHIFT60 (60U)
206+
#define SHIFT61 (61U)
207+
#define SHIFT62 (62U)
208+
#define SHIFT63 (63U)
209+
210+
#define NOT_USED(__x) (void)(__x)
211+
212+
#endif /* EMBEDDEDTYPES_H */
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
/*
2+
* Copyright 2022-2023 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _FWK_CONFIG_H_
8+
#define _FWK_CONFIG_H_
9+
10+
#include "fwk_platform_definitions.h"
11+
12+
/*********************************************************************
13+
* General
14+
*********************************************************************/
15+
16+
/* Defines the calibration duration of the ADC, it will block the task during this time in milisec before trigger the
17+
* ADC on a channel*/
18+
#define gSensorsAdcCalibrationDurationInMs_c 4U
19+
20+
/*
21+
* KW45/K32W148 CM33 core has the DSP extension (__DSP_PRESENT), which allows the use of the NXP UltraFast EC P256
22+
* library The flags may be set to 0 if this library is not required. It mainly makes sense for Matter SPAKE2P
23+
* procedures and for BLE point validation.
24+
*/
25+
#define gSecLibUseDspExtension_d 1
26+
27+
/*********************************************************************
28+
* HW parameters enablement and placement
29+
*********************************************************************/
30+
31+
#if !defined(gPlatformUseHwParameter_d)
32+
#define gPlatformUseHwParameter_d 1
33+
#endif
34+
/*
35+
* gHwParamsProdDataMainFlashMode_c HWParameters PROD_DATA remain at top of main flash,
36+
* where the linker script defines PROD_DATA_BASE_ADDR.
37+
* When transiting from MainFlashMode to IfrMode, an interim mode MainFlash2IfrMode is used to
38+
* enable the transfer of HWParameters from the main flash to the IFR.
39+
* After this has been applied the size of the PROD_DATA reserved space in the linker script
40+
* will be made 0 in order to gain a sector.
41+
* These modes are used to configure gHwParamsProdDataPlacement_c
42+
*/
43+
#define gHwParamsProdDataMainFlashMode_c 0
44+
#define gHwParamsProdDataMainFlash2IfrMode_c 1
45+
#define gHwParamsProdDataIfrMode_c 2
46+
47+
/*
48+
* Place Application FactoryData in same sector as ProdData.
49+
* HWParameters and App Factory Data being colocated has an implication on the life cycle of information stored in the
50+
* sector.
51+
*/
52+
#ifndef gHwParamsAppFactoryDataExtension_d
53+
#define gHwParamsAppFactoryDataExtension_d 0
54+
#endif
55+
56+
/*
57+
* To be defined as 1 if NV_WriteHWParameters is liable to be invoked after Application Factory Data were written,
58+
* and you intend not to have to preprogram them. Default to 0, assuming that this can happne in the context of
59+
* a factory reset. Not needed if gHwParamsAppFactoryDataExtension_d is not set.
60+
*/
61+
#if (gHwParamsAppFactoryDataExtension_d != 0)
62+
#ifndef gHwParamsAppFactoryDataPreserveOnHwParamUpdate_d
63+
#define gHwParamsAppFactoryDataPreserveOnHwParamUpdate_d 0
64+
#endif
65+
#else
66+
#define gHwParamsAppFactoryDataPreserveOnHwParamUpdate_d 0
67+
#endif
68+
/*
69+
* Define gHwParamsProdDataPlacement_c as :
70+
* - gHwParamsProdDataMainFlash_c if you mean to remain backward compatible.
71+
* - gHwParamsProdDataMainFlash2IfrMode_c if you wish to conserve previous
72+
* HWParameter setting (MAC addresses, xtal trimming data) during migration phase.
73+
* - gHwParamsProdDataPlacementIfrMode_c for new devices or once gHwParamsProdDataMainFlash2IfrMode_c
74+
* mode has populated the IFR with legacy values. -> after this phase update linker script to remove
75+
* flash space reserved for PROD_DATA.
76+
*/
77+
#ifndef gHwParamsProdDataPlacement_c
78+
#define gHwParamsProdDataPlacement_c gHwParamsProdDataMainFlashMode_c
79+
//#define gHwParamsProdDataPlacement_c gHwParamsProdDataMainFlash2IfrMode_c
80+
//#define gHwParamsProdDataPlacement_c gHwParamsProdDataIfrMode_c
81+
#endif
82+
83+
#if (gHwParamsProdDataPlacement_c == gHwParamsProdDataMainFlashMode_c)
84+
#define PROD_DATA_FLASH_ADDR (MAIN_FLASH_PROD_DATA_ADDR + PROD_DATA_OFFSET)
85+
#define USER_DATA_SECTOR PROD_DATA_FLASH_ADDR
86+
#else
87+
/*
88+
* IFR_RSVD_SZ may be undefined or set to 0 if no reserved space is required.
89+
* However keep it as 0x600 during the internal development phase.
90+
*/
91+
#define IFR_RSVD_SZ 0x600
92+
93+
#if (defined IFR_RSVD_SZ) && (IFR_RSVD_SZ > 0)
94+
#define PROD_DATA_FLASH_ADDR (IFR_USER_ADDR + IFR_RSVD_SZ + PROD_DATA_OFFSET)
95+
#else
96+
#define PROD_DATA_FLASH_ADDR (IFR_USER_ADDR + PROD_DATA_OFFSET)
97+
#endif
98+
#define USER_DATA_SECTOR PROD_DATA_FLASH_ADDR
99+
#endif
100+
101+
#ifdef gHwParamsAppFactoryDataExtension_d
102+
#define APP_FACTORY_DATA_FLASH_ADDR (PROD_DATA_FLASH_ADDR + APP_FACTORY_DATA_OFFSET)
103+
#endif
104+
105+
/*********************************************************************
106+
* Reset Method
107+
* Define the alternative method from warm reset to use for Device reset
108+
* when calling PLATFORM_ResetCpu()
109+
*********************************************************************/
110+
#define gUseResetByNvicReset_c 1
111+
#define gUseResetByLvdForce_c 2
112+
#define gUseResetByDeepPowerDown_c 3
113+
114+
#if !defined(gPlatResetMethod_c)
115+
#if defined(FPGA_SUPPORT) && (FPGA_SUPPORT == 1)
116+
#define gPlatResetMethod_c gUseResetByNvicReset_c
117+
#else
118+
#define gPlatResetMethod_c gUseResetByDeepPowerDown_c
119+
#endif
120+
#endif
121+
122+
/*********************************************************************
123+
* Flash check for ECC error after IFR OT_CFG programming.
124+
*
125+
* Defaults to 1 to avoid bus fault in case of error
126+
* Temporarily leave as 0 to before full OTA testing is done.
127+
*********************************************************************/
128+
#ifndef gOtaCheckEccFaults_d
129+
#define gOtaCheckEccFaults_d 1
130+
#endif
131+
132+
/*********************************************************************
133+
* NVS Sector size is necessarily a multiple of physical flash sector size.
134+
*
135+
* Defaults to 1 because 8kB is already pretty large. cannot exceed 8 sectors.
136+
*
137+
*********************************************************************/
138+
#ifndef gPlatNvsSectorSize_c
139+
#define gPlatNvsSectorSize_c (PLATFORM_INTFLASH_SECTOR_SIZE * 1u)
140+
#endif
141+
142+
/*********************************************************************
143+
* RNG source of entropy
144+
*********************************************************************/
145+
146+
/* On connected_mcu platform the only source of entropy disponible is the S200 */
147+
#ifndef gRngUseSecureSubSystem_d
148+
#define gRngUseSecureSubSystem_d 1
149+
#endif
150+
151+
#if defined(gRngUseSecureSubSystem_d) && (gRngUseSecureSubSystem_d == 0)
152+
#warning \
153+
"On connected_mcu the only source of entropy is the S200, RNG will not be properly initialized if this flag is not enabled"
154+
#endif
155+
156+
#endif /* _FWK_CONFIG_H_ */

0 commit comments

Comments
 (0)