start work on pedal canloader

This commit is contained in:
George Hotz 2018-03-09 14:30:28 -08:00
parent 626e3123c6
commit 000715b51d
2 changed files with 15 additions and 0 deletions

View File

@ -121,6 +121,13 @@ void CAN1_RX0_IRQHandler() {
#endif #endif
uint32_t address = CAN->sFIFOMailBox[0].RIR>>21; uint32_t address = CAN->sFIFOMailBox[0].RIR>>21;
if (address == CAN_GAS_INPUT) { if (address == CAN_GAS_INPUT) {
// softloader entry
if (CAN->sFIFOMailBox[0].RDLR == 0xdeadface && CAN->sFIFOMailBox[0].RDHR == 0x0ab00b1e) {
enter_bootloader_mode = ENTER_SOFTLOADER_MAGIC;
NVIC_SystemReset();
}
// normal packet
uint8_t *dat = (uint8_t *)&CAN->sFIFOMailBox[0].RDLR; uint8_t *dat = (uint8_t *)&CAN->sFIFOMailBox[0].RDLR;
uint8_t *dat2 = (uint8_t *)&CAN->sFIFOMailBox[0].RDHR; uint8_t *dat2 = (uint8_t *)&CAN->sFIFOMailBox[0].RDHR;
uint16_t value_0 = (dat[0] << 8) | dat[1]; uint16_t value_0 = (dat[0] << 8) | dat[1];

8
tests/pedal/enter_canloader.py Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env python
from panda import Panda
if __name__ == "__main__":
p = Panda()
p.set_safety_mode(0x1337)
p.can_send(0x200, "\xce\xfa\xad\xde\x1e\x0b\xb0\x0a", 0)