|occheung 54b87d0b36||1 month ago|
|.cargo||5 months ago|
|fpga||5 months ago|
|gdb_config||5 months ago|
|nix||2 months ago|
|openocd||5 months ago|
|src||1 month ago|
|.gitignore||5 months ago|
|Cargo.lock||1 month ago|
|Cargo.toml||1 month ago|
|README.md||4 months ago|
|build.rs||5 months ago|
|cargosha256.nix||1 month ago|
|flash.py||2 months ago|
|memory.x||1 month ago|
|shell.nix||2 months ago|
MQTT-controlled 4-channel DDS signal generator using Urukul, Humpback and STM32 NUCLEO.
Start nix shell before anything.
(For users who had completed the networking setup) Flash firmware onto STM32 NUCLEO-H743ZI2 using OpenOCD.
openocd -f openocd/openocd.cfg -f openocd/main.cfg
(For users who had completed the networking setup) Alternatively, an equivalent Nix command can also do the work.
Provide them to setup Humpback-DDS:
Use the following Nix command.
openocd-flash-customised <client_cidr_ip_addr> <mac_addr> <broker_addr> "<name>"
openocd-flash-customised 192.168.1.200/24 AC:6F:7A:DE:D6:C8 192.168.1.125 "Urukul"
The device will be named
192.168.1.200 as IPv4 Address, inside a
/24 network, with
AC:6F:7A:DE:D6:C8 as MAC address.
It will connect to a MQTT broker at
Mosquitto is within the Nix package. Starting a Mosquitto MQTT broker can be as simple as the following line.
The MQTT broker will be started locally, at port 1883.
To enable feedback from the device, subscribe to all subtopics under
Urukul/Feedback on a separate terminal.
mosquitto_sub -h <broker ip address> -t Urukul/Feedback/#
Note that subscription to the feedback topic is completely optional.
Controlling Humpback-DDS can be achieved by sending specific MQTT commands through Mosquitto. The device will listen to all publishes that are under the
/Urukul/Control topic. A MQTT message can be published by the following command.
mosquitto_pub -h <broker ip address> -t <topic> -m <message>
For example, to publish a local MQTT broker, with the topic of
Baz as the message, enter this command.
mosquitto_pub -h localhost -t Foo/Bar -m "Baz"
Note that MQTT topics are case-sensitive.
Alternatively, the following nix command provided by the shell simplify the syntax.
publish-mqtt <topic> <message>
This will send the MQTT message to a local MQTT broker at port 1883, with specified topic and message. The example above can be simplified into:
publish-mqtt Foo/Bar "baz"
All currently supported commands are listed below.
Note: The following table only lists the subtopic. To make a full topic, add
Urukul/Control/ in front of all subtopics.
||Reset the device|
||Turn off/on the RF switch at channel X.|
||Set attenuation of channel X.|
||Select the clock source of Urukul.|
||Set the clock frequency of the clock source of Urukul.|
||Set the clock division of Urukul.|
||Setup the clock tree for Urukul.|
||Set the system clock frequency of channel X.|
||Setup a single tone profile at channel X, profile Y, with frequency
||Setup a single tone profile at channel X, profile Y, with amplitude factor
||Setup a single tone profile at channel X, profile Y, with phase
||Setup a compelte single tone profile at channel X, profile Y.|
||Switch to a DDS profile across all channels.|
Reset command resets the device. The effects are:
This resets the device.
This command turns off/on an RF switch of a channel.
publish-mqtt Urukul/Control/Channel0/Switch "on"
This turns on the channel 0 RF switch.
publish-mqtt Urukul/Control/Channel0/Attenuator "20 dB"
This sets the attenuation of the channel 0 attenuator to be 20 dB.
publish-mqtt Urukul/Control/Clock/Frequency "100 MHz"
This sets the clock frequency of Urukul to be 100 MHz.
publish-mqtt Urukul/Control/Clock/Source "OSC"
This sets the clock source of Urukul to be the internal oscillator.
(Note: The internal oscillator should have a frequency of 100MHz, though this command does not setup the clock frequency.)
Clock Frequency Division
publish-mqtt Urukul/Control/Clock/Division "4"
This divides the clock frequency of Urukul by a factor of 4.
Clock Overall Setup
frequency: <f_clk> [unit], source: <clk_src>, division: <clk_div>
publish-mqtt Urukul/Control/Clock "source: OSC, frequency: 100 MHz, division: 4"
This is identical to the 3 examples above.
publish-mqtt Urukul/Control/Chammel1/SystemClock "1 GHz"
This sets the system clock frequency of channel 1 to 1 GHz.
Single Tone Frequency
publish-mqtt Urukul/Control/Channel1/Profile2/Singletone/Frequency "3 MHz"
This sets the output frequency of the single tone profile at channel 1, profile 2 to be 3 MHz.
Single Tone Amplitude
publish-mqtt Urukul/Control/Channel1/Profile2/Singletone/Amplitude "0.5"
This sets the output amplitude factor of the single tone profile at channel 1, profile 2 to be 0.5.
Single Tone Phase
publish-mqtt Urukul/Control/Channel1/Profile2/Singletone/Degree "0.0 deg"
This sets the phase of the single tone profile at channel 1, profile 2 to be 0 degree.
Single Tone Overall Setup
frequency: <freq> [unit], amplitude: <ampl>, phase: <phase>
publish-mqtt Urukul/Control/Clock "frequency: 3 MHz, phase: 0.0 deg, amplitude: 0.5"
This is identical to the 3 examples above.
publish-mqtt Urukul/Control/Profile "5"
This is selects profile 5 for all DDS channels.