From ef395bf81f3717c7496a9a63f9fd7db691dcc17f Mon Sep 17 00:00:00 2001 From: linuswck Date: Fri, 10 Jan 2025 14:41:04 +0800 Subject: [PATCH] Fix spi bus error at boot stage --- flake.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index bf15017..a3d1dbc 100644 --- a/flake.nix +++ b/flake.nix @@ -422,9 +422,17 @@ cp ${fast-servo-gateware}/gateware.bin /lib/firmware/ echo gateware.bin > /sys/class/fpga_manager/fpga0/firmware - # Run device init scripts - echo "Initializing clock generator, ADC, and DAC..." - python3 -m pyfastservo.initialize + # Reset the PL and initialize PL, ADC and DAC clock + echo "Configuring Si5340 to generate Clocks" + python3 -m pyfastservo.si5340 + + # Iniailize ADC + echo "Initialize ADC" + python3 -m pyfastservo.adc + + # Initialize DAC + echo "Initialize DAC" + python3 -m pyfastservo.dac ''; })]; system = "x86_64-linux";