Microcontroller firmware for baseboard management that provides BMC-over-USB functionality.
GPL-3.0 License
tiny-manager will, one day, become a general purpose firmware for baseboard management.
Currently however is a single purpose firmware that can toggle the power and reset lines for the STM32F042 found on the Solidrun Honeycomb LX2. Nevertheless this is sufficient to be a proof-of-concept showing how to squeeze a simple USB ACM command processor into the tiny, tiny flash of the STM32F042. Now we have working USB then how hard can the rest of it really be ;-) !
git clone https://github.com/daniel-thompson/tiny-manager.git
cd tiny-manager; git submodule update --init --recursive
make
make -C src/stm32f0-relay flash
The firmware registers itself as a CDC-ACM device and, under Linux, will be presented as ttyACMx where x is typically 0 on "simple" setups although will be larger if there is any USB communication or modem device installed (for example an unused 3G modem).
Type help
to get a list of available commands.
echo
- test command that echos back its inputhelp
- shows a list of commandspower
- manipulate the power line (hold it on for 7 seconds toreset
- manipulate the reset line, note that the BMC reset lineNote: This section is aspirational... but hopefully it will be implemented soon.
The firmware uses the STM32 unique device ID to provide every physical instance with a unique serial number. This allows udev rules to be introduced to ensure stable device enumeration regardless of any changes to the USB topology.
SUBSYSTEM=="tty", ATTRS{manufacturer}=="redfelineninja.org.uk", ATTRS{serial}=="045101780587252555FFC660", SYMLINK+="ttyrelayC660"
SUBSYSTEM=="tty", ATTRS{manufacturer}=="redfelineninja.org.uk", ATTRS{serial}=="7301C2152B72E52DE2744F3B", SYMLINK+="ttyrelay4F3B"
The serial number can picked up from the kernel log (dmesg
) or using udevadm:
udevadm info --attribute-walk /dev/ttyACM0 | grep serial
.
udevadm can also be used to re-apply the rule if any changes are made to the symlink: sudo udevadm trigger /dev/ttyACM0