forked from sinara-hw/assembly
106 lines
3.8 KiB
Markdown
106 lines
3.8 KiB
Markdown
# Sinara 8452 DSP Stabilizer
|
|
|
|
* [Wiki](https://github.com/sinara-hw/Stabilizer/wiki)
|
|
* [QUARTIQ Manual](https://quartiq.de/stabilizer/)
|
|
* [Firmware](https://github.com/quartiq/stabilizer)
|
|
|
|
EEM is used for power only, and it can be alternatively powered by 12V barrel jack or PoE.
|
|
|
|
## JSON
|
|
|
|
Not present in the JSON.
|
|
|
|
## Getting the firmware
|
|
|
|
You can get the firmware from [Hydra](https://nixbld.m-labs.hk/jobset/mcu/mcu-contrib).
|
|
|
|
* ``stabilizer-dual-iir`` supports Pounder v1.2 - probably you should flash this one,
|
|
* ``stabilizer-dual-iir-pounder_v1_0`` supports Pounder 1.0 and 1.1 (legacy),
|
|
* ``stabilizer-lockin`` is a different application which we do not usually flash.
|
|
|
|
These all include changes to the mainline code to include Pounder telemetry.
|
|
|
|
### Building (optional)
|
|
|
|
Please keep in mind that the firmware from the official Quartiq repository does not include support for Pounder in MQTT, you may need to use a fork for that. But if the stabilizer is without a Pounder, it's also a valid option.
|
|
|
|
There is no Nix Flake support to make things easier, so you need to set up rust and cargo manually. Start with cloning the stabilizer repository and opening a new shell with dfu-util (for flashing) and rustup (for building).
|
|
|
|
```
|
|
nix-shell -p dfu-util rustup
|
|
```
|
|
|
|
Set up the toolchain, this should be done only once:
|
|
|
|
```
|
|
rustup target add thumbv7em-none-eabihf
|
|
cargo install cargo-binutils
|
|
rustup component add llvm-tools-preview
|
|
rustup update
|
|
rustup default stable
|
|
```
|
|
|
|
Building:
|
|
|
|
```
|
|
cargo build --release
|
|
cargo objcopy --release --bin dual-iir -- -O binary dual-iir.bin
|
|
```
|
|
|
|
## Flashing
|
|
|
|
Once you have the binary, you can now flash it.
|
|
|
|
Without firmware on the device or with older firmware (without USB serial console), you need to use the jumper method:
|
|
|
|
1. Have the Stabilizer disconnected from power.
|
|
2. Use a jumper of some sort to short BOOT pins on the board.
|
|
3. Turn on the power.
|
|
4. You can remove the jumper after few seconds.
|
|
|
|
With newer firmware with USB serial console:
|
|
|
|
1. Connect the Stabilizer to power.
|
|
2. Connect USB cable to the Stabilizer.
|
|
3. Run ``python -m serial /dev/ttyACM0`` to connect the serial port using ``pyserial``.
|
|
4. Input ``platform dfu`` in the console.
|
|
|
|
And for both:
|
|
|
|
5. The device is now in DFU mode.
|
|
6. Flash the device with the following command:
|
|
|
|
```
|
|
dfu-util -a 0 -s 0x08000000:leave -R -D dual-iir.bin
|
|
```
|
|
|
|
7. Look for "File downloaded successfully".
|
|
|
|
For normal usage, the stabilizer must be configured with USB console later (try ``help`` command first), to set its IP address and MQTT broker address. However, for general testing (like the one below), you don't need to configure it any further.
|
|
|
|
### Clearing settings
|
|
|
|
In case someone sets some setting wrongly, or updates the firmware and suddenly there's an incompatibility, you may find (firmware, not yourself) in a state of panic, where it will not allow you to change the settings back.
|
|
|
|
1. Get into DFU mode (described above), probably with jumper method.
|
|
2. Use dfu-util to clear the flash completely:
|
|
|
|
```
|
|
dfu-util -a 0 -s 0x08000000:mass-erase:force:leave
|
|
```
|
|
|
|
3. Reflash the target firmware.
|
|
|
|
## Testing
|
|
|
|
1. Ensure that the [firmware](#getting-the-firmware) has been flashed onto the Stabilizer
|
|
2. Turn on the crate/Stabilizer via EEM cable or power supply
|
|
3. Set up the signal generator for an amplitude of 1V, frequency of 10kHz, and a sine wave
|
|
4. Use the splitter to connect the generator's output to ADC0 and to the oscilloscope (refer to the picture below)
|
|
![](../img/stabilizer_signal_generator.jpg)
|
|
5. Configure the oscilloscope so that the sine wave is clearly visible
|
|
6. Connect the second channel of the oscilloscope to the Stabilizer's DAC0
|
|
7. Ensure that there is the same wave on the second channel, with a small delay, as on the first channel
|
|
8. Repeat steps 4-7 for ADC/DAC1 (refer to the picture below for connection reference)
|
|
![](../img/stabilizer_ports_match.jpg)
|