upstream-2022-05-05
Boot OK
pi@raspberrypi:~ $ ./upstream.sh
+ cd /home/pi/remote-bl602
+ git pull
Already up to date.
+ /home/pi/remote-bl602/scripts/test.sh
+ '[' '' == '' ']'
+ export BUILD_PREFIX=upstream
+ BUILD_PREFIX=upstream
+ '[' '' == '' ']'
++ date +%Y-%m-%d
+ export BUILD_DATE=2022-05-05
+ BUILD_DATE=2022-05-05
+ '[' '' == '' ']'
+ export USB_DEVICE=/dev/ttyUSB0
+ USB_DEVICE=/dev/ttyUSB0
+ source /home/pi/.cargo/env
++ export PATH=/home/pi/.cargo/bin:/usr/lib/go-1.13.6/bin:/home/pi/.cargo/bin:/usr/lib/go-1.13.6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
++ PATH=/home/pi/.cargo/bin:/usr/lib/go-1.13.6/bin:/home/pi/.cargo/bin:/usr/lib/go-1.13.6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
+ set +x
----- Download the latest upstream NuttX build for 2022-05-05
+ wget -q https://github.com/lupyuen/incubator-nuttx/releases/download/upstream-2022-05-05/nuttx.zip -O /tmp/nuttx.zip
+ pushd /tmp
/tmp ~/remote-bl602
+ unzip -o nuttx.zip
Archive: nuttx.zip
inflating: nuttx
inflating: nuttx.S
inflating: nuttx.bin
inflating: nuttx.config
inflating: nuttx.hex
inflating: nuttx.manifest
inflating: nuttx.map
+ popd
~/remote-bl602
+ set +x
----- Enable GPIO 2 and 3
----- Set GPIO 2 and 3 as output
----- Set GPIO 2 to High (BL602 Flashing Mode)
----- Toggle GPIO 3 High-Low-High (Reset BL602)
----- Toggle GPIO 3 High-Low-High (Reset BL602 again)
----- BL602 is now in Flashing Mode
----- Flash BL602 over USB UART with blflash
+ blflash flash /tmp/nuttx.bin --port /dev/ttyUSB0
[INFO blflash::flasher] Start connection...
[TRACE blflash::flasher] 5ms send count 55
[TRACE blflash::flasher] handshake sent elapsed 394.944µs
[INFO blflash::flasher] Connection Succeed
[INFO blflash] Bootrom version: 1
[TRACE blflash] Boot info: BootInfo { len: 14, bootrom_version: 1, otp_info: [0, 0, 0, 0, 3, 0, 0, 0, 61, 9d, c0, 5, b9, 18, 1d, 0] }
[INFO blflash::flasher] Sending eflash_loader...
[INFO blflash::flasher] Finished 2.553035396s 11.19KiB/s
[TRACE blflash::flasher] 5ms send count 500
[TRACE blflash::flasher] handshake sent elapsed 5.208118ms
[INFO blflash::flasher] Entered eflash_loader
[INFO blflash::flasher] Skip segment addr: 0 size: 47504 sha256 matches
[INFO blflash::flasher] Skip segment addr: e000 size: 272 sha256 matches
[INFO blflash::flasher] Skip segment addr: f000 size: 272 sha256 matches
[INFO blflash::flasher] Erase flash addr: 10000 size: 135824
[INFO blflash::flasher] Program flash... 1895df5ad1ea24dcab7c6ba5f86692424ce419d1da4e4c5b7dc06b4324d2cd59
[INFO blflash::flasher] Program done 1.614955738s 82.18KiB/s
[INFO blflash::flasher] Skip segment addr: 1f8000 size: 5671 sha256 matches
[INFO blflash] Success
+ set +x
----- Set GPIO 2 to Low (BL602 Normal Mode)
----- Toggle GPIO 3 High-Low-High (Reset BL602)
----- BL602 is now in Normal Mode
----- Toggle GPIO 3 High-Low-High (Reset BL602)
----- Here is the BL602 Output...
▒gpio_pin_register: Registering /dev/gpio0
gpio_pin_register: Registering /dev/gpio1
gpint_enable: Disable the interrupt
gpio_pin_register: Registering /dev/gpio2
bl602_spi_setfrequency: frequency=400000, actual=0
bl602_spi_setbits: nbits=8
bl602_spi_setmode: mode=0
NuttShell (NSH) NuttX-10.3.0-RC1
nsh> uname -a
NuttX 10.3.0-RC1 fdef3a7b92 May 5 2022 02:23:24 risc-v bl602evb
nsh> ls /dev
/dev:
console
gpio0
gpio1
gpio2
i2c0
null
spi0
timer0
zero
nsh>
----- Send command to BL602: lorawan_test
lorawan_test
nsh: lorawan_test: command not found
nsh>
===== Boot OK
+ read -p 'Press Enter to shutdown'
Press Enter to shutdown