mirror of
https://github.com/Koenkk/Z-Stack-firmware.git
synced 2025-01-03 21:27:34 +01:00
Firmware update (#147)
MTO and Source Routing are enabled. Device limit increased. RSSI offset corrected. TX power increased.
This commit is contained in:
parent
ac6ffe3110
commit
067e05a208
Binary file not shown.
Binary file not shown.
@ -1,48 +1,8 @@
|
||||
From 39b182bf308683304840b23b31923ca75849d811 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Gavr <reverieline@gmail.com>
|
||||
Date: Wed, 29 Jan 2020 10:01:25 +0200
|
||||
Subject: [PATCH] Basic MODKAMRU_V3 patch
|
||||
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
new file mode 100644
|
||||
index 0000000..8a8c68b
|
||||
--- /dev/null
|
||||
+++ b/.gitignore
|
||||
@@ -0,0 +1,27 @@
|
||||
+*.html
|
||||
+*.txt
|
||||
+!note.txt
|
||||
+*.eww
|
||||
+*.ewd
|
||||
+*.ewp
|
||||
+*.pdf
|
||||
+*.s51
|
||||
+*.xcl
|
||||
+*.exe
|
||||
+*.lib
|
||||
+*.dep
|
||||
+
|
||||
+Accessories/
|
||||
+Components/hal/target/CC2530USB/usb/driver/
|
||||
+_iss/
|
||||
+Tools/
|
||||
+Projects/zstack/Libraries/
|
||||
+Projects/zstack/OTA/Boot/CC2538/Image Boot Manager/
|
||||
+Projects/zstack/Utilities/BootLoad/CC2538_SPI/bin/
|
||||
+Projects/zstack/Utilities/BootLoad/CC2538_UART/bin/
|
||||
+Projects/zstack/ZNP/CC2538/bin/
|
||||
+Projects/zstack/ZNP/CC2538/dev/
|
||||
+Projects/zstack/ZNP/CC253x/bin/
|
||||
+Projects/zstack/ZNP/CC253x/dev/
|
||||
+Projects/zstack/ZNP/CC2538/CC2538ZNP-Debug/
|
||||
+Projects/zstack/ZNP/CC2538/settings/
|
||||
\ No newline at end of file
|
||||
diff --git a/Components/bsp/srf06eb_cc2538/drivers/source/bsp.h b/Components/bsp/srf06eb_cc2538/drivers/source/bsp.h
|
||||
index 38ac3d9..44c0d5b 100644
|
||||
index 38ac3d9..367699d 100644
|
||||
--- a/Components/bsp/srf06eb_cc2538/drivers/source/bsp.h
|
||||
+++ b/Components/bsp/srf06eb_cc2538/drivers/source/bsp.h
|
||||
@@ -81,15 +81,21 @@ extern "C"
|
||||
@@ -81,16 +81,22 @@ extern "C"
|
||||
#define BSP_3V3_EN GPIO_PIN_4 //!< PB4
|
||||
|
||||
// Board LED defines
|
||||
@ -55,6 +15,7 @@ index 38ac3d9..44c0d5b 100644
|
||||
- BSP_LED_2 | \
|
||||
- BSP_LED_3 | \
|
||||
- BSP_LED_4) //!< Bitmask of all LEDs
|
||||
-
|
||||
+#ifdef MODKAMRU_V3 // Redefine board LEDs
|
||||
+ #define BSP_LED_BASE GPIO_B_BASE
|
||||
+ #define BSP_LED_1 GPIO_PIN_1
|
||||
@ -70,22 +31,24 @@ index 38ac3d9..44c0d5b 100644
|
||||
+ #define BSP_LED_4 GPIO_PIN_3 //!< PC3
|
||||
+ #define BSP_LED_ALL (BSP_LED_1 | BSP_LED_2 | BSP_LED_3 | BSP_LED_4) //!< Bitmask of all LEDs
|
||||
+#endif
|
||||
|
||||
+
|
||||
// Board key defines
|
||||
#define BSP_KEY_DIR_BASE GPIO_C_BASE //!< Base for left/right/up/down
|
||||
#define BSP_KEY_SEL_BASE GPIO_A_BASE //!< Base for Select
|
||||
diff --git a/Components/hal/include/hal_led.h b/Components/hal/include/hal_led.h
|
||||
index bb327f1..846dea2 100644
|
||||
index bb327f1..f8a88b2 100644
|
||||
--- a/Components/hal/include/hal_led.h
|
||||
+++ b/Components/hal/include/hal_led.h
|
||||
@@ -87,6 +87,19 @@ extern "C"
|
||||
@@ -86,6 +86,19 @@ extern "C"
|
||||
/*********************************************************************
|
||||
* GLOBAL VARIABLES
|
||||
*/
|
||||
|
||||
+
|
||||
+#ifdef MODKAMRU_V3 //LED control helpers
|
||||
+ /* Dynamically enable/disable LEDs */
|
||||
+ extern bool gbModkamUseLeds;
|
||||
+ extern void modkamUseLeds(bool);
|
||||
+
|
||||
+
|
||||
+ /* LED control macros */
|
||||
+#define MODKAM_LED_ON(leds) {if(gbModkamUseLeds)HalLedSet(leds,HAL_LED_MODE_ON);}
|
||||
+#define MODKAM_LED_OFF(leds) {if(gbModkamUseLeds)HalLedSet(leds,HAL_LED_MODE_OFF);}
|
||||
@ -93,12 +56,11 @@ index bb327f1..846dea2 100644
|
||||
+#define MODKAM_LED_BLINK_LONG(leds) MODKAM_LED_BLINK(leds,1,90,1000)
|
||||
+#define MODKAM_LED_BLINK_SHORT(leds) MODKAM_LED_BLINK(leds,1,50,100)
|
||||
+#endif
|
||||
+
|
||||
|
||||
/*
|
||||
* Initialize LED Service.
|
||||
*/
|
||||
diff --git a/Components/hal/target/CC2538ZNP/hal_board_cfg.h b/Components/hal/target/CC2538ZNP/hal_board_cfg.h
|
||||
index 0bc45b5..3de1993 100644
|
||||
index 0bc45b5..9f28629 100644
|
||||
--- a/Components/hal/target/CC2538ZNP/hal_board_cfg.h
|
||||
+++ b/Components/hal/target/CC2538ZNP/hal_board_cfg.h
|
||||
@@ -231,7 +231,7 @@ extern unsigned char znpCfg0;
|
||||
@ -110,7 +72,16 @@ index 0bc45b5..3de1993 100644
|
||||
#define HAL_NV_PAGE_BEG (HAL_NV_PAGE_END-HAL_NV_PAGE_CNT+1)
|
||||
#define HAL_NV_START_ADDR ((FLASH_BASE) + (HAL_NV_PAGE_BEG * HAL_FLASH_PAGE_SIZE))
|
||||
|
||||
@@ -300,6 +300,7 @@ extern void MAC_RfFrontendSetup(void);
|
||||
@@ -280,7 +280,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
|
||||
@@ -300,13 +300,14 @@ extern void MAC_RfFrontendSetup(void);
|
||||
/* ----------- Board Initialization ---------- */
|
||||
#define HAL_BOARD_INIT() \
|
||||
{ \
|
||||
@ -118,6 +89,14 @@ index 0bc45b5..3de1993 100644
|
||||
HAL_BOARD_COMMON_INIT() \
|
||||
HAL_BOARD_PA_LNA_INIT(); \
|
||||
HAL_BOARD_RF_FRONTEND_SETUP(); \
|
||||
}
|
||||
|
||||
|
||||
-#ifdef HAL_PA_LNA
|
||||
+#if defined HAL_PA_LNA || defined HAL_PA_LNA_CC2592
|
||||
#define HAL_BOARD_PA_LNA_INIT() st(GPIOPinTypeGPIOOutput(HGM_BASE, HGM_PIN); )
|
||||
#else
|
||||
#define HAL_BOARD_PA_LNA_INIT()
|
||||
@@ -340,15 +341,34 @@ extern void MAC_RfFrontendSetup(void);
|
||||
}
|
||||
|
||||
@ -292,22 +271,22 @@ index aa57766..9b3cb3d 100644
|
||||
// Plug the SBL revision indication
|
||||
UINT32_TO_BUF_LITTLE_ENDIAN(pBuf,sblRev);
|
||||
diff --git a/Components/mt/MT_UTIL.c b/Components/mt/MT_UTIL.c
|
||||
index b4a24d8..d9e461d 100644
|
||||
index b4a24d8..68d7ceb 100644
|
||||
--- a/Components/mt/MT_UTIL.c
|
||||
+++ b/Components/mt/MT_UTIL.c
|
||||
@@ -922,6 +922,12 @@ static void MT_UtilLedControl(uint8 *pBuf)
|
||||
@@ -921,6 +921,12 @@ static void MT_UtilLedControl(uint8 *pBuf)
|
||||
/* LED and Mode */
|
||||
iLed = *pBuf++;
|
||||
iMode = *pBuf;
|
||||
|
||||
+
|
||||
+#ifdef MODKAMRU_V3
|
||||
+ if(iMode==0)
|
||||
+ modkamUseLeds(false);
|
||||
+ else modkamUseLeds(true);
|
||||
+#endif
|
||||
+
|
||||
|
||||
if ( iLed == 1 )
|
||||
Led = HAL_LED_1;
|
||||
else if ( iLed == 2 )
|
||||
diff --git a/Components/mt/MT_VERSION.c b/Components/mt/MT_VERSION.c
|
||||
index f374554..f2e3de9 100644
|
||||
--- a/Components/mt/MT_VERSION.c
|
||||
@ -327,7 +306,7 @@ index 0000000..636ccc8
|
||||
--- /dev/null
|
||||
+++ b/Components/mt/revision_info.h
|
||||
@@ -0,0 +1 @@
|
||||
+#define CODE_REVISION_NUMBER 20200128
|
||||
+#define CODE_REVISION_NUMBER 20200211
|
||||
\ No newline at end of file
|
||||
diff --git a/Components/osal/mcu/cc2538/osal_nv.c b/Components/osal/mcu/cc2538/osal_nv.c
|
||||
index 9275e64..7e2fee5 100644
|
||||
@ -434,7 +413,7 @@ index d170283..e251f15 100644
|
||||
//========== TouchLink NWK configuration ===============
|
||||
// Values used by Router when starts a network as initiator
|
||||
diff --git a/Components/stack/zdo/ZDObject.c b/Components/stack/zdo/ZDObject.c
|
||||
index dcb6efa..4bbb646 100644
|
||||
index dcb6efa..29c8adc 100644
|
||||
--- a/Components/stack/zdo/ZDObject.c
|
||||
+++ b/Components/stack/zdo/ZDObject.c
|
||||
@@ -76,6 +76,10 @@
|
||||
@ -452,7 +431,7 @@ index dcb6efa..4bbb646 100644
|
||||
#endif
|
||||
|
||||
duration = inMsg->asdu[ZDP_MGMT_PERMIT_JOIN_REQ_DURATION];
|
||||
+
|
||||
+
|
||||
+#ifdef MODKAMRU_V3
|
||||
+ if(duration==0)
|
||||
+ MODKAM_LED_OFF(HAL_LED_3)
|
||||
@ -461,6 +440,22 @@ index dcb6efa..4bbb646 100644
|
||||
// Per R21 Spec this field is not longer relevant 2.4.3.3.7.2 (Mgmt_Permit_Joining_req Effect on Receipt)
|
||||
//tcsig = inMsg->asdu[ZDP_MGMT_PERMIT_JOIN_REQ_TC_SIG];
|
||||
|
||||
diff --git a/Components/zmac/ZMAC.h b/Components/zmac/ZMAC.h
|
||||
index d658113..f4e7142 100644
|
||||
--- a/Components/zmac/ZMAC.h
|
||||
+++ b/Components/zmac/ZMAC.h
|
||||
@@ -458,7 +458,10 @@ typedef enum
|
||||
TX_PWR_PLUS_16,
|
||||
TX_PWR_PLUS_17,
|
||||
TX_PWR_PLUS_18,
|
||||
- TX_PWR_PLUS_19
|
||||
+ TX_PWR_PLUS_19,
|
||||
+ TX_PWR_PLUS_20,
|
||||
+ TX_PWR_PLUS_21,
|
||||
+ TX_PWR_PLUS_22
|
||||
} ZMacTransmitPower_t; // The transmit power in units of -1 dBm.
|
||||
|
||||
typedef struct
|
||||
diff --git a/Projects/zstack/Tools/CC2538DB/CC2538.icf b/Projects/zstack/Tools/CC2538DB/CC2538.icf
|
||||
index d4c95cc..cb8abf6 100644
|
||||
--- a/Projects/zstack/Tools/CC2538DB/CC2538.icf
|
||||
@ -492,6 +487,19 @@ index d4c95cc..cb8abf6 100644
|
||||
|
||||
//
|
||||
// Define a block for the heap. The size should be set to something other
|
||||
diff --git a/Projects/zstack/Tools/CC2538DB/f8wConfig.cfg b/Projects/zstack/Tools/CC2538DB/f8wConfig.cfg
|
||||
index 9d2c1bf..328cbbb 100644
|
||||
--- a/Projects/zstack/Tools/CC2538DB/f8wConfig.cfg
|
||||
+++ b/Projects/zstack/Tools/CC2538DB/f8wConfig.cfg
|
||||
@@ -119,7 +119,7 @@
|
||||
-DMAX_POLL_FAILURE_RETRIES=2
|
||||
|
||||
/* The number of items in the broadcast table */
|
||||
--DMAX_BCAST=9
|
||||
+//-DMAX_BCAST=9
|
||||
|
||||
/* The maximum number of groups in the groups table */
|
||||
-DAPS_MAX_GROUPS=16
|
||||
diff --git a/Projects/zstack/ZMain/TI2538ZNP/OnBoard.h b/Projects/zstack/ZMain/TI2538ZNP/OnBoard.h
|
||||
index 02bce67..3271563 100644
|
||||
--- a/Projects/zstack/ZMain/TI2538ZNP/OnBoard.h
|
||||
@ -519,7 +527,7 @@ index 02bce67..3271563 100644
|
||||
/* Restart system from absolute beginning
|
||||
* Disables interrupts, forces WatchDog reset
|
||||
diff --git a/Projects/zstack/ZMain/TI2538ZNP/ZMain.c b/Projects/zstack/ZMain/TI2538ZNP/ZMain.c
|
||||
index 5febd92..b2d54d3 100644
|
||||
index 5febd92..0d3a44f 100644
|
||||
--- a/Projects/zstack/ZMain/TI2538ZNP/ZMain.c
|
||||
+++ b/Projects/zstack/ZMain/TI2538ZNP/ZMain.c
|
||||
@@ -48,6 +48,10 @@
|
||||
@ -533,42 +541,65 @@ index 5febd92..b2d54d3 100644
|
||||
#ifndef NONWK
|
||||
#include "AF.h"
|
||||
#endif
|
||||
@@ -161,6 +165,13 @@ int main( void )
|
||||
@@ -160,6 +164,13 @@ int main( void )
|
||||
/* If WDT is used, this is a good place to enable it. */
|
||||
WatchDogEnable( WDTIMX );
|
||||
#endif
|
||||
|
||||
+
|
||||
+#ifdef MODKAMRU_V3
|
||||
+ // Test all LEDs
|
||||
+ MODKAM_LED_BLINK_LONG(HAL_LED_ALL);
|
||||
+ // Power LED on
|
||||
+ MODKAM_LED_ON(HAL_LED_1);
|
||||
+#endif
|
||||
+
|
||||
|
||||
osal_start_system(); /* No Return from here */
|
||||
|
||||
return 0; /* Shouldn't get here. */
|
||||
diff --git a/Projects/zstack/ZNP/Source/znp.cfg b/Projects/zstack/ZNP/Source/znp.cfg
|
||||
index 2b8d56d..3de9bd9 100644
|
||||
index 2b8d56d..b7fc48a 100644
|
||||
--- a/Projects/zstack/ZNP/Source/znp.cfg
|
||||
+++ b/Projects/zstack/ZNP/Source/znp.cfg
|
||||
@@ -107,3 +107,14 @@
|
||||
@@ -107,3 +107,38 @@
|
||||
-DMT_APP_FUNC
|
||||
-DMT_APP_CNF_FUNC
|
||||
|
||||
+//Additional flags
|
||||
+-DMODKAMRU_V3
|
||||
+
|
||||
+-DINCLUDE_REVISION_INFORMATION
|
||||
+-DMT_SYS_KEY_MANAGEMENT=1
|
||||
+-DTP2_LEGACY_ZC
|
||||
+-DHAL_PA_LNA
|
||||
+-DHAL_PA_LNA_CC2592
|
||||
+-DMULTICAST_ENABLED=FALSE
|
||||
+
|
||||
+//-DHAL_PA_LNA
|
||||
+-DHAL_PA_LNA_CC2592
|
||||
+-DHAL_LED=TRUE
|
||||
+-DBLINK_LEDS
|
||||
+-DHAL_LCD=FALSE
|
||||
+
|
||||
+-DMODKAMRU_V3
|
||||
\ No newline at end of file
|
||||
+
|
||||
+/* Large netrowk optimizations (MTO, Source Routing) */
|
||||
+-DINT_HEAP_LEN=12288
|
||||
+-DNWK_MAX_DEVICE_LIST=80
|
||||
+-DCONCENTRATOR_ENABLE=TRUE
|
||||
+-DCONCENTRATOR_DISCOVERY_TIME=120
|
||||
+-DMAX_RTG_SRC_ENTRIES=400
|
||||
+-DMAX_NEIGHBOR_ENTRIES=100
|
||||
+-DSRC_RTG_EXPIRY_TIME=10
|
||||
+-DCONCENTRATOR_ROUTE_CACHE=TRUE
|
||||
+-DMTO_RREQ_LIMIT_TIME=5000
|
||||
+
|
||||
+-DLINK_DOWN_TRIGGER=6
|
||||
+-DNWK_ROUTE_AGE_LIMIT=12
|
||||
+-DBCAST_DELIVERY_TIME=100
|
||||
+-DMAX_BCAST=12
|
||||
+//-DDEF_NWK_RADIUS=15
|
||||
+//-DDEFAULT_ROUTE_REQUEST_RADIUS=8
|
||||
+-DROUTE_DISCOVERY_TIME=13
|
||||
+//-DZDNWKMGR_MIN_TRANSMISSIONS=0
|
||||
+-DNWK_LINK_STATUS_PERIOD=60
|
||||
diff --git a/Projects/zstack/ZNP/Source/znp_app.c b/Projects/zstack/ZNP/Source/znp_app.c
|
||||
index 31b115e..9575690 100644
|
||||
index 31b115e..f7ada93 100644
|
||||
--- a/Projects/zstack/ZNP/Source/znp_app.c
|
||||
+++ b/Projects/zstack/ZNP/Source/znp_app.c
|
||||
@@ -67,6 +67,10 @@
|
||||
@ -589,10 +620,19 @@ index 31b115e..9575690 100644
|
||||
+#ifdef MODKAMRU_V3
|
||||
+ MODKAM_LED_BLINK_SHORT(HAL_LED_4);
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
osal_event_hdr_t *pMsg;
|
||||
#if !defined CC2531ZNP
|
||||
uint8 *pBuf;
|
||||
@@ -406,7 +414,7 @@ static void npInit(void)
|
||||
MT_UartRegisterTaskID(znpTaskId);
|
||||
|
||||
#ifdef HAL_PA_LNA_CC2592
|
||||
- ZMacSetTransmitPower(TX_PWR_PLUS_19);
|
||||
+ ZMacSetTransmitPower(TX_PWR_PLUS_22);
|
||||
#else
|
||||
ZMacSetTransmitPower(TX_PWR_PLUS_4);
|
||||
#endif
|
||||
@@ -508,6 +516,18 @@ static void npBasicRsp(void)
|
||||
*/
|
||||
static void npUartCback(uint8 port, uint8 event)
|
||||
@ -602,7 +642,7 @@ index 31b115e..9575690 100644
|
||||
+ if(
|
||||
+ (event & HAL_UART_RX_FULL) ||
|
||||
+ (event & HAL_UART_RX_ABOUT_FULL) ||
|
||||
+ (event & HAL_UART_RX_TIMEOUT)
|
||||
+ (event & HAL_UART_RX_TIMEOUT)
|
||||
+ ){
|
||||
+ MT_UartProcessZToolData(port, znpTaskId);
|
||||
+ }else if(event & HAL_UART_TX_EMPTY){
|
||||
@ -622,23 +662,22 @@ index 31b115e..9575690 100644
|
||||
/**************************************************************************************************
|
||||
diff --git a/note.txt b/note.txt
|
||||
new file mode 100644
|
||||
index 0000000..c6c23c4
|
||||
index 0000000..91122c7
|
||||
--- /dev/null
|
||||
+++ b/note.txt
|
||||
@@ -0,0 +1,13 @@
|
||||
@@ -0,0 +1,15 @@
|
||||
+Preprocessor:
|
||||
+ USB:
|
||||
+ - HAL_UART_USB
|
||||
+ - xHAL_UART=TRUE
|
||||
+ - xZNP_ALT
|
||||
+ UART FC:
|
||||
+ - xHAL_UART_USB
|
||||
+ - xHAL_UART_USB
|
||||
+ - HAL_UART=TRUE
|
||||
+ - xZNP_ALT
|
||||
+ UART no FC:
|
||||
+ - xHAL_UART_USB
|
||||
+ - xHAL_UART_USB
|
||||
+ - HAL_UART=TRUE
|
||||
+ - ZNP_ALT
|
||||
--
|
||||
2.24.1.windows.2
|
||||
|
||||
+
|
||||
+
|
||||
|
Loading…
Reference in New Issue
Block a user