Skip to content

Commit

Permalink
start work on pedal canloader
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Mar 9, 2018
1 parent 626e312 commit 000715b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions board/pedal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ void CAN1_RX0_IRQHandler() {
#endif
uint32_t address = CAN->sFIFOMailBox[0].RIR>>21;
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 *dat2 = (uint8_t *)&CAN->sFIFOMailBox[0].RDHR;
uint16_t value_0 = (dat[0] << 8) | dat[1];
Expand Down
8 changes: 8 additions & 0 deletions tests/pedal/enter_canloader.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 000715b

Please sign in to comment.