]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/blobdiff - Makefile
RoCoN: new mode for testlxpwrrx to capture position, PWM and current for controller...
[fpga/lx-cpu1/lx-rocon.git] / Makefile
index 1baa58d1daea7187ef23074ab48adcbce320b4b2..a93d897645244ac7bdd90d5fecfc6ce32293b460 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@ PATH := $(BUILDDIR):$(PATH)
 USB_BOOT_VID_PID ?= 0xdead:0x2263
 USB_APP_VID_PID ?= 0x1669:0x1023
 
-PROG_BASE ?= 0x9000
-PROG_SIZE ?= 0x37000
+PROG_BASE ?= 0x00009000
+PROG_SIZE ?= 0x00037000
 
 # Attempt to create a build directory.
 $(shell [ -d ${BUILDDIR} ] || mkdir -p ${BUILDDIR})
@@ -41,19 +41,46 @@ sw:
 .PHONY: install-app
 install-app: $(BUILDDIR)/usb_sendhex $(BUILDDIR)/rocon-app.bin 
        -usb_sendhex -d $(USB_APP_VID_PID) -r # Fails if we're already in bootloader
-       usb_sendhex -w -d $(USB_BOOT_VID_PID) -s $(PROG_BASE) -l $(PROG_SIZE)
+       sleep 1
+       usb_sendhex -w -d $(USB_BOOT_VID_PID) -s $(PROG_BASE) -l $(PROG_SIZE) -e
        sleep 2
        usb_sendhex -d $(USB_BOOT_VID_PID) -s $(PROG_BASE) -f binary $(BUILDDIR)/rocon-app.bin
+
+.PHONY: run-app
+run-app:
        -usb_sendhex -d $(USB_BOOT_VID_PID) -r # FIXME: broken pipe yo-ho
 
 .PHONY: install-sdram
 install-sdram: $(BUILDDIR)/usb_sendhex $(BUILDDIR)/rocon-sdram.bin 
        -usb_sendhex -d $(USB_APP_VID_PID) -r # Fails if we're already in bootloader
        usb_sendhex -w -d $(USB_BOOT_VID_PID) -t 1 -s 0xA0000000 -f binary $(BUILDDIR)/rocon-sdram.bin
+
+.PHONY: run-sdram
+run-sdram:
        -usb_sendhex -d $(USB_BOOT_VID_PID) -g `usb_sendhex -d $(USB_BOOT_VID_PID) \
        -s 0xA0000004 -l 4 -t 1 -u -f dump - | \
        sed -n -e 's/^.*:\(..\) \(..\) \(..\) \(..\) */0x\4\3\2\1/p'`  # FIXME: broken pipe yo-ho
 
+.PHONY: install-fpga
+install-fpga: $(BUILDDIR)/usb_sendhex $(BUILDDIR)/lx-rocon.pkg
+       usb_sendhex -w -d $(USB_APP_VID_PID) -t 1 -s 0xA1C00000 -f binary $(BUILDDIR)/lx-rocon.pkg
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF000
+
+.PHONY: install-tumbl
+install-tumbl: $(BUILDDIR)/usb_sendhex $(BUILDDIR)/imem.bin $(BUILDDIR)/dmem.bin
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF100 -a 0x0001
+       usb_sendhex -w -d $(USB_APP_VID_PID) -t 3 -s 0x00000000 -f binary $(BUILDDIR)/imem.bin
+       usb_sendhex -w -d $(USB_APP_VID_PID) -t 3 -s 0x00001000 -f binary $(BUILDDIR)/dmem.bin
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF100 -a 0x0000
+
+.PHONY: install-firmware
+install-firmware: $(BUILDDIR)/usb_sendhex $(BUILDDIR)/fw_lxmaster.bin
+       usb_sendhex -w -d $(USB_APP_VID_PID) -t 1 -s 0xA1C00000 -f binary $(BUILDDIR)/fw_lxmaster.bin
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF024 -a `stat -L -c %s $(BUILDDIR)/fw_lxmaster.bin` # Upload LX MASTER firmware
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF011 -a 0 # Start IRC
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF023 -a 0 # Setup LX Master
+       usb_sendhex -d $(USB_APP_VID_PID) -c 0xF021 -a 0 # Start LX Master
+
 .PHONY: host
 host:
        make -C host V=1
@@ -64,7 +91,10 @@ host:
 .PHONY: hw
 hw:
        make -C hw
-       cp -a hw/_build/lx-rocon.bin $(BUILDDIR)/
+       cp -a hw/_build/lx-rocon.pkg $(BUILDDIR)/
+       cp -a hw/_build/imem.bin $(BUILDDIR)/
+       cp -a hw/_build/dmem.bin $(BUILDDIR)/
+       cp -a firmware/lxmaster.bin $(BUILDDIR)/fw_lxmaster.bin
 
 .PHONY: clean
 clean: