This commit is contained in:
Koen Kanters 2019-04-23 21:24:30 +02:00
parent e0b3bc29fc
commit c36ba37ebb
3 changed files with 51 additions and 16 deletions

View File

@ -13,13 +13,13 @@
4. You will get a warning: *The project file 'CC253(0/1).ewp' is in an old format. Would you like to convert it for use with this version?*. Press **yes** for both.
5. Select the correct target:
- For CC2531 select *CC2531 - X*
- For CC2530 or CC2530_CC2591 select *CC2530 - X*
- For CC2530, CC2530_CC2591, CC2530_CC2592 select *CC2530 - X*
- Depending if you want to compile the `.hex` or SBL firmware select *- ProdHex* or *- ProdSBL*
![Target](images/target.png)
6. Right-click on your target and press options. Go to C/C++ compiler -> preprocessor. Depending on what you want to compile, add the following symbols to *Defined symbols*:
- Device type: `FIRMWARE_CC2530`, `FIRMWARE_CC2530_CC2531` or `FIRMWARE_CC2531`.
- Device type: `FIRMWARE_CC2530`, `FIRMWARE_CC2530_CC2591`, `FIRMWARE_CC2531` or `FIRMWARE_CC2530_CC2592`
- Firmware type: `FIRMWARE_DEFAULT`, `FIRMWARE_MAX_STABILITY` or `FIRMWARE_MAX_DEVICES`.
- In case you want to compile the SBL firmware, also add `FIRMWARE_SBL`.

View File

