FreeRTOS

STM32-based Power Control Board

Who: Marble
When: August 2018

We were contacted to provide quick-turn firmware development for a power control board. The power control board was destined for use in a robot, and its primary responsibility was to convert 48V down to 12V for various subsystems. Other core features were requested:

  • Control power distribution to various subsystems

  • Perform an automatic system power-on sequence

  • Collect telemetry data from INA233 sensors and the voltage regulator

    • Power/Current/Voltage/Temperature

  • Provide an I2C slave interface for testing and validation purposes

  • Broadcasting telemetry data over CAN periodically

  • Provide a CAN interface for controlling the power system

  • Handle button presses to override the system power state

The most critical aspect of this project was the timeframe. The robots were to be assembled 45 days after the initial project discussion. By the time hardware was in hand, we were left with 28 working days. We completed the project in 22 days, well under the time budget. We were also able to release early firmware builds for testing and validation, allowing us to adjust the specification and behavior on the fly.

In order to meet this deadline, we leveraged the STM32 code generation capabilities and leveraged FreeRTOS. While we do not normally support vendor-generated code on production products, the STM32CubeMX software allowed us to create an initial design within the specified time period. The firmware is also intended for prototype systems, allowing for longer-term improvements to be made before hardware/software is deployed to customers.

The firmware was designed in an event-driven manner, with separate threads to handle the I2C slave interface, CAN broadcasting, CAN command/response, caching telemetry data, and changes to the system power state. By keeping the design simple and event-driven, we were able to quickly implement all of the required features. 

We also delivered a product specification which covered the hardware components, firmware requirements, I2C slave communication interface, and CAN communication interface.

Components used on this product:

  • STM32F103

  • INA233 Power/Current/Voltage Sensor

  • BMR456 Voltage Regulator

Communication Protocols Used on this Product:

  • I2C Master

  • I2C Slave (implemented interface)

  • CAN (implemented interface)

Testimonial

Jason Calaiaro, HW lead at Marble, had this to say:

Every time Phillip helps us on a project, he dives right in to understand the requirements and schedule constraints. He provides us with a detailed plan of what he will accomplish and when, he always delivers on time, and his documentation is incredible.