Recon Sentinel is Rock in a box.

Got my Rock64 in the mail today. eMMC and flasher left China too from Pine store.
This Recon Sentinel is a nice implementation. Box, manual, AC Cord. Retail package.
$40 new off ebay.

Flash uboot to SPI and FreeBSD to eMMC.

Figure out that LED!!!
 
I started with the FreeBSD 14-CURRENT image.
This is a new build for me and it is nice to have it fire right up.
I fought the UART console on this board for a while.
Uses weird speed of 1500000 baud.
Several Prolific PL2303HX USB to TTL adapters I have must be fake.
They won't do 1500000.
Known real one works fine.
Dang even Prolific adapters are faked. I thought it was only FDTI.
 
Last edited:
U-Boot has a tool for everything it seems.

Code:
=> sf
sf - SPI flash sub-system

Usage:
sf probe [[bus:]cs] [hz] [mode]    - init flash device on given SPI bus
                  and chip select
sf read addr offset|partition len    - read `len' bytes starting at
                          `offset' or from start of mtd
                      `partition'to memory at `addr'
sf write addr offset|partition len    - write `len' bytes from memory
                          at `addr' to flash at `offset'
                      or to start of mtd `partition'
sf erase offset|partition [+]len    - erase `len' bytes from `offset'
                      or from start of mtd `partition'
                     `+len' round up `len' to block size
sf update addr offset|partition len    - erase and write `len' bytes from memory
                      at `addr' to flash at `offset'
                      or to start of mtd `partition'
sf protect lock/unlock sector len    - protect/unprotect 'len' bytes starting
                      at address 'sector'
Now my SPI chip:
Code:
=> sf probe

SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
 
I have a couple of those Recon Sentinel Rock64-s since early 2021.
Wish I bought more of them when they were like $10 on Amazon.

They are pretty standard Rock64-s.
I run one with FreeBSD on eMMC and the other with SD card.
I wanted to try putting u-boot on SPI flash but couldn't find any information about its required layout.

BTW, the spi flash is accessible from FreeBSD too.
 
10 bucks would have been a steal. Cheapest on ebay is $100.
One feature I like is the extra room in the case. I suspect I could fit a few small GPIO gadgets in there.

I do want to put u-boot on the SPI.
Code:
root@ROCK64:~ # ls /dev/flash
spi0
root@ROCK64:~ # ls /dev/flash/spi0
/dev/flash/spi0
root@ROCK64:~ # file -s /dev/flash/spi0
/dev/flash/spi0: ISO-8859 text, with very long lines (65536), with no line terminators

What I was really mentally juggling is "should I put EFI on SPI" as well. It is 128Mib so there is plenty of room.
 
I strayed to the LED since I have never dealt with one before. 2x16 display.

pkg install i2c-tools

root@ROCK64:~ # i2c -s
18


So i2c may already be configured for us.
Connect LCD and rescan.

root@ROCK64:/ # i2c -s
18 3f

New device found at 3f. That is good.
 
I went and imaged the spi0 device just in case.

root@ROCK64:/ # dd if=/dev/flash/spi0 of=/spi.orig bs=1024 conv=sync status=progress
16224256 bytes (16 MB, 15 MiB) transferred 10.003s, 1622 kB/s
16384+0 records in
16384+0 records out


Wanted to see what was on the disk. It appears empty.

root@ROCK64:/ # hexdump spi.orig|more
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
1000000

 
I was hoping to send some command to see text on the LCD. I made a text file with plain text to send.
Similar to the manual i2c write example.
Code:
root@ROCK64:~ # i2c -a 0x3f -dw -c 16 -o 0x10-b < data.bin
root@ROCK64:~ # i2c -a 0x3f -d w -c 16 < data.bin
root@ROCK64:~ # i2c -a 0x3f -d w -c 16 -o 0x10 < data.bin
root@ROCK64:~ # i2c -a 0x3f -d w -c 16 -o 0x10 -b < data.bin

Please help me write text to i2c 2x16 sainsmart type LCD.

The only movment I have is changing the -c parameter. -c < 8 backlight off -c >= 8 on
 
Thank You. I am somewhat illiterate and I am first going to try and force compile sysutils/lcdproc on aarch64.
It seems to me that it should absolutely run on arm64.
So I want to pester port maintainer once I figure out why its not building on aarch64.

For 3 years it appears? It don't have many dependencies at all.

Linux -libusb stuff is messed up I see but I don't need it here for my i2c serial comms.
 
Please share your progress!
OK No EFI allowed on SPI only u-boot
There is documentation on the procedure.
Line 219 to be exact.

Received 32GB eMMC and installed FreeBSD 13-RELEASE ROCK64.
Ran freebsd-update for the first time in my life it worked on ARM.
Fireworks are in order. Pop the corks. A new era.
 
OK No EFI allowed on SPI only u-boot
There is documentation on the procedure.
Line 219 to be exact.

Received 32GB eMMC and installed FreeBSD 13-RELEASE ROCK64.
Ran freebsd-update for the first time in my life it worked on ARM.
Fireworks are in order. Pop the corks. A new era.
Did you need yo recompile u-boot for it to have SPI support?
Or is the u-boot from packages already good?
Thanks!
 
I was hoping to send some command to see text on the LCD. I made a text file with plain text to send.
Similar to the manual i2c write example.
Code:
root@ROCK64:~ # i2c -a 0x3f -dw -c 16 -o 0x10-b < data.bin
root@ROCK64:~ # i2c -a 0x3f -d w -c 16 < data.bin
root@ROCK64:~ # i2c -a 0x3f -d w -c 16 -o 0x10 < data.bin
root@ROCK64:~ # i2c -a 0x3f -d w -c 16 -o 0x10 -b < data.bin

Please help me write text to i2c 2x16 sainsmart type LCD.

The only movment I have is changing the -c parameter. -c < 8 backlight off -c >= 8 on
I followed the link of your initial post and on the 2nd image we see a HD44780 display with a PCF8547 I2C to DIO converter. This is a pretty common setup. For example here in Brazil this is offered for less than US$ 5 from many suppliers - https://lista.mercadolivre.com.br/16x2-display

Two years ago I bought the bigger brother of that display, here I have a 20x4, based on exactly the same chipset. At that time, I found this Arduino-C++ library on GitHub: https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

I refactored it into a pure C library for my BeagleBone Black and FreeBSD 13, and I added I2C glue code and a Hello World test program to it (see the attached .zip file).

For your 16x2 display, you need to change the top 4 definitions in lcd.h, and in the test program, you need to shorten the text, then compile and execute it using: clang i2c.c lcd.c hello.c -o hello && ./hello
 

Attachments

  • LCD_HD44780_PCF8574.zip
    4.4 KB · Views: 98
is the u-boot from packages already good?
I am still unsure what files to flash to SPI.
The above instruction pre-date the Rockboard SPI commit by 5 years. They were wrote for Firefly board.

One difference I notice from other boards is that TPL is loaded before SPL on Rock64.
TPL being First stage bootloader.
Code:
U-Boot TPL 2020.10 (Apr 09 2021 - 03:54:54)
LPDDR3, 800MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.10 (Apr 09 2021 - 03:54:54 +0000)
Trying to boot from MMC1
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from MMC2
NOTICE:  BL31: v2.4(release):
NOTICE:  BL31: Built : 03:54:01, Apr  9 2021
NOTICE:  BL31:Rockchip release version: v1.2


U-Boot 2020.10 (Apr 09 2021 - 03:56:02 +0000)

Model: Pine64 Rock64
DRAM:  1022 MiB
PMIC:  RK8050 (on=0x40, off=0x01)
MMC:   mmc@ff500000: 1, mmc@ff520000: 0
Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - No block device, using default environment

In:    serial@ff130000
Out:   serial@ff130000
Err:   serial@ff130000
Model: Pine64 Rock64
Net:   eth0: ethernet@ff540000
Hit any key to stop autoboot:  0

So what is this BOOTROM ? Is this the SPI storage device?
Under u-boot port there is a TPL directory. So perhaps something there gets flashed to SPI.
u-boot-tpl.bin for example.

You would almost certainly need to build the rock64 u-boot port for the SPI file.
There are only two files that end up in /usr/local/share/u-boot/u-boot-rock64/
idbloader.img and u-boot.itb I am pretty sure they are for the sd card install.
 
Thanks obsigna.

My hardware is RPi 4B.

uname -a
Code:
FreeBSD generic 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n259495-d1f3abc89250: Thu Dec  1 10:53:21 UTC 2022     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64

I want to display text in 1602A.

I modified lcd.h and hello.c, compiled and ran, terminal prompt:
Code:
I2C I2CRDWR: Resource temporarily unavailable
I2C I2CRDWR: Resource temporarily unavailable
I2C I2CRDWR: Resource temporarily unavailable
I2C I2CRDWR: Resource temporarily unavailable
...

May I ask, how should I modify the program to make it run normally in RPi 4B?
 
Back
Top