version number and reverified data recording rate

This commit is contained in:
2025-06-08 16:34:22 -05:00
parent 68a4ed1428
commit 316ae900ae
11 changed files with 85 additions and 20 deletions

View File

@@ -10,6 +10,7 @@ import numpy as np
import data_structures as msg_types
from data_structures import CpiHeader
UTIL_REG_ADDR = 0x40050000
TIMING_ENGINE_ADDR = 0x40051000
DIG_RX_ADDR = 0x20000000
DIG_RX_STRIDE = 0x10000
@@ -66,6 +67,7 @@ class RadarManager:
self.CONNECTED = False
self.connect()
self.get_fpga_datecode()
# Update UDP packet size
self.packet_size = 4096
@@ -259,6 +261,17 @@ class RadarManager:
return
def update_ip_address(self, ip, mask, gw, port):
ip = ipaddress.IPv4Address(ip)
mask = ipaddress.IPv4Address(mask)
gw = ipaddress.IPv4Address(gw)
data = bytes(np.array([ip, mask, gw, port], dtype=np.uint32))
self.config_flash_write(0xf00000, data)
def get_fpga_datecode(self):
datecode = self.axi_read_register(UTIL_REG_ADDR + 0x114)
timecode = self.axi_read_register(UTIL_REG_ADDR + 0x118)
print('FPGA Datestamp %x_%x' % (datecode, timecode))
def load_waveform(self, ch, amp, bw, pw):
# addr = 0x0010000 + 0x0010000 * ch

View File

@@ -14,7 +14,7 @@ from data_recorder import DataRecorder
# Note that increases the size of rmem_max in the linux kernel improves performance for data recording
# this can be done witht the following terminal command
# sudo sysctl -w net.core.rmem_max=1048576
# sudo sysctl -w net.core.rmem_max=41918464
def db20(x):
return 20*np.log10(np.abs(x))
@@ -29,7 +29,7 @@ def db20n(x):
def main():
print('Hello')
radar = radar_manager.RadarManager(host='192.168.1.201', port=5002)
radar = radar_manager.RadarManager(host='192.168.1.200', port=5001)
clk = radar_manager.TIMING_ENGINE_FREQ
@@ -42,15 +42,6 @@ def main():
radar.ad9081_write_reg(0x0A0A, 0x60)
print(hex(radar.ad9081_read_reg(0x0A0A)))
# Program Config Flash IP Address
ip = ipaddress.IPv4Address('192.168.1.201')
mask = ipaddress.IPv4Address('255.255.255.0')
gw = ipaddress.IPv4Address('192.168.1.1')
port = 5002
data = bytes(np.array([ip, mask, gw, port], dtype=np.uint32))
radar.config_flash_write(0xf00000, data)
# CPI Parameters (timing values are in clk ticks)
num_pulses = 128
# Should be multiple of udp packet size, currently 4096 bytes, or 1024 samples
@@ -66,6 +57,7 @@ def main():
inter_cpi = 20000
tx_lo_offset = 10e6
rx_lo_offset = 0
test_duration = 60
pri_float = pri / clk
@@ -85,7 +77,7 @@ def main():
print('Start Running')
radar.start_running()
# Let it run for a bit
time.sleep(60)
time.sleep(test_duration)
# Stop running
radar.stop_running()
# Stop the data recorder

25
python/update_ip.py Executable file
View File

@@ -0,0 +1,25 @@
import numpy as np
import ipaddress
import radar_manager
# This scrip updates the IP address stored in the configuration flash chip on the FPGA board
# After running this script the FPGA must be power cycled for the new IP to take effect
def main():
print('Updating IP Address')
radar = radar_manager.RadarManager(host='192.168.1.200', port=5001)
# Program Config Flash IP Address
ip = '192.168.1.200'
mask = '255.255.255.0'
gw = '192.168.1.1'
port = 5001
radar.update_ip_address(ip, mask, gw, port)
print('Updating IP Address Complete')
if __name__ == '__main__':
main()