Strange output with piSerial [Custom Linux]

Topics about the Software of Revolution Pi
Post Reply
bztry
Posts: 3
Joined: 14 Mar 2024, 12:09

Strange output with piSerial [Custom Linux]

Post by bztry »

Hello together,

I'm currently building my own Linux System based on Yocto and trying to incorporate some kunbus-specifics for the RevPi.

My test-device is a RevPi Connect SE and, while I'm a newcomer with Yocto, I actually managed to build a working image with most of the tools working fine!

One step at a time, now I am trying to get piSerial to work correctly.

I used all your correct device overlays, i2c is enabled and I also can generate a serial output, however the messages are a bit buggy with CRC failing and I do not know why.

Code: Select all

root@raspberrypi4-64:~# piSerial
DEBUG: Can't write (atecc508a_simple_wa()) to the I2C device: Input/output error
DEBUG: write: WA:0x03, LEN:0x07, CMD:0x02, ZONE:0x00, ADDR:0x0000, CRC:0x1e2d = 8
DEBUG: recv.crc: 0xf791, crc: 0xf791
DEBUG: write: WA:0x03, LEN:0x07, CMD:0x02, ZONE:0x00, ADDR:0x0200, CRC:0x18ad = 8
DEBUG: recv.crc: 0xdc68, crc: 0xdc68
0123[redacted]2D f[redacted]z

As you can see, the serial number and the web password are both printed out fine! (I redacted some of it) But I'm not an I2C expert and do not understand why the errors are happening.

Here's the kernel I'm using:

Code: Select all

Linux raspberrypi4-64 6.1.46-rt13-v8 #1 SMP PREEMPT_RT Wed Jan 31 11:22:39 UTC 2024 aarch64 GNU/Linux
lsmod output:

Code: Select all

root@raspberrypi4-64:~# lsmod |grep i2c
i2c_brcmstb            16384  0
i2c_dev                20480  0
i2cdetect output:

Code: Select all

root@raspberrypi4-64:~# i2cdetect -l
i2c-1   i2c             bcm2835 (i2c@7e804000)                  I2C adapter
i2c-11  i2c             fef04500.i2c                            I2C adapter
dmesg output for i2c:

Code: Select all

root@raspberrypi4-64:~# dmesg |grep i2c
[    1.707334] rtc-pcf2127-i2c 1-0051: registered as rtc0
[    1.708439] rtc-pcf2127-i2c 1-0051: setting system clock to 2024-05-06T10:57:36 UTC (1714993056)
[    2.982636] i2c_dev: i2c /dev entries driver
[    5.375703] brcmstb-i2c fef04500.i2c:  @97500hz registered in polling mode
these are the revpi-specific overlays im using:

Code: Select all

004320.690: brfs: File read: 3913 bytes
004325.566: brfs: File read: /mfs/sd/overlays/revpi-connect-se.dtbo
004398.016: Loaded overlay 'revpi-connect-se'
004783.335: brfs: File read: 5816 bytes
004802.426: brfs: File read: /mfs/sd/overlays/revpi-dt-blob.dtbo
004999.673: Loaded overlay 'revpi-dt-blob'
005070.578: brfs: File read: 68542 bytes
005084.211: brfs: File read: /mfs/sd/overlays/revpi-connect-se-dt-blob.dtbo
005213.492: Loaded overlay 'revpi-connect-se-dt-blob'
005260.180: brfs: File read: 44810 bytes
005264.174: brfs: File read: /mfs/sd/overlays/dwc2.dtbo
005279.755: Loaded overlay 'dwc2'
Have you encountered something like this? Would love to get this running without errors :)

Kind regards
User avatar
nicolaiB
KUNBUS
Posts: 893
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Strange output with piSerial [Custom Linux]

Post by nicolaiB »

004320.690: brfs: File read: 3913 bytes
004325.566: brfs: File read: /mfs/sd/overlays/revpi-connect-se.dtbo
004398.016: Loaded overlay 'revpi-connect-se'
004783.335: brfs: File read: 5816 bytes
004802.426: brfs: File read: /mfs/sd/overlays/revpi-dt-blob.dtbo
[...]
005084.211: brfs: File read: /mfs/sd/overlays/revpi-connect-se-dt-blob.dtbo
[...]
Looks a bit odd. The dt-blob bin files are meant as template for /boot/dt-blob.bin and not as an overlay. Can you please share the /boot/config.txt?

The relevant files should look like this:

Code: Select all

002876.704: brfs: File read: /mfs/sd/bcm2711-rpi-cm4s.dtb
002898.747: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
002985.213: brfs: File read: /mfs/sd/overlays/vc4-kms-v3d-pi4.dtbo
003429.944: brfs: File read: /mfs/sd/overlays/revpi-connect-se.dtbo
overlay_map + vc4_kms are optional

Also make sure that /boot/overlays/revpi-connect-se-dt-blob.dtbo is copied to /boot/dt-blob.bin (done in factory reset with our image).

Nicolai
bztry
Posts: 3
Joined: 14 Mar 2024, 12:09

Re: Strange output with piSerial [Custom Linux]

Post by bztry »

Hi Nicolai,

thanks for the speedy response :)

understood, I copied the dt-blob I previously used as an "overlay" to dt-blob.bin.

My vcdbg now looks like this (full log):

Code: Select all

