Firmware and PCB Co-Design

Flux is an AI hardware engineer. It designs firmware with the schematic, PCB, and board bring-up plan in one project.

Keep firmware and the PCB in one project

Ask Flux to connect the firmware work to the schematic and board.

Set up this project for the schematic, PCB, firmware source, pin map, and bring-up plan.
Connect the firmware starter document to the current board and its microcontroller.
Keep the schematic, firmware, tests, pin map, and board test plan together as the design changes.
Review the firmware and PCB as one device and list the project files that describe each part.

Flux keeps the firmware starter document, pin map, source, tests, build outputs, and bring-up plan with the project. The schematic and PCB provide the connections and components that firmware uses.

Open Chat and ask Flux to create or update the firmware for the current board. Open Files in the project view switcher to read the firmware document, pin map, and bring-up plan.

Generate firmware from the schematic

Ask Flux to write the firmware behavior for the board and its peripherals.

Write firmware for this schematic. Read the temperature sensor over I2C once per second and send values over USB serial.
Create firmware for this motor controller. Initialize the encoder, read its position, and drive the PWM output.
Generate firmware from the schematic and document the MCU, framework, build system, and connected peripherals.
Set up startup for the clocks, GPIO, peripherals, and interrupts before the main loop.

Flux writes the firmware starter document from the schematic. It records the microcontroller, framework, build system, libraries, and board setup. It maps pin definitions to schematic net names and initializes the peripherals.

Name the behavior, timing, communication, and startup requirements. Flux can add sensor reads, actuator control, wireless communication, error handling, and a watchdog.

Map pins and choose assignments

Ask Flux to create a pin map or change MCU pin assignments.

Create a pin map from this schematic with MCU pin, connected net, function, direction, and notes.
Swap the MCU pins for I2C and the status LED to make the PCB routes easier, then update the schematic, firmware, and pin map.
Check for pin conflicts and assign each peripheral to an available MCU pin.
Update the pin map and firmware defines after this pin change.

Flux maps firmware pins to schematic nets. It can change MCU pin assignments to make PCB routing easier and update the schematic, firmware, and pin map together.

The pin map can record bus connections, device addresses, clock settings, power modes, boot pins, and reset signals. Open Files to read the pin map in the firmware starter document.

Configure buses, clocks, and boot behavior

Ask Flux to document the peripheral and startup configuration from the schematic.

List the I2C, SPI, UART, and RS-485 connections with device addresses and bus settings.
Record the oscillator, PLL, and clock rates used by the firmware.
Add the regulator modes, rail voltages, reset state, and boot strap pins to the firmware setup.
Check that the bus and boot pin assignments match the schematic.

Flux maps bus connections and documents device addresses, oscillator and PLL settings, power modes, boot pins, and reset behavior. It uses these settings when it writes firmware initialization and build notes.

See Pin and Peripheral Setup for the pin map and board configuration workflow.

Continue from an existing firmware repository

Ask Flux to connect your existing source code to the project board.

Read this firmware repository and map its sensor driver to the I2C pins in the schematic.
Use the firmware in this ZIP and update its pin definitions for the current board.
Continue from this source and add the new status LED using its schematic net.
Read our private firmware repository and compare its pin assignments with this board.

Share a public repository link, upload a ZIP, or paste source files in Chat. For a private repository, Flux asks for an access token in chat and reads the repository from the chat's computer.

Ask Flux to review the code structure before changing it. Flux can connect the existing source to the schematic and document its build system, libraries, and board configuration.

Build, test, flash, and debug firmware

Ask Flux to build the source, run tests, and prepare the board commands.

Build this firmware. Return the image files and report flash use, RAM use, and the largest symbols.
Run host unit tests for the sensor conversion and report the test results and coverage.
Give me the flashing command for this board and firmware image, with serial-monitor steps.
Read this crash dump, find the cause, and update the firmware to handle the failure.

Flux builds firmware and returns image files, memory use, and build notes. It can run host unit tests and analyze the source. It provides a flashing command for you to run with the board connected to your computer.

Paste serial output or attach a crash dump in Chat to debug firmware. Ask Flux to update logging or source code, then open Files to read the saved changes.

See Build and Test Firmware for build outputs, tests, flashing, and serial debugging.

Plan bring-up and add test points

Ask Flux to prepare the board bring-up plan and add test points for measurements.

Create a bring-up plan with equipment, power rails, programming steps, and functional tests.
Add test points for the power rails, reset, boot, and the sensor bus signals.
Add expected rail voltages and pass/fail checks to the plan.
Create test firmware and a serial command to exercise each sensor and actuator.

Flux prepares a bring-up plan with equipment, visual inspection, rail voltages, programming steps, interface checks, and expected results. Ask Flux to place test points at the signals you need to probe during bring-up.

Open Files to read the bring-up plan. It can record expected and measured values and a pass/fail result for each check.

See Board Bring-Up for the plan and functional checks.

Update firmware after board changes

Ask Flux to update firmware and project documents after a schematic or PCB change.

I changed the sensor pin and added an interrupt. Update firmware, the pin map, and bring-up plan.
I removed the status LED from the PCB. Update the firmware source and pin map.
Update the bus setup and tests for the new I2C sensor and connector.
Review the changed PCB and list the firmware, pin map, and bring-up updates it needs.

Flux can revise firmware initialization, pin definitions, tests, and bring-up steps to match the schematic. Ask it to re-check the pin map against the changed connections.

Use mechanical values in firmware

Ask Flux to add dimensions or positions from the mechanical model as firmware constants.

Use the sensor position in the enclosure as firmware constants in millimeters.
Read the spacer volume from the mechanical model and add it as a named firmware constant.
Use the wheelbase from the mechanical assembly in the motor-control firmware.
Update the firmware constants when the mounting position changes in the mechanical model.

Flux can read dimensions and positions from the mechanical model and use them in firmware source. Ask it to update the constants and project notes when the model changes.