----------- Fresh install setup raspbi-config enable SPI, I2C, Serial (NO LOGIN SHELL) set up ssh: ssh-keygen copy PC pub key to rpi ~/.ssh/authorized_keys --- # use sudo -E to preserve environmental variables for python3 sudo apt-get install i2c-tools sudo apt install stm32flash /usr/local/bin/stm32flash -r hhh -a 0x3b /dev/i2c-1 stm32flash -r PBFW_IBMPC_PBID1_V0_2_0.dfu -a 0x3b /dev/i2c-1 sudo apt install dfu-util sudo dfu-util --device ,0483:df11 -a 0 -D ~/usb4vc/firmware/PBFW_ADB_PBID2_V0_1_1.dfu -------------- Serial setup: serial clock is tied to GPU clock, need to fix it for it to be stable sudo nano /boot/config.txt, add: gpu_freq=250 gpu_freq_min=250 also, use /dev/serial0 to maintain compatibility for all models of pi -------------- Luma OLED driver https://luma-oled.readthedocs.io/en/latest/software.html sudo apt-get update sudo apt-get install python3 python3-pip python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 -y sudo -H pip3 install luma.oled -------------- Nintendo Pro controller https://retropie.org.uk/docs/Nintendo-Switch-Controllers/ sudo apt install git sudo apt install dkms sudo apt-get install libudev-dev sudo apt-get install libevdev-dev git clone https://github.com/nicman23/dkms-hid-nintendo cd dkms-hid-nintendo sudo dkms add . sudo dkms build nintendo -v 3.2 sudo dkms install nintendo -v 3.2 git clone https://github.com/DanielOgorchock/joycond.git cd joycond cmake . sudo make install sudo systemctl enable --now joycond ------------------- remove CTRL+ALT+DELETE reboot sudo rm /lib/systemd/system/ctrl-alt-del.target sudo ln -s /dev/null /lib/systemd/system/ctrl-alt-del.target sudo systemctl daemon-reload ------------------- run script on launch: MAKE SURE SERIAL LOGIN SHELL IS TURNED OFF https://raspberrypi-guide.github.io/programming/run-script-on-boot sudo su pip3 install evdev sudo nano /etc/rc.local cd /home/pi/usb4vc; python3 usb4vc_main.py & kill -SIGINT pid --------------- relaunch if exits: while true; do echo think; sleep 1; done --------- serial format: U4 CMD_TYPE PAYLOAD U4 header, any command not beginning with U4 is ignored CMD TYPE: SC: Shell Command, execute whatever follows in shell RF: Read File WF: Write File GG: get gamepad file QUIT: quit program U4 RF /home/pi/usb4vc_data/config.json U4 WF /home/pi/usb4vc_data/test.txt c3NoIHBpQDE5Mi4xNjguMS41Ng== ------------ boot speedup: sudo nano /boot/config.txt disable_splash=1 boot_delay=0 sudo nano /boot/cmdline.txt Add quiet after rootwait raspberry pi 3 before speedup: 19.16 18.07 19.11 18.37 after speedup: 16.95 16.45 ------------- usb auto mount: sudo apt install usbmount sudo nano /lib/systemd/system/systemd-udevd.service change to PrivateMounts=no ----------- usb folder format: usb root: usb4vc_data rpi_app source code of raspberry pi application firmware dfu file for protocol boards naming format: PBFW_IBMPC_PBID1_V0_1_0.dfu config config and mapping files