Skip to content

Commit

Permalink
Squashed 'panda/' changes from 9ee6285..39c1e39
Browse files Browse the repository at this point in the history
39c1e39 Cadillac: added brake msg forwarding
aaa1b14 bump VERSION
e0dd558 Fixed undefined reference error when "make recover" in EON
c91f038 Toyota pedal support (#159)
de1ba06 Build optimizer: back to Os now that 'make --recover' is fixed
fd23383 add -lgcc flag to fix "undefined reference to __aeabi_llsr" (#156)
1cc74e2 Reverted code optimizer option to O2 after 'make recover' broke
1218d09 Cadillac ascm proxy (#155)
064446f Panda: bumped version
93266a9 Hyundai: allow the same max steer torque as stock
d275fa8 Subaru: Forwarding (#152)

git-subtree-dir: panda
git-subtree-split: 39c1e39
  • Loading branch information
Vehicle Researcher committed Feb 20, 2019
1 parent d21c659 commit a25e215
Show file tree
Hide file tree
Showing 19 changed files with 527 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ jobs:
command: |
docker run panda_build /bin/bash -c "cd /panda/board; make bin"
- run:
name: Build Pedal STM image
name: Build Honda Pedal STM image
command: |
docker run panda_build /bin/bash -c "cd /panda/board/pedal; make obj/comma.bin"
docker run panda_build /bin/bash -c "cd /panda/board/pedal_honda; make obj/comma.bin"
- run:
name: Build Toyota Pedal STM image
command: |
docker run panda_build /bin/bash -c "cd /panda/board/pedal_toyota; make obj/comma.bin"
- run:
name: Build NEO STM image
command: |
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.8
v1.2.0
1 change: 1 addition & 0 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ int main() {
usb_init();

// default to silent mode to prevent issues with Ford
// hardcode a specific safety mode if you want to force the panda to be in a specific mode
safety_set_mode(SAFETY_NOOUTPUT, 0);
can_silent = ALL_CAN_SILENT;
can_init_all();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions board/pedal_toyota/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj/*
58 changes: 58 additions & 0 deletions board/pedal_toyota/Makefile
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/*
30 changes: 30 additions & 0 deletions board/pedal_toyota/README
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
Loading

0 comments on commit a25e215

Please sign in to comment.