Dartmouth-Formula-Racing / DFR_CVC_2019

Dartmouth Formula Racing Central Vehicle Controller Codebase
10 stars 5 forks source link

Random CVC failure during start-up sequence #19

Closed leina05 closed 5 years ago

leina05 commented 5 years ago

When testing start-up sequence, CVC fault light would go on randomly even though we weren't going into CVC fault state. Behavior:

Solution: turned out to be PLC watchdog due to tasks being starved when program would get stuck in SPI interrupt. We think this happened because initiate_SPI_transmission would get interrupted before setting SPI state to wait_for_CLT (this is possible because it was being called inside a task). We addressed this by making the call to initiate_SPI_transmission a critical section.

Concerns: the PLC_task had the highest priority, so theoretically it shouldn't have been interrupted by another task, though it could have been interrupted by user-defined interrupts (CAN, SPI)

Must wait and see if this fixes the problem, seems to be working for now...