Skip to content

Commit

Permalink
restore wiki folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cuu committed Dec 15, 2024
1 parent 0b911bc commit 5157472
Show file tree
Hide file tree
Showing 22 changed files with 2,198 additions and 0 deletions.
16 changes: 16 additions & 0 deletions wiki/7110-dev-board-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Upgrade bootloader and firmware

for os image 69 and later

https://forum.rvspace.org/t/visionfive-2-debian-image-december-released/1097/43?page=2

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

## Flash files
```
flashcp -v u-boot-spl.bin.normal.out /dev/mtd0
flashcp -v visionfive2_fw_payload.img /dev/mtd1
```

## 7110 full os large mirror address
https://debian.starfivetech.com/
59 changes: 59 additions & 0 deletions wiki/Compile-Devterm-CM4-kernel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# System
ubuntu 22.04 gcc8.4.0
```
sudo apt install gcc-8 gcc-8-aarch64-linux-gnu gcc-8-arm-linux-gnueabihf
```

# Download patch
```
git clone https://github.com/clockworkpi/DevTerm.git
```

# Download kernel and patch it
```
git clone https://github.com/raspberrypi/linux
cd linux
git checkout 3a33f11c48572b9dd0fecac164b3990fc9234da8
cp ~/DevTerm/Code/patch/cm4/cm4_kernel_0704.patch .
git apply cm4_kernel_0704.patch
#Strongly recommend to use gcc 8.4.0 as the cross compiler
KERNEL=kernel7l make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig
KERNEL=kernel7l make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j1
INSTALL_MOD_PATH=./modules make modules_install
rm modules/lib/modules/*/build
rm modules/lib/modules/*/source
mkdir output
mkdir output/boot
mkdir output/lib/modules -p
mkdir output/boot/overlays
cp -rf modules/lib/modules/5.10.17-v7l+ output/lib/modules/
cp arch/arm/boot/dts/overlays/*.dtbo output/boot/overlays/
cp arch/arm/boot/dts/bcm2711-rpi-cm4.dtb output/boot/
cp arch/arm/boot/zImage output/boot/kernel7l.img
```

output is the folder contains all kernel stuff

