Replace the temperature calculation in daq.cpp by the DAQ NTC sensor
driver. Temperatures below -50 °C are still considered as a missing
sensor. A missing MOSFET temperature sensor keeps the previous value
instead of setting an implausible temperature.
The series resistor of the NTCs was specified as multiplier of the DAQ
channels before. It is moved to the pullup-ohm property of the new
ntc-fets and ntc-bat nodes and the gain of the DAQ channels is set to 1.
Note for out-of-tree boards: The temp-fets and temp-bat DAQ channels need
the labels daq_temp_fets and daq_temp_bat and a corresponding
libresolar,daq-ntc-thermistor node with the labels ntc_fets and ntc_bat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable NVS in flash for the ThingSet storage. As the STM32G0B1 doesn't
have an RNG, a timer-based number generator is used for the automatic
CAN node address assignment of ThingSet.
The board is added to the firmware build tests, as it is supported by
the DAQ driver now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the register-level ADC, DAC and DMA handling in daq_driver.c by
the new DAQ driver. The application only maps the measurements to the
power ports and DC buses and handles the alerts. The factory calibration
values are removed from mcu.h, as they are provided by the driver now.
All boards are migrated to the new libresolar,stm32-daq compatible. The
unit tests use the emulated DAQ.
The high-side overvoltage limit is now set after the DAQ setup. Before,
the limit was calculated before any reading of the internal reference
voltage was available, so that the alert never triggered on boards
without fixed reference voltage (STM32F0 and STM32L0).
Note for out-of-tree boards: The adc-inputs node must use the compatible
libresolar,stm32-daq instead of adc-inputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Board definition for the Spinvert Boost 4820, an active rectifier with
DC/DC boost converter for small wind, hydro or pedal generators, based
on the KiCad schematic of the hardware.
- STM32G0B1CC with 8 MHz HSE and 64 MHz system clock
- Synchronous boost converter driven by TIM1 CH2/CH2N (LM5107) at
128 kHz
- Dump load output driven by TIM2 CH2
- ADC inputs for DC voltages, DC/DC current (INA299A2 with reference
voltage from DAC1), dump load current, MOSFET temperature and the
generator phase voltages
- FDCAN1 with TCAN334 transceiver, USART1 at the USB-C SBU pins
(debug accessory mode) and USB device
The STM32G0 is not yet supported by the ADC data acquisition of the
application, so the firmware can't be built for this board yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>