forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
386 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
obj/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# :set noet | ||
PROJ_NAME = comma | ||
|
||
CFLAGS = -O2 -Wall -std=gnu11 -DPEDAL | ||
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m3 | ||
CFLAGS += -msoft-float -DSTM32F2 -DSTM32F205xx | ||
CFLAGS += -I ../inc -I ../ -I ../../ -nostdlib | ||
CFLAGS += -T../stm32_flash.ld | ||
|
||
STARTUP_FILE = startup_stm32f205xx | ||
|
||
CC = arm-none-eabi-gcc | ||
OBJCOPY = arm-none-eabi-objcopy | ||
OBJDUMP = arm-none-eabi-objdump | ||
DFU_UTIL = "dfu-util" | ||
|
||
# pedal only uses the debug cert | ||
CERT = ../../certs/debug | ||
CFLAGS += "-DALLOW_DEBUG" | ||
|
||
canflash: obj/$(PROJ_NAME).bin | ||
../../tests/pedal/enter_canloader.py $< | ||
|
||
usbflash: obj/$(PROJ_NAME).bin | ||
../../tests/pedal/enter_canloader.py; sleep 0.5 | ||
PYTHONPATH=../../ python -c "from python import Panda; p = [x for x in [Panda(x) for x in Panda.list()] if x.bootstub]; assert(len(p)==1); p[0].flash('obj/$(PROJ_NAME).bin', reconnect=False)" | ||
|
||
recover: obj/bootstub.bin obj/$(PROJ_NAME).bin | ||
../../tests/pedal/enter_canloader.py --recover; sleep 0.5 | ||
$(DFU_UTIL) -d 0483:df11 -a 0 -s 0x08004000 -D obj/$(PROJ_NAME).bin | ||
$(DFU_UTIL) -d 0483:df11 -a 0 -s 0x08000000:leave -D obj/bootstub.bin | ||
|
||
obj/main.o: main.c ../*.h | ||
mkdir -p obj | ||
$(CC) $(CFLAGS) -o $@ -c $< | ||
|
||
obj/bootstub.o: ../bootstub.c ../*.h | ||
mkdir -p obj | ||
$(CC) $(CFLAGS) -o $@ -c $< | ||
|
||
obj/$(STARTUP_FILE).o: ../$(STARTUP_FILE).s | ||
$(CC) $(CFLAGS) -o $@ -c $< | ||
|
||
obj/%.o: ../../crypto/%.c | ||
$(CC) $(CFLAGS) -o $@ -c $< | ||
|
||
obj/$(PROJ_NAME).bin: obj/$(STARTUP_FILE).o obj/main.o | ||
# hack | ||
$(CC) -Wl,--section-start,.isr_vector=0x8004000 $(CFLAGS) -o obj/$(PROJ_NAME).elf $^ | ||
$(OBJCOPY) -v -O binary obj/$(PROJ_NAME).elf obj/code.bin | ||
SETLEN=1 ../../crypto/sign.py obj/code.bin $@ $(CERT) | ||
|
||
obj/bootstub.bin: obj/$(STARTUP_FILE).o obj/bootstub.o obj/sha.o obj/rsa.o | ||
$(CC) $(CFLAGS) -o obj/bootstub.$(PROJ_NAME).elf $^ | ||
$(OBJCOPY) -v -O binary obj/bootstub.$(PROJ_NAME).elf $@ | ||
|
||
clean: | ||
rm -f obj/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
MOVE ALL FILES TO board/pedal TO FLASH | ||
|
||
|
||
This is the firmware for the comma pedal. It borrows a lot from panda. | ||
|
||
The comma pedal is a gas pedal interceptor for Honda/Acura. It allows you to "virtually" press the pedal. | ||
|
||
This is the open source software. Note that it is not ready to use yet. | ||
|
||
== Test Plan == | ||
|
||
* Startup | ||
** Confirm STATE_FAULT_STARTUP | ||
* Timeout | ||
** Send value | ||
** Confirm value is output | ||
** Stop sending messages | ||
** Confirm value is passthru after 100ms | ||
** Confirm STATE_FAULT_TIMEOUT | ||
* Random values | ||
** Send random 6 byte messages | ||
** Confirm random values cause passthru | ||
** Confirm STATE_FAULT_BAD_CHECKSUM | ||
* Same message lockout | ||
** Send same message repeated | ||
** Confirm timeout behavior | ||
* Don't set enable | ||
** Confirm no output | ||
* Set enable and values | ||
** Confirm output |
Oops, something went wrong.