To compile the firmware run:
cmake -B build
cmake --build build --target FlightController.hex
This assumes that an AVRISP mk2 is used, if you use a different programmer
change the -c
flag.
avrdude -p m2560 -c avrisp2 -U flash:w:FlightController.hex:i
The fuses select the "Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 16K CK + 4.1 ms; [CKSEL=1111 SUT=10]" clock, disables the clock divider, enables the preserve eeprom flag, enables the watchdog timer, enables SPI and disables JTAG and OCD. The brownout detection level is set to 1.8V.
Fusebyte | Value |
---|---|
Low | 0xEF |
High | 0xC1 |
Extended | 0xFE |
avrdude -p m2560 -B 10 -c avrisp2 -U lfuse:w:0xef:m -U hfuse:w:0xc1:m -U efuse:w:0xfe:m
The LEDs are controlled by the error handler. The lower 4 LEDs signal the component which triggered the error handler. The upper 4 LEDs signal the exception ID.
The error IDs are:
Component | Exception | LED configuration |
---|---|---|
Application | - | xxxx β―β―β―π΄ |
System | Watchdog | β―β―β―π΄ β―β―π΄β― |
Brownout | β―β―π΄β― β―β―π΄β― | |
Low-Prio Timer Runtime | β―β―π΄π΄ β―β―π΄β― | |
High-Prio Timer Runtime | β―π΄β―β― β―β―π΄β― | |
IMU | Init timeout error | β―β―β―π΄ β―β―π΄π΄ |
Init self test error | β―β―π΄β― β―β―π΄π΄ | |
Status error | β―β―π΄π΄ β―β―π΄π΄ | |
Read timeout | β―π΄β―β― β―β―π΄π΄ | |
Flightcomputer | - | xxxx β―π΄β―β― |
Remote | - | xxxx β―π΄β―π΄ |
Mode Handler | No IMU Data | β―β―β―π΄ β―π΄π΄β― |
No FCP Data | β―β―π΄β― β―π΄π΄β― | |
No Remote Data | β―β―π΄π΄ β―π΄π΄β― | |
BNO055 | Unexpected read success | β―β―β―π΄ β―π΄π΄π΄ |
Unexpected write success | β―β―π΄β― β―π΄π΄π΄ | |
Read fail | β―β―π΄π΄ β―π΄π΄π΄ | |
Write fail | β―π΄β―β― β―π΄π΄π΄ | |
Invalid address | β―π΄β―π΄ β―π΄π΄π΄ | |
Write disabled | β―π΄π΄β― β―π΄π΄π΄ | |
Wrong start byte | β―π΄π΄π΄ β―π΄π΄π΄ | |
Bus overrun | π΄β―β―β― β―π΄π΄π΄ | |
Max length | π΄β―β―π΄ β―π΄π΄π΄ | |
Min length | π΄β―π΄β― β―π΄π΄π΄ | |
Receive char timeout | π΄β―π΄π΄ β―π΄π΄π΄ | |
Callback buffer invalid | π΄π΄β―β― β―π΄π΄π΄ | |
Invalid sync | π΄π΄β―π΄ β―π΄π΄π΄ |