Changing the sampling_rate value up or down doesn’t make a difference.
import spidev
import struct
import time
# Define constants
sample_queue_size = 2000
device = "/dev/spidev0.0"
sampling_rate = 65000000 # (SPI maximum speed)
# Set up SPI
spi = spidev.SpiDev()
spi.open(0, 0) # Open SPI device
spi.max_speed_hz = sampling_rate
# Output file path
output_path = "output.out"
# Data collection
samples = [ ]
start_time = time.time()
for _ in range(sample_queue_size):
# Read data via SPI
response = spi.xfer2([0x00, 0x00]) # Read data via SPI (modify according to actual command)
value = ((response[0] & 0x0F) << 8) | response[1] # Convert to 12-bit data
samples.append(value)
end_time = time.time()
# Measure and print time
elapsed_time = end_time - start_time
print(f"time elapsed: {elapsed_time:.6f} seconds")
# Save data to file
with open(output_path, "wb") as f:
for value in samples:
f.write(struct.pack('<H', value)) # Save 16-bit values in binary format (use lower 12 bits)
# Close SPI
spi.close()
Jetpack of Xavier NX cannot be updated. I think it is a kernel driver or module issue that does not solve the problem even if you update Orin Nano’s Jetpack version.
Xavier NX should be available to be updated to JP5.1.3.
JP4.4.1 uses K4.9 and JP5.1.3 uses K5.10 so that the driver between them should be different.
We want to clarify if the issue is caused from the driver or the module.
There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks
So, it seems the issue is relating to the kernel driver.