cjacker / opensource-toolchain-bouffalo-lab

Opensource toolchain for BL602/BL604, BL702/BL704/BL706, BL616/BL618, BL808 and other series of RISC-V based chips from Bouffalo Lab
MIT License
16 stars 2 forks source link

Linux Buildroot #2

Open Fishwaldo opened 1 year ago

Fishwaldo commented 1 year ago

You may want to update the Linux instructions to https://github.com/openbouffalo/buildroot_bouffalo. It has updated kernel with additional drivers and a rootfs on the SD card. Bouffalo have said they will not be maintaining their initial Linux release at the moment.

cjacker commented 1 year ago

Got it, thanks !

I will try it later and update the tutorial.

cjacker commented 1 year ago

How to combine m0/d0 lowload image to one image:

  1. create a file with length = 0x100000 and fill it with "FF" dd if=/dev/zero bs=1048576 count=1| tr "\000" "\377" >whole_bin_m0d0_lowload.bin

  2. write "m0_lowload_bl808_m0.bin" to the start of "whole_bin_m0d0_lowload.bin" dd conv=notrunc if=m0_lowload_bl808_m0.bin of=whole_bin_m0d0_lowload.bin

  3. append "d0_lowload_bl808_d0.bin" to "whole_bin_m0d0_lowload.bin" cat d0_lowload_bl808_d0.bin >> whole_bin_m0d0_lowload.bin

This 'm0d0_lowload.bin' can be programmed as:

bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyUSB1 --baudrate 2000000 --firmware whole_bin_m0d0_lowload.bin --addr 0x0 --single

After lowload programmed, program "bl808-firmware.bin" as:

bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyUSB1 --baudrate 2000000 --firmware bl808-firmware.bin --addr 0x800000 --single
cjacker commented 1 year ago

Go further, combine m0/d0 lowload and bl808-firmware.bin together:

  1. create a empty image of size 0x800000, fill it with "0xFF". 0x800000 is the start addr of "bl808-firmware.bin", "bl808-firmware.bin" will be appended later.

    dd if=/dev/zero bs=8388608 count=1| tr "\000" "\377" >openbouffalo-bl808.bin
  2. copy "m0_lowload_bl808_m0.bin" to the start.

    dd conv=notrunc if=m0_lowload_bl808_m0.bin of=openbouffalo-bl808.bin
  3. copy d0 lowload to 0x100000

    dd conv=notrunc if=d0_lowload_bl808_d0.bin of=openbouffalo-bl808.bin seek=1048576 bs=1
  4. append bl808-firmware.bin to the end

    cat bl808-firmware.bin >> openbouffalo-bl808.bin

The final 'openbouffalo-bl808.bin' can be programed as:

bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyUSB1 --baudrate 2000000 --firmware openbouffalo-bl808.bin --addr 0x0 --single