From d6ff9f5bda85206d163f02f7cc78e47968c434ce Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Fri, 12 Jul 2024 23:40:38 -0500 Subject: Fix automated serial input --- hexedit/Makefile | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) (limited to 'hexedit/Makefile') diff --git a/hexedit/Makefile b/hexedit/Makefile index a42b16a..d1cfa5b 100644 --- a/hexedit/Makefile +++ b/hexedit/Makefile @@ -1,5 +1,5 @@ PICO = /dev/disk/by-label/RPI-RP2 -PICO_CONSOLE = /dev/ttyUSB0 +DEVICE = /dev/ttyUSB0 .PHONY: build build: hexedit.oe @@ -7,44 +7,31 @@ build: hexedit.oe hexedit.oe: hexedit.bin od -An -v hexedit.bin | sed "s/^ //" | tr " " "\n" > hexedit.oe -hexedit.bin: hexedit.o - arm-none-eabi-ld -T pico_bin.ld -o hexedit.bin hexedit.o - arm-none-eabi-objcopy -O binary hexedit.bin +hexedit.bin: hexedit.elf + arm-none-eabi-objcopy -O binary hexedit.elf hexedit.bin -objects = hexedit.o main.o +hexedit.elf: pico_bin.ld hexedit.o + arm-none-eabi-ld -T pico_bin.ld -o hexedit.elf hexedit.o -$(objects): %.o: %.s - arm-none-eabi-as -o $@ $< - -hexedit.uf2: hexedit.elf - ../elf/elf2uf2 hexedit.elf hexedit.uf2 - -hexedit.elf: $(objects) - arm-none-eabi-ld -T pico_ram_only.ld -o hexedit.elf $(objects) ../setup/setup.so +hexedit.o: hexedit.s + arm-none-eabi-as -o hexedit.o hexedit.s .PHONY: clean clean: - rm -f hexedit.elf hexedit.uf2 hexedit.bin hexedit.oe *.o + rm -f hexedit.elf hexedit.bin hexedit.oe hexedit.o slowcat .PHONY: dump dump: hexedit.bin @od hexedit.bin .PHONY: serial -serial: $(PICO_CONSOLE) hexedit.oe - cat hexedit.oe | tr "\n" "\r" > PICO_CONSOLE - echo -n "G" > PICO_CONSOLE +serial: $(DEVICE) hexedit.oe slowcat + cat hexedit.oe | tr "\n" "\r" | ./slowcat | picocom -b 115200 -q $(DEVICE) + @echo + echo -n "G" | picocom -b 115200 -q $(DEVICE) + @echo -$(PICO_CONSOLE): +$(DEVICE): @echo Serial device not found @echo Connect USB cable from USB-UART bridge @false - -.PHONY: flash -flash: $(PICO) hexedit.uf2 - cat hexedit.uf2 > $(PICO) - -$(PICO): - @echo "RPI-RP2 bootloader drive not found" - @echo Connect the pico with USB cable while holding bootsel button - @false -- cgit v1.2.3