Minimal Test Stand Supervisory Control and Data Acquisition system hardware and firmware. See mints-scada-software for the computer software to control the whole system.
- Populate all SMD components on the board
- Only populate the 60.4 ohm CAN termination resistors on the nodes on the ends of the chain.
- Populate the USB port and solder its mounting lugs
- Do not populate the headers on the sides as they will make it more difficult to work on the boards if problems are discovered
- Complete the board testing
- Populate THT components
- Select the desired configuration of the board. This can be one of
- 8x Push and/or Pull outputs
- 4x I2C
- 4x ADC
- See notes in KiCad for configuration information
- Assemble only the required components for that version of the board. Leave the rest unpopulated
Firmware files are located in the firmware/bin directory.
Command line firmware flashing instructions are provided for Ubuntu 24.04. Other debian-based Linux distros should follow a similar procedure. Flashing from Mac or Windows should be possible, but is not covered here.
- Install
dfu-utilwithsudo apt install dfu-util - Set up udev rules
- Put the following into
/etc/udev/rules.d/60-stm32
# STM32 ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess"- Either reboot or run
sudo udevadm control --reload-rules && sudo udevadm triggerto reload the udev rules
- Put the following into
- Remove the devboard from the module if it was installed.
- Put the device in bootloader mode
- If the device is unplugged, hold the
BOOTbutton while plugging it in - If the device is already plugged in, press
RESETandBOOT, then releaseRESETthenBOOT
- If the device is unplugged, hold the
- Run
dfu-util --listand confirm that there are two devices with the vendor:product ID0483:df11, one with the name@Option Bytesand one with the name@Internal Flash. If any other devices with that ID are present, remove them before continuing. - Flash the device with
dfu-util --device 0483:df11 --alt 0 --dfuse-address 0x08000000:leave --download [path/to/file/]<filename>.bin. It should erase the flash, then download the new file and showFile downloaded successfullywhen it is done.
STM32CubeProgrammer can be used to flash device firmware. Setup will be platform-dependent, and thusly not covered here.
To build and upload:
- Open the PlatformIO tab in the left toolbar
- Under
PROJECT TASKS>Build>Generalexecute theBuildprocedure by clicking on it - Execute
Uploadto upload to the microcontroller. Ensure that only a single board is plugged in to ensure you are writing to the correct device.
Building firmware from source shouldn't be needed unless you are making changes to it. Firmware build instructions are provided for Ubuntu 24.04. Other debian-based Linux distros should follow a similar procedure. Flashing from Mac or Windows should be possible, but is not covered here.
You will need:
- GCC for arm
sudo apt install gcc-arm-none-eabi - make
sudo apt install make - Everything as described in the command line flashing setup section above.
To build the code, simply run make in the firmware folder. This will build the firmware and copy the .bin into the firmware folder. Running make flash will build the firmware then upload it to a connected DFU mode microcontroller.
Initialization code was generated using [https://www.st.com/en/development-tools/stm32cubemx.html](STM32Cube initialization code generator). You should not need to mofidy this, but if you do, the module_io.ioc is included. If you regenerate the code, you may have to add
#######################################
# Flash
#######################################
flash: all
dfu-util --device 0483:df11 --alt 0 --dfuse-address 0x08000000:leave --download $(BUILD_DIR)/$(TARGET).bin
to the end of Makefile. Optionally, add cp $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin to target all in the makefile (add line 171) to copy the bin out of the build direcotry. Generally, CubeMX does not seem to update the Makefile if it exists.
- Populate all SMD components as described in the
assemblysections. Do not populate THT components yet - Visually inspect the board. Fix any issues and inspect again until no issues remain
- Verify that no pins are shorted
- Verify the correct orientation and alignment of all components. Pay special attention to the STM32 since its square shape makes it more difficult to notice errors
- Bridges can hide under the USB port where you can't see them unless you tilt the board to look deep under the port. They can often be fixed by applying flux then heating the two bridged pins.
- Fixing any of these issues is easier before soldering THT parts since everything here is reflow safe, so it is less likely to be damaged during repairs.
- Use a DMM to test between
GND3v3, andGNDand either pad of the polyfuse (the component in the corner of the board by the USB port). Verify there are no shorts. - On your computer run
sudo dmesg -Hwto monitor system messages in real time (-m) with human-readable timestamps (-h). Keep this window open and visible for the next step - Plug the board in via USB. Watch
dmesg. The following should appear. If it does not, then there is a problem with your board.
[<starttime>] usb 3-2: new full-speed USB device number <id> using xhci_hcd
[ +0.148877] usb 3-2: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00
[ +0.000014] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ +0.000006] usb 3-2: Product: STM32 BOOTLOADER
[ +0.000006] usb 3-2: Manufacturer: STMicroelectronics
[ +0.000005] usb 3-2: SerialNumber: FFFFFFFEFFFF
- Use the above procedure to flash the
blink-fast.binfirmware. Confirm that the LED blinks at about 10Hz. - Use the above procedure to flash the
blink-slow.binfirmware. Confirm that the LED blinks at about 1Hz. This confirms that you are able to flash new firmware to the device. - Install the THT components as described in the assembly section.
blink-fast.bin and blink-slow.bin should already be built in the firmware/bin directory. If they are not, they can be rebuilt with the blink project. To rebuild them, run the following in firmware/blink
make clean && make DELAY=500 && cp blink.bin ../bin/blink-slow.bin
make clean && make DELAY=50 && cp blink.bin ../bin/blink-fast.bin