root@raspberrypi4-64:/home/root# ./vcdbg log msg
003290.296: arasan: arasan_emmc_open
003290.466: arasan: arasan_emmc_set_clock C0: 0x00800000 C1: 0x000e0047 emmc: 200000000 actual: 390625 div: 0x00000100 target: 400000 min: 400000 max: 400000 delay: 5
003395.234: arasan: arasan_emmc_set_clock C0: 0x00800000 C1: 0x000e0047 emmc: 200000000 actual: 390625 div: 0x00000100 target: 400000 min: 400000 max: 400000 delay: 5
003395.320: arasan: arasan_emmc_set_clock C0: 0x00800f00 C1: 0x000e0047 emmc: 200000000 actual: 390625 div: 0x00000100 target: 400000 min: 390000 max: 400000 delay: 5
003430.724: arasan: arasan_emmc_set_clock C0: 0x00800f02 C1: 0x000e0407 emmc: 200000000 actual: 25000000 div: 0x00000004 target: 25000000 min: 0 max: 25000000 delay: 1
003445.397: brfs: File read: /mfs/sd/config.txt
003445.783: brfs: File read: 253 bytes
003450.860: brfs: File read: /mfs/sd/dt-blob.bin
003511.890: brfs: File read: 44810 bytes
003513.685: brfs: File read: /mfs/sd/config.txt
003514.023: gpioman: gpioman_get_pin_num: pin DISPLAY_SDA not defined
003514.043: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
003807.563: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
003807.608: *** Restart logging
003807.625: brfs: File read: 253 bytes
003868.343: HDMI0: hdmi_pixel_encoding: 300000000
003881.635: dtb_file 'bcm2711-rpi-cm4s.dtb'
003891.179: brfs: File read: /mfs/sd/bcm2711-rpi-cm4s.dtb
003891.196: Loaded 'bcm2711-rpi-cm4s.dtb' to 0x100 size 0xca7f
003904.161: brfs: File read: 51839 bytes
003906.770: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
003926.699: brfs: File read: 2347 bytes
003927.140: brfs: File read: /mfs/sd/config.txt
003927.165: dtparam: i2c1=on
003935.665: dtparam: i2c_arm=on
003944.647: brfs: File read: 253 bytes
003946.074: brfs: File read: /mfs/sd/overlays/vc4-kms-v3d-pi4.dtbo
004007.532: Loaded overlay 'vc4-kms-v3d'
004317.335: brfs: File read: 3913 bytes
004322.212: brfs: File read: /mfs/sd/overlays/revpi-connect-se.dtbo
004394.695: Loaded overlay 'revpi-connect-se'
004780.579: brfs: File read: 5816 bytes
004784.530: brfs: File read: /mfs/sd/overlays/dwc2.dtbo
004799.913: Loaded overlay 'dwc2'
004799.936: dtparam: dr_mode=host
004847.220: brfs: File read: 801 bytes
004848.431: brfs: File read: /mfs/sd/cmdline.txt
004848.493: Read command line from file 'cmdline.txt':
004848.516: 'dwc_otg.lpm_enable=0 debug console=tty1 rootfstype=ext4 rootwait root=${myRoot}'
005163.803: brfs: File read: 93 bytes
005291.459: brfs: File read: /mfs/sd/kernel8.img
005291.497: Loaded 'kernel8.img' to 0x200000 size 0x98738
005292.407: Kernel relocated to 0x80000
005292.429: Device tree loaded to 0x2eff2800 (size 0xd7c5)
005299.664: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
005407.385: sdram: sdram refresh 1562->6248 (1)

013811.529: vchiq_core: vchiq_init_state: slot_zero = 0xcf000000, is_master = 1
013821.087: TV service:host side not connected, dropping notification 0x00000002, 0x00000001, 0x00000010
014680.626: sdram: sdram refresh 1562->3124 (2)

017109.207: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
017109.223: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
017109.256: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
017109.274: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
The config.txt looks like this:

Code: Select all

# Enable I2C
dtparam=i2c1=on
dtparam=i2c_arm=on

# Enable UART
enable_uart=1

# Enable VC4 Graphics
dtoverlay=vc4-kms-v3d

# RevPi Overlays
dtoverlay=revpi-connect-se
#--- here, I previously had "dtoverlay=revpi-connect-se-dt-blob", which was wrong as indicated by you ---#

# HDMI
hdmi_drive=2
hdmi_force_hotplug=1

[pi4]
[cm4s]
dtoverlay=dwc2,dr_mode=host
unfortunately, the output from piSerial stays like this:

Code: Select all

root@raspberrypi4-64:/home/root# piSerial
DEBUG: Can't write (atecc508a_simple_wa()) to the I2C device: Input/output error
DEBUG: write: WA:0x03, LEN:0x07, CMD:0x02, ZONE:0x00, ADDR:0x0000, CRC:0x1e2d = 8
DEBUG: recv.crc: 0xf791, crc: 0xf791
DEBUG: write: WA:0x03, LEN:0x07, CMD:0x02, ZONE:0x00, ADDR:0x0200, CRC:0x18ad = 8
DEBUG: recv.crc: 0xdc68, crc: 0xdc68
[REDACTED- here are serial + pw separated by space]
again, I find it interesting that the tool is finding the serial and password correctly, just with these errors above.

Oh and I should maybe mention that I built the tool with the following commit version:

Code: Select all

7214629fef18b51810f179b15fad902f74d0d41f
I didn't find a 6.1 tag or something similar so I just took the latest commit.

Thanks again and kind regards :)
User avatar
nicolaiB
KUNBUS
Posts: 893
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Strange output with piSerial [Custom Linux]

Post by nicolaiB »

# Enable I2C
dtparam=i2c1=on
dtparam=i2c_arm=on
[...]
# Enable UART
enable_uart=1
These are also not needed or might interfere with our custom overlay.

The messages you see are debug messages and are not shown in productive builds. Our debian package is built with `-Wall -pedantic -DNDEBUG -fPIE`, whereas the NDEBUG parameter ensures that debug log level is not set (see https://gitlab.com/revolutionpi/piseria ... =heads#L10). So if you build your binaries in the same manner, everything should be okay.

Nicolai
Post Reply