@ -1,12 +1,43 @@
diff --git a/Components/hal/target/CC2530ZNP/hal_board_cfg.h b/Components/hal/target/CC2530ZNP/hal_board_cfg.h
index 0459c86..1e40362 100644
--- a/Components/hal/target/CC2530ZNP/hal_board_cfg.h
+++ b/Components/hal/target/CC2530ZNP/hal_board_cfg.h
@@ -314,7 +314,7 @@ extern unsigned char znpCfg0;
*/
/* ----------- RF-frontend Connection Initialization ---------- */
-#if defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590
+#if defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590 || defined HAL_PA_LNA_CC2592
extern void MAC_RfFrontendSetup(void);
#define HAL_BOARD_RF_FRONTEND_SETUP() MAC_RfFrontendSetup()
#else
@@ -343,7 +343,7 @@ extern void MAC_RfFrontendSetup(void);
#endif
/* ----------- Board Initialization ---------- */
-#if defined (HAL_BOARD_CC2530EB_REV17) && !defined (HAL_PA_LNA) && !defined (HAL_PA_LNA_CC2590)
+#if defined (HAL_BOARD_CC2530EB_REV17) && !defined (HAL_PA_LNA) && !defined (HAL_PA_LNA_CC2590) && !defined (HAL_PA_LNA_CC2592)
#define HAL_BOARD_INIT() st \
( \
@@ -362,7 +362,7 @@ extern void MAC_RfFrontendSetup(void);
PREFETCH_ENABLE(); \
)
-#elif defined (HAL_BOARD_CC2530EB_REV13) || defined (HAL_PA_LNA) || defined (HAL_PA_LNA_CC2590)
+#elif defined (HAL_BOARD_CC2530EB_REV13) || defined (HAL_PA_LNA) || defined (HAL_PA_LNA_CC2590)|| defined (HAL_PA_LNA_CC2592)
#ifdef HAL_ENABLE_WIFI_COEX_PINS
#define HAL_BOARD_ENABLE_WIFI_COEX_PINS() st \
diff --git a/Components/mt/MT_SYS.c b/Components/mt/MT_SYS.c
index 35aae57..a74d800 100644
index 35aae57..1f8ee82 100644
--- a/Components/mt/MT_SYS.c
+++ b/Components/mt/MT_SYS.c
@@ -2141,6 +2141,21 @@ static void MT_SysSnifferParameters( uint8 *pBuf )
*****************************************************************************/
static void powerOffSoc(void)
{
+#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591)
+#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591) || defined(FIRMWARE_CC2530_CC2592)
+ HAL_DISABLE_INTERRUPTS();
+ STIF = 0; //HAL_SLEEP_TIMER_CLEAR_INT;
+ if (ZNP_CFG1_UART == znpCfg1)
@ -94,7 +125,7 @@ index 242be04..cca4781 100644
/*********************************************************************
diff --git a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c
index 7c6c77e..c99b840 100644
index 7c6c77e..69daba2 100644
--- a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c
+++ b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c
@@ -24,7 +24,7 @@
@ -110,7 +141,7 @@ index 7c6c77e..c99b840 100644
#if defined CC2531ZNP
znpCfg1 = ZNP_CFG1_UART;
+#elif defined FIRMWARE_CC2530_CC2591
+#elif defined FIRMWARE_CC2530_CC2591 || defined(FIRMWARE_CC2530_CC2592)
+ znpCfg1 = ZNP_CFG1_UART;
+ znpCfg0 = ZNP_CFG0_32K_OSC;
#elif defined CC2530_MK
@ -126,10 +157,10 @@ index 7c6c77e..c99b840 100644
znpCfg1 = P2_0;
diff --git a/Projects/zstack/ZNP/CC253x/Source/preinclude.h b/Projects/zstack/ZNP/CC253x/Source/preinclude.h
new file mode 100644
index 0000000..f1a30c7
index 0000000..62f9a55
--- /dev/null
+++ b/Projects/zstack/ZNP/CC253x/Source/preinclude.h
@@ -0,0 +1,115 @@
@@ -0,0 +1,119 @@
+// Shared accross all firmwares
+#define ASSERT_RESET
+
@ -217,13 +248,17 @@ index 0000000..f1a30c7
+ #endif
+
+/**
+ * CC2530 + CC2591
+ * CC2530 + CC2591/CC2592
+ */
+#elif defined FIRMWARE_CC2530_CC2591
+#elif defined FIRMWARE_CC2530_CC2591 || defined FIRMWARE_CC2530_CC2592
+ #define ENABLE_MT_SYS_RESET_SHUTDOWN
+ #define ZTOOL_P1
+ #define HAL_UART_DMA_RX_MAX 128
+ #define HAL_PA_LNA
+ #if defined FIRMWARE_CC2530_CC2591
+ #define HAL_PA_LNA
+ #elif defined FIRMWARE_CC2530_CC2592
+ #define HAL_PA_LNA_CC2592
+ #endif
+ #define OPTIMIZE_LARGE_NETWORK
+
+ #if defined FIRMWARE_DEFAULT
@ -261,7 +296,7 @@ index 7e524a9..6326400 100644
+--preinclude=preinclude.h
\ No newline at end of file
diff --git a/Projects/zstack/ZNP/Source/znp_app.c b/Projects/zstack/ZNP/Source/znp_app.c
index 470ff12..c646a87 100644
index 470ff12..c2905db 100644
--- a/Projects/zstack/ZNP/Source/znp_app.c
+++ b/Projects/zstack/ZNP/Source/znp_app.c
@@ -390,12 +390,23 @@ static void npInit(void)
@ -269,14 +304,14 @@ index 470ff12..c646a87 100644
uartConfig.configured = TRUE;
+
+#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591)
+#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591) || defined(FIRMWARE_CC2530_CC2592)
+ uartConfig.baudRate = HAL_UART_BR_115200;
+#else
uartConfig.baudRate = ZNP_UART_BAUD;
-#ifdef ZNP_ALT
+#endif
+
+#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591)
+#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591) || defined(FIRMWARE_CC2530_CC2592)
uartConfig.flowControl = FALSE;
#else
+ #ifdef ZNP_ALT
@ -294,9 +329,9 @@ index 470ff12..c646a87 100644
HalUARTOpen(HAL_UART_PORT, &uartConfig);
MT_UartRegisterTaskID(znpTaskId);
+
+#if defined FIRMWARE_CC2530_CC2591
+#if defined FIRMWARE_CC2530_CC2591 || defined(FIRMWARE_CC2530_CC2592)
+ //Add TX Setting
+ #ifdef HAL_PA_LNA
+ #ifdef HAL_PA_LNA || HAL_PA_LNA_CC2592
+ ZMacSetTransmitPower(TX_PWR_PLUS_19);
+ #else
+ ZMacSetTransmitPower(TX_PWR_PLUS_4);