oresat / oresat-firmware

OreSat firmware based on ChibiOS for M0 and M4 microcontrollers
GNU General Public License v3.0
36 stars 13 forks source link

Re-enable MCU temperature/vref sensing #100

Open ThirteenFish opened 3 months ago

ThirteenFish commented 3 months ago

Our F0s are capable of measuring internal temperature and vref using the ADC. See the STM32F0 Reference Manual RM0091 section 13.8. These were intended to be measured on all our cards and reported via CANopen record 0x3003 ('system'). This was mostly implemented in sensors.c but for unknown reasons it was disabled in 37a63659. Regardless, as implemented it conflicts with other ADC users, namely the ADCS and diode card projects, so part of re-enabling will require a bit of rethink on how to share the ADC. As a personal preference I'd probably prefer a bit of boiler plate by separating it out from oresat_init()/oresat_start() but that would depend on how easy the fix is.

As part of this ticket there should be some kind of test or documentation (possibly making use of oresat-configs pdo?) to verify that the system sensor reporting works on all cards, as reported by CANopen. There's currently no automated suite setup for running on real hardware but it should be a consideration.