fix: 修复RFSoC Timer不正常运行的问题; 暂时修改Z7的FPGA温度回读

This commit is contained in:
2025-09-01 15:45:45 +08:00
parent 3caea65695
commit b42316dd84
6 changed files with 27 additions and 12 deletions
+18 -3
View File
@@ -427,9 +427,24 @@ void AppTimer_IntrHandler(void *context)
{
Phy_UpdateLogging(phyInstPtr);
}
/*
* Read the new Control/Status Register content.
*/
uint32_t ControlStatusReg;
ControlStatusReg = XTmrCtr_ReadReg(((XTmrCtr *)xdesc->instance)->BaseAddress,
0, XTC_TCSR_OFFSET);
/*
* Acknowledge the interrupt by clearing the
* interrupt bit in the timer control status
* register, this is done after calling the
* handler so the application could call
* IsExpired, the interrupt is cleared by
* writing a 1 to the interrupt bit of the
* register without changing any of the other
* bits
*/
XTmrCtr_WriteReg(((XTmrCtr *)xdesc->instance)->BaseAddress, 0,
XTC_TCSR_OFFSET, XTC_CSR_INT_OCCURED_MASK);
XTC_TCSR_OFFSET, ControlStatusReg | XTC_CSR_INT_OCCURED_MASK);
}
#else
#error No timer implementation!
@@ -551,7 +566,7 @@ int main(void)
}
// Start System Monitor logging.
timer_start(logTmPtr);
Status = timer_start(logTmPtr);
DBG_PRINT("Physical started...\n");
Phy_Start(phyInstPtr);
+1 -1
View File
@@ -28,7 +28,7 @@
#include "circ_queue.h"
#include "../time_ctrl/time_ctrl.h"
#ifndef EMULATION
#include "../config/app_config.h"
#include "../../config/app_config.h"
#endif
/************************** Constant Definitions *****************************/
#define NET_START_TIME_INFTY UINT32_MAX
+1 -1
View File
@@ -25,7 +25,7 @@
#include "geometry/quaternion.h"
#include "../phy_layer/phy_layer.h"
#ifndef EMULATION
#include "../config/app_config.h"
#include "../../config/app_config.h"
#endif
/************************** Constant Definitions *****************************/
/**
+1 -1
View File
@@ -29,7 +29,7 @@
#include "common.h"
#include "circ_queue.h"
#ifndef EMULATION
#include "../config/app_config.h"
#include "../../config/app_config.h"
#endif
/************************** Constant Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/
+5 -5
View File
@@ -1069,7 +1069,6 @@ void Phy_RefreshHwSate(PHY_INST *instPtr)
: ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
// FIXME: XADC range needs further refine
instPtr->hwSate.spFpgaVolt = (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK);
instPtr->hwSate.spClkState = (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK);
instPtr->hwSate.isSpOk = (instPtr->hwSate.spFpgaVolt == (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK))
&& (instPtr->hwSate.spClkState == (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK));
#else
@@ -1149,10 +1148,11 @@ void Phy_RefreshHwSate(PHY_INST *instPtr)
// -- Update FPGA Chip temperature, unit 1 deg
rawData = XAdcPs_GetAdcData(&(instPtr->hwXadc), XADCPS_CH_TEMP);
evalData = XAdcPs_RawToTemperature(rawData);
instPtr->hwSate.spFpgaTemp = (evalData > TEMPERATURE_MAX)
? INT8_MAX
: ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
// FIXME: XADC readback is required
// instPtr->hwSate.spFpgaTemp = (evalData > TEMPERATURE_MAX)
// ? INT8_MAX
// : ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
// FIXME: XADC readback is required
instPtr->hwSate.spFpgaTemp = ((instPtr->hwSate.spAdTemp_0 - 5) + (instPtr->hwSate.spAdTemp_1 - 7)) / 2;
instPtr->hwSate.spFpgaVolt = (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK);
instPtr->hwSate.isSpOk = (instPtr->hwSate.spFpgaVolt == (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK))
&& (instPtr->hwSate.spClkState == (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK))
+1 -1
View File
@@ -24,7 +24,7 @@
#include "common.h"
#ifndef EMULATION
#include "xbram.h"
#include "../config/app_config.h"
#include "../../config/app_config.h"
#ifdef HSJL_GE // Zynq MPSoC (Zynq UltraScale+)
#include "xsysmon.h"
#else