Skip to content

Commit 5157472

Browse files
committed
restore wiki folder
1 parent 0b911bc commit 5157472

22 files changed

+2198
-0
lines changed

wiki/7110-dev-board-note.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Upgrade bootloader and firmware
2+
3+
for os image 69 and later
4+
5+
https://forum.rvspace.org/t/visionfive-2-debian-image-december-released/1097/43?page=2
6+
7+
https://github.com/starfive-tech/VisionFive2/releases/ download latest sdcard.img, dd to sd card, then hdmi or serial port wait for the system to start
8+
9+
## Flash files
10+
```
11+
flashcp -v u-boot-spl.bin.normal.out /dev/mtd0
12+
flashcp -v visionfive2_fw_payload.img /dev/mtd1
13+
```
14+
15+
## 7110 full os large mirror address
16+
https://debian.starfivetech.com/

wiki/Compile-Devterm-CM4-kernel.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# System
2+
ubuntu 22.04 gcc8.4.0
3+
```
4+
sudo apt install gcc-8 gcc-8-aarch64-linux-gnu gcc-8-arm-linux-gnueabihf
5+
```
6+
7+
# Download patch
8+
```
9+
git clone https://github.com/clockworkpi/DevTerm.git
10+
```
11+
12+
# Download kernel and patch it
13+
```
14+
git clone https://github.com/raspberrypi/linux
15+
cd linux
16+
git checkout 3a33f11c48572b9dd0fecac164b3990fc9234da8
17+
cp ~/DevTerm/Code/patch/cm4/cm4_kernel_0704.patch .
18+
git apply cm4_kernel_0704.patch
19+
20+
#Strongly recommend to use gcc 8.4.0 as the cross compiler
21+
KERNEL=kernel7l make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig
22+
KERNEL=kernel7l make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j1
23+
INSTALL_MOD_PATH=./modules make modules_install
24+
rm modules/lib/modules/*/build
25+
rm modules/lib/modules/*/source
26+
27+
mkdir output
28+
mkdir output/boot
29+
mkdir output/lib/modules -p
30+
mkdir output/boot/overlays
31+
32+
cp -rf modules/lib/modules/5.10.17-v7l+ output/lib/modules/
33+
cp arch/arm/boot/dts/overlays/*.dtbo output/boot/overlays/
34+
cp arch/arm/boot/dts/bcm2711-rpi-cm4.dtb output/boot/
35+
cp arch/arm/boot/zImage output/boot/kernel7l.img
36+
37+
```
38+
39+
output is the folder contains all kernel stuff
40+
41+
# config.txt
42+
```
43+
disable_overscan=1
44+
dtparam=audio=on
45+
[pi4]
46+
dtoverlay=vc4-fkms-v3d
47+
max_framebuffers=2
48+
49+
[all]
50+
dtoverlay=dwc2,dr_mode=host
51+
dtoverlay=vc4-kms-v3d-pi4,cma-384
52+
dtoverlay=devterm-pmu
53+
dtoverlay=devterm-panel
54+
dtoverlay=devterm-misc
55+
dtoverlay=audremap,pins_12_13
56+
57+
dtparam=spi=on
58+
gpio=10=ip,np
59+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# a06 a04
2+
```
3+
git clone https://github.com/clockworkpi/DevTerm.git
4+
sudo systemctl stop devterm-socat devterm-printer
5+
6+
sudo apt remove devterm-wiringpi-cpi
7+
8+
cd DevTerm/Code/devterm_wiringpi_cpi/
9+
10+
sudo ./build
11+
cd ~/DevTerm/Code/thermal_printer/
12+
sudo apt install -y libfreetype-dev
13+
make
14+
15+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Download kernel source for andriod of rpi4
2+
3+
**sync-andriod-kernel.sh**
4+
```
5+
#!/bin/bash
6+
7+
BIN_DIR=$HOME/bin
8+
REPO_PATH=$BIN_DIR/repo
9+
10+
if [ ! -d $BIN_DIR ]
11+
then
12+
mkdir $BIN_DIR
13+
add_path_env $BIN_DIR
14+
curl https://storage.googleapis.com/git-repo-downloads/repo > $REPO_PATH
15+
chmod a+x $REPO_PATH
16+
else
17+
echo "folder already exits. $BIN_DIR"
18+
fi
19+
20+
export PATH=$PATH:$BIN_DIR
21+
22+
cd /data/andriod-kernel
23+
repo init -u https://github.com/android-rpi/kernel_manifest -b arpi-5.10
24+
repo sync
25+
26+
27+
```
28+
29+
# Compile
30+
```
31+
cd /data/andriod-kernel/
32+
./build/build.sh
33+
```
34+
35+
# Replace files
36+
37+
```
38+
sudo losetup --show -f -P lineage-19.1-20220511-UNOFFICIAL-KonstaKANG-rpi4.img # assume /dev/loop0
39+
sudo mount /dev/loop0p1 /mnt/p1
40+
41+
# Copy kernel binaries to boot partition
42+
cp -rf /data/andriod-kernel/out/arpi-5.10/dist/Image to /mnt/p1
43+
cp -rf /data/andriod-kernel/out/arpi-5.10/dist/bcm2711-rpi-*.dtb /mnt/p1
44+
cp -rf /data/andriod-kernel/out/arpi-5.10/dist/vc4-kms-v3d-pi4.dtbo to /mnt/p1/overlays/
45+
46+
sudo umount /mnt/p1
47+
sudo losetup -D /dev/loop0
48+
49+
```
50+
51+
# Reference Url
52+
* https://github.com/android-rpi/kernel_manifest
53+
* https://github.com/android-rpi/device_arpi_rpi4
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Build bin
2+
3+
```
4+
git clone https://github.com/rogerclarkmelbourne/STM32duino-bootloader
5+
6+
cd STM32duino-bootloader
7+
8+
make generic-pc13
9+
10+
```
11+
this will produce `bootloader_only_binaries/generic_boot20_pc13.bin`
12+
## Convert bootloader to hex format
13+
using `srec_cat` to convert
14+
windows: http://srecord.sourceforge.net/
15+
linux: sudo apt install srecord
16+
17+
```
18+
srec_cat bootloader_only_binaries/generic_boot20_pc13.bin -Binary -offset 0x08000000 -output bootloader_only_binaries/generic_boot20_pc13.hex -Intel
19+
```
20+
21+
## Next is to use stm32Cube to flash the bootloader
22+
* Download the stm32cube programmer
23+
[stm32cube programmer](https://www.st.com/en/development-tools/stm32cubeprog.html)
24+
25+
* Put 1 ON in the back of keyboard
26+
* Connect keyboard with a usb-serial convert by fpc, in order of [IO MAP](https://github.com/clockworkpi/DevTerm/wiki/Keyboard-with-FPC-60pin-0.5mm)
27+
* Click connect on STM32cube programmer
28+
* flash it
29+
30+
![2022-09-26_13-04](https://user-images.githubusercontent.com/523580/192197890-dcb6d6fc-0ef5-4870-b9d3-ae03fc5f5110.png)
31+
![2022-09-26_13-04_1](https://user-images.githubusercontent.com/523580/192197900-c7f8b448-3812-403f-b7b0-728248533790.png)
32+
![2022-09-26_13-09](https://user-images.githubusercontent.com/523580/192198205-8edecc5f-c30e-4837-8b3c-7f97c97ba40a.png)
33+
34+
35+
36+
# Flash Arudino
37+
## Arduino IDE
38+
* add stm32duino pacakage index in **Preference panel** : http://dan.drown.org/stm32duino/package_STM32duino_index.json as **Additional Boards Manager URLs:** and install STM32F1xx/GD32F1xx boards
39+
40+
![image](https://user-images.githubusercontent.com/523580/192198944-fd0fbf55-0977-42bb-9256-f7bcdf331466.png)
41+
42+
* verbose all outputs:
43+
![image](https://user-images.githubusercontent.com/523580/192198967-d4738c42-897e-412a-b630-afab45d274c3.png)
44+
45+
* Select upload method ,board type is **Generic STM32F103R series **
46+
![image](https://user-images.githubusercontent.com/523580/192198991-9757e354-c8ec-4859-95e9-dba732773fb1.png)
47+
48+
* Set cpu mhz to 48Mhz
49+
![image](https://user-images.githubusercontent.com/523580/192199043-7f877adb-830e-4323-8799-06e115843b46.png)
50+
51+
52+
* Put 1 OFF in the back of keyboard
53+
* User arduino IDE to open [devterm_keyboard.ino](https://github.com/clockworkpi/DevTerm/blob/main/Code/devterm_keyboard/devterm_keyboard.ino)
54+
* flash it
55+
![image](https://user-images.githubusercontent.com/523580/192199494-8778bfcc-fcff-4bd0-9f51-f034a080f981.png)
56+
57+
58+
# CN version
59+
https://shimo.im/docs/Tc8RVQWdjvXtwhYv/ 《GD32f103rgt6/CKSF103R* 与stm32duino bootloader》
60+
61+
custom keyboard:
62+
63+
https://forum.clockworkpi.com/t/keyboard-stuck-in-bootloader-mode/8830/11
64+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Prepare
2+
```
3+
mkdir -p ~/data/andriod
4+
mkdir -p ~/data/github/lineage-rpi
5+
cd ~/data/github/lineage-rpi
6+
7+
git clone https://github.com/lineage-rpi/android_kernel_brcm_rpi -b lineage-19.1
8+
git clone https://github.com/lineage-rpi/proprietary_vendor_brcm -b lineage-19.1
9+
10+
cd ~/data/andriod
11+
12+
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b pie-release
13+
```
14+
# Fix firmware path
15+
16+
edit `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/configs/lineageos_rpi4_defconfig` line 1537
17+
to be
18+
`CONFIG_EXTRA_FIRMWARE_DIR="/home/cpi/data/github/lineage-rpi/proprietary_vendor_brcm/rpi4/proprietary/vendor/firmware"`
19+
20+
# Compile
21+
22+
```
23+
cd ~/data/github/lineage-rpi/android_kernel_brcm_rpi
24+
```
25+
26+
create **m.sh** with content like:
27+
28+
```
29+
#!/bin/bash
30+
31+
export PATH=/home/cpi/data/andriod/aarch64-linux-android-4.9/bin:$PATH
32+
33+
ARCH=arm64 CROSS_COMPILE=aarch64-linux-androidkernel- make lineageos_rpi4_defconfig
34+
ARCH=arm64 CROSS_COMPILE=aarch64-linux-androidkernel- make Image dtbs -j1
35+
```
36+
37+
```
38+
chmod +x m.sh
39+
./m.sh # start kernel compile
40+
```
41+
42+
# Replace files
43+
copy
44+
* bcm2711-rpi-400.dtb
45+
* bcm2711-rpi-4-b.dtb
46+
* bcm2711-rpi-cm4.dtb
47+
* bcm2711-rpi-cm4s.dtb
48+
49+
50+
from `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/boot/dts/broadcom/` to lineage os image boot partition
51+
52+
copy `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/boot/Image` to to lineage os image boot partition
53+
54+
copy `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/boot/dts/overlays/vc4-kms-v3d.dtbo` to to lineage os image boot partition/overlays
55+
56+
# Kernel config
57+
https://gist.github.com/cuu/92bfa28a9b6de421834e5f9f408a12a4
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Compile the widescreen version of Cave Story from the source code
2+
3+
### Install the necessary packages:
4+
5+
```
6+
sudo apt update
7+
8+
sudo apt install build-essential libpng-dev libjpeg-dev make cmake cmake-data git libsdl2-dev libsdl2-doc libsdl2-gfx-dev libsdl2-gfx-doc libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev cmake -y -qq
9+
```
10+
11+
12+
### Compile the engine (it takes about 1 hour):
13+
```
14+
cd ~
15+
git clone https://github.com/nxengine/nxengine-evo
16+
```
17+
### Modified to the widescreen version:
18+
19+
`vim ~/nxengine-evo/src/graphics/Renderer.cpp`
20+
21+
22+
### Edit the 225 line and save and exit the following line
23+
```
24+
{(char *)"1280x480", 1280, 480, 640, 240, 2, true, true},
25+
```
26+
27+
```
28+
cd nxengine-evo
29+
mkdir build
30+
cd build
31+
cmake -DCMAKE_BUILD_TYPE=Release ..
32+
make
33+
cd ~/nxengine-evo
34+
wget https://www.cavestory.org/downloads/cavestoryen.zip
35+
unzip cavestoryen.zip
36+
cp -r CaveStory/data/* data/
37+
cp CaveStory/Doukutsu.exe .
38+
./build/nxextract
39+
cd build
40+
sudo make install
41+
```
42+
43+
### Confirm that the original version can run normally:
44+
`./nxengine-evo`
45+
46+
47+
48+
49+
### Run the modified version:
50+
`./nxengine-evo`
51+
52+
### After running, press the Esc key, enter Options->Graphics, select the resolution as 1280x480, and open the full screen.
53+
54+
55+
### Reinstall after confirming that there is no problem:
56+
```
57+
cd ~/nxengine-evo/build
58+
sudo make install
59+
```
60+
61+
You can use the command **nxengine-evo **to run the game in any directory

0 commit comments

Comments
 (0)