樹莓派 HATs ︰ 初探的比較

『對比』有無之差異,通常是探索的切入點。那麼將用什麼 HATs add-on board 來作比較呢?或許因為

rpi-update

An easier way to get the latest firmware for your Raspberry Pi.

更新的太快,而且 HATs 基本上亦不支援多卡堆疊 stackable ,所以市場上大多的擴充版都沒有 ID EEPROM 的哩。幸而想起了

Flash your DAC+ for automatic configuration

dacplusSome people have asked why there is a button on board of some HiFiBerry cards. This button allows to write the EEPROM on the board. But what is it used for? It can be used to store configuration data for the HiFiBerry sound card. With the flash, the operating system can automatically detect what drivers need to be loaded for your HiFiBerry sound card. This means there is no need for editing config.txt anymore.

This makes the flash especially interesting for people that want to experiment with a lot of distributions.

 

,恰巧也有這卡,正好用來一探究竟也。

且依前文章法,試行一番︰

pi@raspberrypi:~ i2cdetect -l pi@raspberrypi:~
pi@raspberrypi:~ gpio readall  +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+  | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |  +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+  |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |  |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |  |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |  |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |  |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |  |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | ALT0 | GPIO. 1 | 1   | 18  |  |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |  |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |  |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |  |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |  |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |  |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |  |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |  |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |  |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |  |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |  |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |  |  19 |  24 | GPIO.24 | ALT0 | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |  |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | ALT0 | GPIO.28 | 28  | 20  |  |     |     |      0v |      |   | 39 || 40 | 0 | ALT0 | GPIO.29 | 29  | 21  |  +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+  | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |  +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ pi@raspberrypi:~ 

 

pi@raspberrypi:~ sudo dtparam i2c_vc=on pi@raspberrypi:~ i2cdetect -l
i2c-0	i2c       	3f205000.i2c                    	I2C adapter
pi@raspberrypi:~ i2cdetect -y 0      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 00:          -- -- -- -- -- -- -- -- -- -- -- -- --  10: -- -- -- -- -- -- -- -- -- -- -- -- 1c -- -- --  20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  40: -- -- -- 43 -- -- -- -- -- -- -- -- -- -- -- --  50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  70: -- -- -- -- -- -- -- --                          pi@raspberrypi:~
pi@raspberrypi:~ dmesg | tail [   11.928726] Bluetooth: SCO socket layer initialized [   11.939439] Bluetooth: HCI UART driver ver 2.3 [   11.939454] Bluetooth: HCI UART protocol H4 registered [   11.939460] Bluetooth: HCI UART protocol Three-wire (H5) registered [   11.939582] Bluetooth: HCI UART protocol BCM registered [   12.095872] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [   12.095903] Bluetooth: BNEP filters: protocol multicast [   12.095929] Bluetooth: BNEP socket layer initialized [   28.575014] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [  147.674878] bcm2708_i2c 3f205000.i2c: BSC0 Controller at 0x3f205000 (irq 83) (baudrate 100000) pi@raspberrypi:~

 

pi@raspberrypi:~ cd hats/eepromutils/  pi@raspberrypi:~/hats/eepromutils sudo ./eepflash.sh -r -f=test.eep -t=24c32
This will attempt to talk to an eeprom at i2c address 0x50. Make sure there is an eeprom at this address.
This script comes with ABSOLUTELY no warranty. Continue only if you know what you are doing.
Do you wish to continue? (yes/no): yes
Reading...
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 0.266692 s, 15.4 kB/s
Done.
pi@raspberrypi:~/hats/eepromutils </pre>    <span style="color: #003300;">果然可以讀取 ID EEPROM 的哩!!</span> <pre class="lang:default decode:true">pi@raspberrypi:~/hats/eepromutils i2cdetect -y 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

pi@raspberrypi:~/hats/eepromutils hexdump test.eep 0000000 2d52 6950 0001 0002 0079 0000 0001 0000 0000010 003d 0000 f83d 7e93 216a b578 46d2 c7d9 0000020 e230 622a 3141 0001 0e17 6948 6946 6542 0000030 7272 2079 4d28 646f 6c75 3920 4c20 434c 0000040 4829 4669 4269 7265 7972 4420 4341 4b2b 0000050 02e8 0100 2000 0000 0000 0000 a400 00a4 0000060 0000 0000 0000 0000 0000 e000 8400 8484 0000070 0084 0000 0000 8200 ff69 ffff ffff ffff 0000080 ffff ffff ffff ffff ffff ffff ffff ffff * 0001000 pi@raspberrypi:~/hats/eepromutils 
pi@raspberrypi:~/hats/eepromutils gpio readall  +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+  | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |  +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+  |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |  |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |  |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |  |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |  |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |  |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | ALT0 | GPIO. 1 | 1   | 18  |  |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |  |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |  |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |  |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |  |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |  |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |  |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |  |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |  |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |  |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |  |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |  |  19 |  24 | GPIO.24 | ALT0 | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |  |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | ALT0 | GPIO.28 | 28  | 20  |  |     |     |      0v |      |   | 39 || 40 | 0 | ALT0 | GPIO.29 | 29  | 21  |  +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+  | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |  +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ pi@raspberrypi:~/hats/eepromutils 

 

順道驗證 kernel 4.X dtoverlay 動態起始之本領,

pi@raspberrypi:~/hats/eepromutils sudo dtoverlay hifiberry-dacplus 24db_digital_gain= pi@raspberrypi:~/hats/eepromutils dmesg | tail
[   12.095929] Bluetooth: BNEP socket layer initialized
[   28.575014] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[  147.674878] bcm2708_i2c 3f205000.i2c: BSC0 Controller at 0x3f205000 (irq 83) (baudrate 100000)
[  340.219207] i2c-gpio i2c@0: using pins 0 (SDA) and 1 (SCL)
[  340.344276] at24 3-0050: 4096 byte 24c32 EEPROM, writable, 1 bytes/write
[  340.344326] i2c i2c-3: new_device: Instantiated device 24c32 at 0x50
[  697.500102] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 83) (baudrate 100000)
[  697.570416] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CODEC DAI pcm512x-hifi not registered
[  697.570433] snd-rpi-hifiberry-dacplus soc:sound: snd_soc_register_card() failed: -517
[  697.639447] snd-rpi-hifiberry-dacplus soc:sound: pcm512x-hifi <-> 3f203000.i2s mapping ok
pi@raspberrypi:~/hats/eepromutils $

 

當真是開市大吉的耶!!