Compare commits
11
Commits
250190baef
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e71cb9c1ed | ||
|
|
5753a86fb8 | ||
|
|
3320e35cee | ||
|
|
2a8eb64e61 | ||
|
|
789e7fa30f | ||
|
|
3765e59b10 | ||
|
|
9c1a30f1e1 | ||
|
|
047446fd9b | ||
|
|
89ecdc476f | ||
|
|
c66c3fe18e | ||
|
|
deb82441c6 |
@@ -7,7 +7,6 @@ ifeq ($(TARGET_PROJ), node)
|
||||
BUILD_DIR := $(PROJECT)/build/node
|
||||
CONFIG_FILE := $(PROJECT)/config/node.json
|
||||
else ifeq ($(TARGET_PROJ), ge)
|
||||
XILINX_VITIS_CLASSIC := y
|
||||
BUILD_DIR := $(PROJECT)/build/ge
|
||||
CONFIG_FILE := $(PROJECT)/config/ge.json
|
||||
else
|
||||
|
||||
@@ -5,7 +5,7 @@ set "tools_dir=%~dp0scripts\platform\%platform%"
|
||||
:menu
|
||||
echo Please select the project needed to be built:
|
||||
echo 1. NODE Project (SDK 2019.1)
|
||||
echo 2. GE Project (Vitis 2024.1)
|
||||
echo 2. GE Project (SDK 2019.1)
|
||||
set /p choice="Choose a project (1 or 2): "
|
||||
|
||||
if "%choice%"=="1" (
|
||||
@@ -15,8 +15,8 @@ if "%choice%"=="1" (
|
||||
set "config=%~dp0config\node.json"
|
||||
goto end
|
||||
) else if "%choice%"=="2" (
|
||||
echo Building GE Project ^(Vitis 2024.1^)
|
||||
set "platform_ver=2024.1"
|
||||
echo Building GE Project ^(SDK 2019.1^)
|
||||
set "platform_ver=2019.1"
|
||||
set "work_dir=%~dp0build\ge"
|
||||
set "config=%~dp0config\ge.json"
|
||||
goto end
|
||||
|
||||
Binary file not shown.
+21516
File diff suppressed because it is too large
Load Diff
Executable
BIN
Binary file not shown.
Executable
+20197
File diff suppressed because it is too large
Load Diff
+1
-1
Submodule scripts updated: af260c1610...58ed5e4bda
+5
-73
@@ -84,6 +84,7 @@ struct callback_desc scutm_callback_desc =
|
||||
.ctx = NULL
|
||||
};
|
||||
|
||||
#ifdef _GE_APP_
|
||||
L2_CONFIG linkConfig = {
|
||||
.myType = L2_NODE_HEAD,
|
||||
.clustId = 1U,
|
||||
@@ -95,18 +96,9 @@ L2_CONFIG linkConfig = {
|
||||
.pushUpHandle = LinklayerPush2Up,
|
||||
.popUpHandle = LinklayerPopFromUp
|
||||
};
|
||||
|
||||
// L2_CONFIG linkConfig = {
|
||||
// .myType = L2_NODE_MEMBER,
|
||||
// .clustId = 1U,
|
||||
// .myId = 2U,
|
||||
// .headId = 1U,
|
||||
// .netScale = 2U,
|
||||
// .phyInstPtr = NULL, // physical layer reference
|
||||
// .tmcInstPtr = NULL,
|
||||
// .pushUpHandle = LinklayerPush2Up,
|
||||
// .popUpHandle = LinklayerPopFromUp
|
||||
// };
|
||||
#else
|
||||
#error No application type is specified.
|
||||
#endif
|
||||
|
||||
static PHY_CONFIG phyConfig =
|
||||
{
|
||||
@@ -136,46 +128,6 @@ static MPC_CONFIG mpcConfig = {
|
||||
.rxQueueMax = 16
|
||||
};
|
||||
|
||||
#ifdef APP_EMULATE_DATA
|
||||
uint8_t testDataLj[] =
|
||||
{
|
||||
0xEA, 0xDF, 0x3F, 0x27, 0xCE, 0x9B, 0xE6, 0x3F,
|
||||
0xB5, 0xA3, 0x38, 0x47, 0x1D, 0x1D, 0xFA, 0x3F,
|
||||
0x39, 0xB4, 0xC8, 0x76, 0xBE, 0xAB, 0x8E, 0x40,
|
||||
0xC9, 0xE8, 0x80, 0x24, 0xEC, 0xCB, 0x13, 0x40,
|
||||
0x37, 0x38, 0x7F, 0x22, 0x72, 0x06, 0xF0, 0x01,
|
||||
0x00, 0x00, 0xB8, 0xAA, 0x08, 0x47, 0x1E, 0xC6,
|
||||
0xB0, 0x47, 0x54, 0xFD, 0xEB, 0x45, 0xA1, 0x8A,
|
||||
0x86, 0x44, 0x43, 0xB6, 0xC8, 0x44, 0x4E, 0x19,
|
||||
0xA8, 0x42
|
||||
};
|
||||
|
||||
uint8_t testDataFlj[] =
|
||||
{
|
||||
0xFD, 0x1E, 0xA5, 0x22, 0x72, 0x02, 0x5A, 0x02,
|
||||
0x00, 0x00, 0x81, 0x97, 0x39, 0x3F, 0xF1, 0xF4,
|
||||
0xC0, 0x3F, 0x27, 0xF1, 0x65, 0x44, 0x53, 0x5C,
|
||||
0xD3, 0x3F, 0xB5, 0x24, 0xA6, 0x22, 0x72, 0x02,
|
||||
0x83, 0x01, 0x00, 0x00, 0xFC, 0xE0, 0x44, 0x47,
|
||||
0xB7, 0x83, 0x35, 0x47, 0xA4, 0xBF, 0xE5, 0xC4,
|
||||
0xE8, 0xDC, 0xD1, 0x44, 0x5D, 0x5D, 0xE7, 0x44,
|
||||
0x7D, 0x1B, 0xE8, 0xC1, 0x60, 0x97, 0x57, 0x42,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x5D, 0x86, 0xA6, 0x22, 0x72, 0x02, 0xA5, 0x02,
|
||||
0x00, 0x00, 0x97, 0x4E, 0xB5, 0x47, 0xC4, 0x2A,
|
||||
0xB0, 0x47, 0x2D, 0x00, 0x21, 0xC5, 0x8A, 0x85,
|
||||
0xD1, 0x44, 0x23, 0xFD, 0xC8, 0x44, 0xA1, 0xC4,
|
||||
0xEA, 0xC1, 0x91, 0x4E, 0x71, 0xC2, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6D, 0xAD,
|
||||
0xA6, 0x22, 0x72, 0x02, 0xA5, 0x02, 0x00, 0x00,
|
||||
0xCD, 0x07, 0xD6, 0x47, 0x1D, 0xA4, 0xCE, 0x47,
|
||||
0x6E, 0x61, 0x33, 0xC5, 0x85, 0x55, 0xD1, 0x44,
|
||||
0x9C, 0x16, 0xBD, 0x44, 0x36, 0xC0, 0xEB, 0xC1,
|
||||
0xF0, 0xFF, 0x5B, 0x42, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x78, 0x25, 0x03, 0x00
|
||||
};
|
||||
#endif
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
static struct irq_ctrl_desc *intcDescPtr; // General interrupt controller descriptor
|
||||
static struct timer_desc *logTmPtr;
|
||||
@@ -324,7 +276,7 @@ static int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
irq_enable(descPtr, PERIODIC_5MS_INTR_ID);
|
||||
irq_enable(descPtr, MPC_RX_INTR_ID);
|
||||
irq_enable(descPtr, MPC_TX_INTR_ID);
|
||||
// irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
|
||||
// Enable Exceptions
|
||||
Status = irq_global_enable(descPtr);
|
||||
@@ -438,16 +390,6 @@ static void ScuTimer_IntrHandler(void *context)
|
||||
{
|
||||
DBG_ERROR("Failed to apply remote test.\n");
|
||||
}
|
||||
#ifdef APP_EMULATE_DATA
|
||||
if (L2_GetNodeType(linkInstPtr) == L2_NODE_HEAD)
|
||||
{
|
||||
SysMonitor_UpdateSendPayload(testDataFlj, PAYLOAD_LEN_FLJ_TX);
|
||||
}
|
||||
else
|
||||
{
|
||||
SysMonitor_UpdateSendPayload(testDataLj, PAYLOAD_LEN_LJ_TX);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
XScuTimer_ClearInterruptStatus((XScuTimer *)xdesc->instance);
|
||||
@@ -596,15 +538,5 @@ int main(void)
|
||||
DBG_ERROR("Mpc_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
}
|
||||
}
|
||||
if (Mpc_IsSvcDownPending(mpcDescPtr))
|
||||
{
|
||||
RING_BUFFER *msg = NULL;
|
||||
Mpc_PopSvcFrame(mpcDescPtr, (void**)&msg);
|
||||
Mpc_PushSvcFrame(mpcDescPtr, (void*)msg);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Mpc_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // main
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#define _APP_VER_MINOR ((_APP_VER & 0x00FF0000) >> 16)
|
||||
#define _APP_VER_PATCH (_APP_VER & 0x0000FFFF)
|
||||
|
||||
#define _GE_APP_
|
||||
|
||||
/*********** Debug Info Level ************/
|
||||
// #define _DEBUG_LEVEL 1
|
||||
// 3 - print all debug info
|
||||
@@ -36,12 +38,6 @@
|
||||
// 1 - print only errors
|
||||
// other - print nothing
|
||||
|
||||
#define APP_EMULATE_DATA
|
||||
#define DATALINK_ENABLE_AUTORECONNECT
|
||||
#define DATALINK_ENABLE_AUTOTIMESYNC
|
||||
//#define DATALINK_ENABLE_BERTEST
|
||||
|
||||
|
||||
/************ Hardware Configs ************/
|
||||
#define CPU_CLK_HZ XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ
|
||||
#define GLOBAL_TIMER_CLK_HZ (CPU_CLK_HZ/2)
|
||||
@@ -86,16 +82,4 @@
|
||||
// INTC configis
|
||||
#define INTC_DEVICE_ID XPAR_SCUGIC_0_DEVICE_ID
|
||||
|
||||
// Configuration Check
|
||||
#if defined(PHY_BEAM_SET_PRESET) && !defined(PHY_BEAM_FORMING_ENABLE)
|
||||
#define PHY_BEAM_FORMING_ENABLE
|
||||
#warning To impliment beam scan must enable beam forming...
|
||||
#endif
|
||||
|
||||
#if defined(DATALINK_ENABLE_BERTEST)
|
||||
#if !defined(DATALINK_ENABLE_AUTOTIMESYNC)
|
||||
#warning To enbale bit error rate test, auto time-sync should be enabled...
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,10 +56,10 @@ int HARDWARE_initialize()
|
||||
int Status;
|
||||
|
||||
// use configuration
|
||||
mykDevice.rx->rxPllLoFrequency_Hz = 2500000000u;
|
||||
mykDevice.tx->txPllLoFrequency_Hz = 2500000000u;
|
||||
mykDevice.tx->tx1Atten_mdB = 20000;
|
||||
mykDevice.tx->tx2Atten_mdB = 20000;
|
||||
mykDevice.rx->rxPllLoFrequency_Hz = 720000000u;
|
||||
mykDevice.tx->txPllLoFrequency_Hz = 720000000u;
|
||||
mykDevice.tx->tx1Atten_mdB = 10000;
|
||||
mykDevice.tx->tx2Atten_mdB = 10000;
|
||||
|
||||
Status = HARDWARE_ad9371Config();
|
||||
|
||||
|
||||
+2
-1
@@ -255,7 +255,8 @@ static int32_t Mpc_SystemConfig(MPC *instPtr, uint8_t *msg)
|
||||
WD_SPEED_CMD, msg[WD_SPEED_CMD]);
|
||||
return EIGNORE;
|
||||
}
|
||||
|
||||
//NOTE: Clear previous log.
|
||||
memset(&(linkInstPtr->log), 0x00, sizeof(L2_LOG));
|
||||
if (msg[WD_EN_CMD] == EN_CMD_ON_HIGH_POWER)
|
||||
{
|
||||
// high power config
|
||||
|
||||
@@ -821,15 +821,15 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
||||
UpdateMainSate(instPtr, L2_NORMAL_STATE);
|
||||
switch(L2_GetCurrentSpeedMode(instPtr)){
|
||||
case L2_SPEED_NONE :
|
||||
DBG_WARNING("Speed mode not configured, fallback to 2Kbps mode.\n");
|
||||
case L2_SPEED_2KBPS :
|
||||
instPtr->rtneConfig.rtneTable = normalTable2K;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(normalTable2K);
|
||||
break;
|
||||
DBG_WARNING("Speed mode not configured, fallback to 128Kbps mode.\n");
|
||||
case L2_SPEED_128KBPS :
|
||||
instPtr->rtneConfig.rtneTable = normalTable128K;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(normalTable128K);
|
||||
break;
|
||||
case L2_SPEED_2KBPS :
|
||||
instPtr->rtneConfig.rtneTable = normalTable2K;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(normalTable2K);
|
||||
break;
|
||||
case L2_SPEED_256KBPS :
|
||||
instPtr->rtneConfig.rtneTable = normalTable256K;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(normalTable256K);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "link_layer.h"
|
||||
|
||||
#define L2_PACK_LEN_MAX 512 // bytes
|
||||
#define L2_PACK_LEN_MAX 1024 // bytes
|
||||
|
||||
#define L2_ADV_PACK_LEN 28 // bytes
|
||||
#define L2_CMF_PACK_LEN 268 // bytes
|
||||
|
||||
@@ -478,7 +478,7 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
float nodePos;
|
||||
L2_DEASSEMBLE(msg, L2_MSG_ADV_SRC_POSX, &nodePos);
|
||||
node->nodeInfo.pos.x = (double)nodePos;
|
||||
L2_DEASSEMBLE(msg, L2_MSG_ADV_SRC_POSY, &nodePos);
|
||||
L2_DEASSEMBLE(msg, L2_MSG_ADV_SRC_POSY, &nodePos);
|
||||
node->nodeInfo.pos.y = (double)nodePos;
|
||||
L2_DEASSEMBLE(msg, L2_MSG_ADV_SRC_POSZ, &nodePos);
|
||||
node->nodeInfo.pos.z = (double)nodePos;
|
||||
@@ -487,7 +487,7 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
// Reset node ttl
|
||||
node->ttlCnt = 0;
|
||||
|
||||
uint32_t netstartTime;
|
||||
uint32_t netstartTime = 0;
|
||||
// Update net start time.
|
||||
L2_DEASSEMBLE(msg, L2_MSG_ADV_SRC_NETSTART_TIME, &netstartTime);
|
||||
L2_EVENT netSetupDoneEvent = {
|
||||
@@ -496,10 +496,12 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
AssertL2Event(instPtr, &netSetupDoneEvent);
|
||||
|
||||
// Calculate time deviation
|
||||
uint32_t frameNum, slotNum = 0;
|
||||
uint32_t frameNum = 0;
|
||||
uint32_t slotNum = 0;
|
||||
int64_t timeDev = 0;
|
||||
L2_DEASSEMBLE(msg, L2_MSG_FRAME_NUM, &frameNum);
|
||||
L2_DEASSEMBLE(msg, L2_MSG_SLOT_NUM, &slotNum);
|
||||
Status = L2_GetTimeDeviation(instPtr, frameNum, slotNum, true, &(instPtr->log.timeDev));
|
||||
Status = L2_GetTimeDeviation(instPtr, frameNum, slotNum, true, &timeDev);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Failed to compute time deviation.\n")
|
||||
@@ -507,7 +509,8 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
}
|
||||
|
||||
// Time sync.
|
||||
L2_TimeAdjust(instPtr, &(instPtr->log.timeDev));
|
||||
L2_TimeAdjust(instPtr, &timeDev);
|
||||
instPtr->log.timeDev = timeDev;
|
||||
|
||||
// trigger flag
|
||||
AdvRecvStateUpdate(scanFsmPtr, true);
|
||||
@@ -550,15 +553,18 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
node->ttlCnt = 0;
|
||||
|
||||
// Calculate time deviation
|
||||
uint32_t frameNum, slotNum = 0;
|
||||
uint32_t frameNum = 0;
|
||||
uint32_t slotNum = 0;
|
||||
int64_t timeDev = 0;
|
||||
L2_DEASSEMBLE(msg, L2_MSG_FRAME_NUM, &frameNum);
|
||||
L2_DEASSEMBLE(msg, L2_MSG_SLOT_NUM, &slotNum);
|
||||
Status = L2_GetTimeDeviation(instPtr, frameNum, slotNum, true, &(instPtr->log.timeDev));
|
||||
Status = L2_GetTimeDeviation(instPtr, frameNum, slotNum, true, &timeDev);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Failed to compute time deviation.\n")
|
||||
break;
|
||||
}
|
||||
instPtr->log.timeDev = timeDev;
|
||||
|
||||
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ static int32_t Service_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
|
||||
DBG_ERROR("Fail to append CRC, error code: %" PRId32 ".\n", Status);
|
||||
ASSERT(true);
|
||||
}
|
||||
return EIGNORE;
|
||||
return SUCCESS;
|
||||
}
|
||||
RING_BUFFER *svcData = instPtr->serviceFSM->currTxBuff;
|
||||
|
||||
|
||||
+8
-18
@@ -66,10 +66,11 @@ struct callback_desc scutm_callback_desc = {
|
||||
.ctx = NULL
|
||||
};
|
||||
|
||||
#ifdef _NODE_APP_
|
||||
L2_CONFIG linkConfig = {
|
||||
.myType = L2_NODE_HEAD,
|
||||
.myType = L2_NODE_MEMBER,
|
||||
.clustId = 1U,
|
||||
.myId = 1U,
|
||||
.myId = 2U,
|
||||
.headId = 1U,
|
||||
.netScale = 2U,
|
||||
.phyInstPtr = NULL, // physical layer reference
|
||||
@@ -77,18 +78,9 @@ L2_CONFIG linkConfig = {
|
||||
.pushUpHandle = LinklayerPush2Up,
|
||||
.popUpHandle = LinklayerPopFromUp
|
||||
};
|
||||
|
||||
// L2_CONFIG linkConfig = {
|
||||
// .myType = L2_NODE_MEMBER,
|
||||
// .clustId = 1U,
|
||||
// .myId = 2U,
|
||||
// .headId = 1U,
|
||||
// .netScale = 2U,
|
||||
// .phyInstPtr = NULL, // physical layer reference
|
||||
// .tmcInstPtr = NULL,
|
||||
// .pushUpHandle = LinklayerPush2Up,
|
||||
// .popUpHandle = LinklayerPopFromUp
|
||||
// };
|
||||
#else
|
||||
#error No application type is specified.
|
||||
#endif
|
||||
|
||||
static PHY_CONFIG phyConfig = {
|
||||
.devId = PHY_DEVICE_ID,
|
||||
@@ -232,7 +224,7 @@ static int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
irq_enable(descPtr, PHY_INTR_ID);
|
||||
irq_enable(descPtr, PERIODIC_5MS_INTR_ID);
|
||||
irq_enable(descPtr, SYSBUS_INTR_ID);
|
||||
irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
// irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
|
||||
// Enable Exceptions
|
||||
Status = irq_global_enable(descPtr);
|
||||
@@ -428,9 +420,7 @@ int main(void)
|
||||
|
||||
DBG_PRINT("Physical started...\n");
|
||||
Phy_Start(phyInstPtr);
|
||||
|
||||
|
||||
// Linklayer_Start(linkInstPtr);
|
||||
Linklayer_Start(linkInstPtr);
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#define _APP_VER_MINOR ((_APP_VER & 0x00FF0000) >> 16)
|
||||
#define _APP_VER_PATCH (_APP_VER & 0x0000FFFF)
|
||||
|
||||
#define _NODE_APP_
|
||||
|
||||
/*********** Debug Info Level ************/
|
||||
// #define _DEBUG_LEVEL 1
|
||||
// 3 - print all debug info
|
||||
|
||||
Reference in New Issue
Block a user