# config.txt
```
disable_overscan=1
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
dtoverlay=dwc2,dr_mode=host
dtoverlay=vc4-kms-v3d-pi4,cma-384
dtoverlay=devterm-pmu
dtoverlay=devterm-panel
dtoverlay=devterm-misc
dtoverlay=audremap,pins_12_13
dtparam=spi=on
gpio=10=ip,np
```
15 changes: 15 additions & 0 deletions wiki/Compile-and-run-devterm-printer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# a06 a04
```
git clone https://github.com/clockworkpi/DevTerm.git
sudo systemctl stop devterm-socat devterm-printer
sudo apt remove devterm-wiringpi-cpi
cd DevTerm/Code/devterm_wiringpi_cpi/
sudo ./build
cd ~/DevTerm/Code/thermal_printer/
sudo apt install -y libfreetype-dev
make
53 changes: 53 additions & 0 deletions wiki/Compile-andriod-kernel-for-cm4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Download kernel source for andriod of rpi4

**sync-andriod-kernel.sh**
```
#!/bin/bash
BIN_DIR=$HOME/bin
REPO_PATH=$BIN_DIR/repo
if [ ! -d $BIN_DIR ]
then
mkdir $BIN_DIR
add_path_env $BIN_DIR
curl https://storage.googleapis.com/git-repo-downloads/repo > $REPO_PATH
chmod a+x $REPO_PATH
else
echo "folder already exits. $BIN_DIR"
fi
export PATH=$PATH:$BIN_DIR
cd /data/andriod-kernel
repo init -u https://github.com/android-rpi/kernel_manifest -b arpi-5.10
repo sync
```

# Compile
```
cd /data/andriod-kernel/
./build/build.sh
```

# Replace files

```
sudo losetup --show -f -P lineage-19.1-20220511-UNOFFICIAL-KonstaKANG-rpi4.img # assume /dev/loop0
sudo mount /dev/loop0p1 /mnt/p1
# Copy kernel binaries to boot partition
cp -rf /data/andriod-kernel/out/arpi-5.10/dist/Image to /mnt/p1
cp -rf /data/andriod-kernel/out/arpi-5.10/dist/bcm2711-rpi-*.dtb /mnt/p1
cp -rf /data/andriod-kernel/out/arpi-5.10/dist/vc4-kms-v3d-pi4.dtbo to /mnt/p1/overlays/
sudo umount /mnt/p1
sudo losetup -D /dev/loop0
```

# Reference Url
* https://github.com/android-rpi/kernel_manifest
* https://github.com/android-rpi/device_arpi_rpi4
64 changes: 64 additions & 0 deletions wiki/Compile-keyboard-bootloader-and-firmware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Build bin

```
git clone https://github.com/rogerclarkmelbourne/STM32duino-bootloader
cd STM32duino-bootloader
make generic-pc13
```
this will produce `bootloader_only_binaries/generic_boot20_pc13.bin`
## Convert bootloader to hex format
using `srec_cat` to convert
windows: http://srecord.sourceforge.net/
linux: sudo apt install srecord

```
srec_cat bootloader_only_binaries/generic_boot20_pc13.bin -Binary -offset 0x08000000 -output bootloader_only_binaries/generic_boot20_pc13.hex -Intel
```

## Next is to use stm32Cube to flash the bootloader
* Download the stm32cube programmer
[stm32cube programmer](https://www.st.com/en/development-tools/stm32cubeprog.html)

* Put 1 ON in the back of keyboard
* 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)
* Click connect on STM32cube programmer
* flash it

![2022-09-26_13-04](https://user-images.githubusercontent.com/523580/192197890-dcb6d6fc-0ef5-4870-b9d3-ae03fc5f5110.png)
![2022-09-26_13-04_1](https://user-images.githubusercontent.com/523580/192197900-c7f8b448-3812-403f-b7b0-728248533790.png)
![2022-09-26_13-09](https://user-images.githubusercontent.com/523580/192198205-8edecc5f-c30e-4837-8b3c-7f97c97ba40a.png)



# Flash Arudino
## Arduino IDE
* 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

![image](https://user-images.githubusercontent.com/523580/192198944-fd0fbf55-0977-42bb-9256-f7bcdf331466.png)

* verbose all outputs:
![image](https://user-images.githubusercontent.com/523580/192198967-d4738c42-897e-412a-b630-afab45d274c3.png)

* Select upload method ,board type is **Generic STM32F103R series **
![image](https://user-images.githubusercontent.com/523580/192198991-9757e354-c8ec-4859-95e9-dba732773fb1.png)

* Set cpu mhz to 48Mhz
![image](https://user-images.githubusercontent.com/523580/192199043-7f877adb-830e-4323-8799-06e115843b46.png)


* Put 1 OFF in the back of keyboard
* User arduino IDE to open [devterm_keyboard.ino](https://github.com/clockworkpi/DevTerm/blob/main/Code/devterm_keyboard/devterm_keyboard.ino)
* flash it
![image](https://user-images.githubusercontent.com/523580/192199494-8778bfcc-fcff-4bd0-9f51-f034a080f981.png)


# CN version
https://shimo.im/docs/Tc8RVQWdjvXtwhYv/ 《GD32f103rgt6/CKSF103R* 与stm32duino bootloader》

custom keyboard:

https://forum.clockworkpi.com/t/keyboard-stuck-in-bootloader-mode/8830/11

57 changes: 57 additions & 0 deletions wiki/Compile-lineage-os-19.1-kernel-for-rpi4(cm4).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Prepare
```
mkdir -p ~/data/andriod
mkdir -p ~/data/github/lineage-rpi
cd ~/data/github/lineage-rpi
git clone https://github.com/lineage-rpi/android_kernel_brcm_rpi -b lineage-19.1
git clone https://github.com/lineage-rpi/proprietary_vendor_brcm -b lineage-19.1
cd ~/data/andriod
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b pie-release
```
# Fix firmware path

edit `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/configs/lineageos_rpi4_defconfig` line 1537
to be
`CONFIG_EXTRA_FIRMWARE_DIR="/home/cpi/data/github/lineage-rpi/proprietary_vendor_brcm/rpi4/proprietary/vendor/firmware"`

# Compile

```
cd ~/data/github/lineage-rpi/android_kernel_brcm_rpi
```

create **m.sh** with content like:

```
#!/bin/bash
export PATH=/home/cpi/data/andriod/aarch64-linux-android-4.9/bin:$PATH
ARCH=arm64 CROSS_COMPILE=aarch64-linux-androidkernel- make lineageos_rpi4_defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-androidkernel- make Image dtbs -j1
```

```
chmod +x m.sh
./m.sh # start kernel compile
```

# Replace files
copy
* bcm2711-rpi-400.dtb
* bcm2711-rpi-4-b.dtb
* bcm2711-rpi-cm4.dtb
* bcm2711-rpi-cm4s.dtb


from `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/boot/dts/broadcom/` to lineage os image boot partition

copy `~/data/github/lineage-rpi/android_kernel_brcm_rpi/arch/arm64/boot/Image` to to lineage os image boot partition

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

# Kernel config
https://gist.github.com/cuu/92bfa28a9b6de421834e5f9f408a12a4
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Compile the widescreen version of Cave Story from the source code

### Install the necessary packages:

```
sudo apt update
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
```


### Compile the engine (it takes about 1 hour):
```
cd ~
git clone https://github.com/nxengine/nxengine-evo
```
### Modified to the widescreen version:

`vim ~/nxengine-evo/src/graphics/Renderer.cpp`


### Edit the 225 line and save and exit the following line
```
{(char *)"1280x480", 1280, 480, 640, 240, 2, true, true},
```

```
cd nxengine-evo
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
cd ~/nxengine-evo
wget https://www.cavestory.org/downloads/cavestoryen.zip
unzip cavestoryen.zip
cp -r CaveStory/data/* data/
cp CaveStory/Doukutsu.exe .
./build/nxextract
cd build
sudo make install
```

### Confirm that the original version can run normally:
`./nxengine-evo`




### Run the modified version:
`./nxengine-evo`

### After running, press the Esc key, enter Options->Graphics, select the resolution as 1280x480, and open the full screen.


### Reinstall after confirming that there is no problem:
```
cd ~/nxengine-evo/build
sudo make install
```

You can use the command **nxengine-evo **to run the game in any directory
Loading

0 comments on commit 5157472

Please sign in to comment.