groover
Posts: 10
Joined: Wed Jun 03, 2015 9:55 pm

RPI Does Not See HAT

Fri May 14, 2021 6:31 pm

My RPi Zero W won't recognize the HAT board I am developing - no hat subdir under /proc/device-tree.

Here is what I have done/tried so far:

I used eepmake to create a .eep file, which I then padded to 4k with 0x00 bytes.

I programmed this into the 23C32 EEPROM using a production setup (there isn't a way for me to control the write protect pin of the EEPROM from the RPi so I do it this way). The programming does a read back and byte-by-byte verify. The HAT is not connected to a RPi at this point.

Using my production setup I read back the contents of the EEPROM into a file and compared it with the programmed version using HxD - it matches.

Connecting the HAT to the RPi I do:

Code: Select all

pi@foo:~ $ sudo dtoverlay i2c-gpio i2c_gpio_sda=0 i2c_gpio_scl=1 bus=9
pi@foo:~ $ i2cdetect -y 9
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@foo:~ $ ls /proc/device-tree
'#address-cells'   axi        clocks       fixedregulator_3v3   interrupt-parent   memreserve   __overrides__     serial-number   __symbols__
 aliases           cam1_reg   compatible   fixedregulator_5v0   leds               model        phy              '#size-cells'    system
 arm-pmu           chosen     cpus         i2c@9                memory@0           name         reserved-memory   soc             thermal-zones
pi@foo:~ $
In /boot/config.txt I have:

Code: Select all

dtparam=i2c_vc=on
It seems the contents of the EEPROM are correct and the RPi can see the EEPROM.

How can I debug this further?

Thanks!

groover
Posts: 10
Joined: Wed Jun 03, 2015 9:55 pm

Re: RPI Does Not See HAT

Fri May 14, 2021 7:40 pm

Code: Select all

pi@foo:~ $ sudo vcdbg log msg
001162.047: brfs: File read: /mfs/sd/config.txt
001162.875: brfs: File read: 1814 bytes
001216.357: HDMI0:EDID error reading EDID block 0 attempt 0
001217.624: HDMI0:EDID error reading EDID block 0 attempt 1
001218.890: HDMI0:EDID error reading EDID block 0 attempt 2
001220.154: HDMI0:EDID error reading EDID block 0 attempt 3
001221.420: HDMI0:EDID error reading EDID block 0 attempt 4
001222.685: HDMI0:EDID error reading EDID block 0 attempt 5
001223.951: HDMI0:EDID error reading EDID block 0 attempt 6
001225.215: HDMI0:EDID error reading EDID block 0 attempt 7
001226.481: HDMI0:EDID error reading EDID block 0 attempt 8
001227.746: HDMI0:EDID error reading EDID block 0 attempt 9
001228.770: HDMI0:EDID giving up on reading EDID block 0
001234.815: brfs: File read: /mfs/sd/config.txt
001235.545: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001255.294: brfs: File read: 1814 bytes
001432.716: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001432.770: *** Restart logging
001434.959: hdmi: HDMI0:EDID error reading EDID block 0 attempt 0
001436.228: hdmi: HDMI0:EDID error reading EDID block 0 attempt 1
001437.496: hdmi: HDMI0:EDID error reading EDID block 0 attempt 2
001438.765: hdmi: HDMI0:EDID error reading EDID block 0 attempt 3
001440.033: hdmi: HDMI0:EDID error reading EDID block 0 attempt 4
001441.303: hdmi: HDMI0:EDID error reading EDID block 0 attempt 5
001442.570: hdmi: HDMI0:EDID error reading EDID block 0 attempt 6
001443.840: hdmi: HDMI0:EDID error reading EDID block 0 attempt 7
001445.108: hdmi: HDMI0:EDID error reading EDID block 0 attempt 8
001446.378: hdmi: HDMI0:EDID error reading EDID block 0 attempt 9
001447.404: hdmi: HDMI0:EDID giving up on reading EDID block 0
001447.738: hdmi: HDMI0:EDID error reading EDID block 0 attempt 0
001449.009: hdmi: HDMI0:EDID error reading EDID block 0 attempt 1
001450.276: hdmi: HDMI0:EDID error reading EDID block 0 attempt 2
001451.546: hdmi: HDMI0:EDID error reading EDID block 0 attempt 3
001452.814: hdmi: HDMI0:EDID error reading EDID block 0 attempt 4
001454.084: hdmi: HDMI0:EDID error reading EDID block 0 attempt 5
001455.352: hdmi: HDMI0:EDID error reading EDID block 0 attempt 6
001456.621: hdmi: HDMI0:EDID error reading EDID block 0 attempt 7
001457.890: hdmi: HDMI0:EDID error reading EDID block 0 attempt 8
001459.159: hdmi: HDMI0:EDID error reading EDID block 0 attempt 9
001460.184: hdmi: HDMI0:EDID giving up on reading EDID block 0
001460.230: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001460.253: HDMI0: hdmi_pixel_encoding: 162000000
001460.501: vec: vec_middleware_power_on: vec_base: 0x7e806000 rev-id 0x00002708 @ vec: 0x7e806100 @ 0x00000420 enc: 0x7e806060 @ 0x00000220 cgmsae: 0x7e80605c @ 0x00000000
001477.543: dtb_file 'bcm2708-rpi-zero-w.dtb'
001477.560: Trying Device Tree file 'bcm2708-rpi-zero-w.dtb'
001481.577: brfs: File read: /mfs/sd/bcm2708-rpi-zero-w.dtb
001481.600: Loading 'bcm2708-rpi-zero-w.dtb' to 0x100 size 0x67b1
001491.384: dtdebug: delete_node(/__local_fixups__)
001494.356: brfs: File read: 26545 bytes
001503.919: dtdebug: using platform 'bcm2835'
001505.440: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
001506.822: dtdebug: overlay map loaded
001508.430: dtdebug: /aliases:i2c_vc=i2c0
001513.596: dtdebug: /__symbols__:i2c_vc=i2c0
001517.197: dtdebug: /__overrides__:i2c_vc=i2c0
001524.519: dtdebug: /__overrides__:i2c_vc_baudrate=i2c0_baudrate
001526.123: dtdebug: /aliases:i2c=i2c1
001531.435: dtdebug: /__symbols__:i2c=i2c1
001535.071: dtdebug: /__overrides__:i2c=i2c1
001536.683: dtdebug: /aliases:i2c_arm=i2c1
001542.019: dtdebug: /__symbols__:i2c_arm=i2c1
001545.697: dtdebug: /__overrides__:i2c_arm=i2c1
001553.120: dtdebug: /__overrides__:i2c_baudrate=i2c1_baudrate
001560.594: dtdebug: /__overrides__:i2c_arm_baudrate=i2c1_baudrate
001569.228: dtparam: uart0_clkrate=48000000
001572.044: dtdebug: /__overrides__ has no uart0_clkrate property
001572.060: Unknown dtparam 'uart0_clkrate' - ignored
001572.083: brfs: File read: 1523 bytes
001575.127: brfs: File read: /mfs/sd/config.txt
001575.448: dtparam: i2c_vc=on
001578.071: dtdebug: found override i2c_vc
001578.109: dtdebug:   override i2c_vc: string target 'status'
001582.782: dtdebug:   override i2c_vc: string target 'status'
001587.541: dtparam: i2c_arm=on
001590.160: dtdebug: found override i2c_arm
001590.195: dtdebug:   override i2c_arm: string target 'status'
001595.814: dtparam: audio=on
001598.546: dtdebug: found override audio
001598.583: dtdebug:   override audio: string target 'status'
001611.648: brfs: File read: 1814 bytes
001611.889: brfs: File read: /mfs/sd/cmdline.txt
001611.904: Failed to read command line file 'cmdline.txt'
001618.919: dtparam: uart1=off
001621.558: dtdebug: found override uart1
001621.593: dtdebug:   override uart1: string target 'status'
003404.796: dtparam: cam0-pwdn=44
003407.435: dtdebug: found override cam0-pwdn
003407.467: dtparam: cam0-led=40
003410.131: dtdebug: found override cam0-led
003410.155: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
003410.204: dtparam: arm_freq=1000000000
003412.876: dtdebug: found override arm_freq
003412.920: dtparam: core_freq=400000000
003415.725: dtdebug: /__overrides__ has no core_freq property
003415.740: Unknown dtparam 'core_freq' - ignored
003427.648: dtdebug: delete_node(/hat)
003849.125: brfs: File read: /mfs/sd/kernel.img
003849.151: Loading 'kernel.img' to 0x8000 size 0x5b46f0
003849.181: Device tree loaded to 0x1bfe9400 (size 0x6b97)
003851.125: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
008321.083: vchiq_core: vchiq_init_state: slot_zero = 0x97d80000, is_master = 1


groover
Posts: 10
Joined: Wed Jun 03, 2015 9:55 pm

Re: RPI Does Not See HAT

Fri May 14, 2021 8:46 pm

Solved. It seems it doesn't like the custom data section to be empty. Would have been nice if eepmake flagged an error or dtdebug output something helpful.

Return to “Advanced users”