Hello everyone. I ran into some issues with the Beaglebone Black System Reference Manual (SRM).
I was trying to develop a Linux kernel module to drive a peripheral device. It was connected to the board through a couple of GPIO pins, and I thought it was unnecessary to modify the pin muxing and device tree. So I referred to the SRM to find some pins that are set to GPIOs by default.
So if I understood the SRM correctly, it means the pin name in the table is the default mode. So I chose to use pin P8_20 to P8_25.
But moments after I load my module, the system was corrupted, this is part of the output I was able to save:
[ 485.786464] sdhci-omap 481d8000.mmc: error -110 requesting status
[ 485.794344] mmc1: cache flush error -110
[ 496.106767] mmc1: Timeout waiting for hardware interrupt.
[ 496.112225] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 496.118696] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101
[ 496.125165] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001
[ 496.131633] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 496.138101] mmc1: sdhci: Present: 0x01f70a06 | Host ctl: 0x00000000
[ 496.144569] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
[ 496.151037] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087
[ 496.157503] mmc1: sdhci: Timeout: 0x0000000c | Int stat: 0x00000000
[ 496.163971] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b
[ 496.170439] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 496.176906] mmc1: sdhci: Caps: 0x05e10080 | Caps_1: 0x00000000
[ 496.183375] mmc1: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000
[ 496.189842] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x34011e14
[ 496.196311] mmc1: sdhci: Resp[2]: 0x4b323730 | Resp[3]: 0x7001004d
[ 496.202778] mmc1: sdhci: Host ctl2: 0x00000000
[ 496.207240] mmc1: sdhci: ============================================
[ 506.602766] mmc1: Timeout waiting for hardware interrupt.
[ 506.608225] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 506.614695] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101
[ 506.621163] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001
[ 506.627631] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 506.634099] mmc1: sdhci: Present: 0x01f70a06 | Host ctl: 0x00000002
[ 506.640567] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
[ 506.647035] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087
[ 506.653502] mmc1: sdhci: Timeout: 0x0000000c | Int stat: 0x00000000
[ 506.659970] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b
[ 506.666438] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 506.672906] mmc1: sdhci: Caps: 0x05e10080 | Caps_1: 0x00000000
[ 506.679374] mmc1: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000
[ 506.685840] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
[ 506.692308] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
[ 506.698774] mmc1: sdhci: Host ctl2: 0x00000000
[ 506.703236] mmc1: sdhci: ============================================
[ 506.958700] mmcblk1: recovery failed!
[ 506.962538] blk_update_request: I/O error, dev mmcblk1, sector 2416272 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
[ 507.199160] blk_update_request: I/O error, dev mmcblk1, sector 2416272 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
The system was not responsive to commands, and after I pushed the reset button, it was unable to boot.
Luckily, I was able to save my board by reflashing its eMMC with a bootable SD card.
I did some search online and came across this diagram which is claimed to be the default setting of BBB pin mode:
The settings shown in this diagram is different from the SRM, but I could not find a crediable source of it.
I tried to modify the pin settings in my module according to this diagram, and it worked out fine. Also, it claims that the pins I used (P8_20 to P8_25) are actually designated to control the mmc1, which kind of explained the error message.
So at this point, I think it can either be:
- the default pin mode in SRM is inaccurate;
- my board is running on the latest image (AM335x 11.7 2023-09-02 4GB eMMC IoT Flasher - BeagleBoard), and its default pin mode is different from the SRM.
If it is the first case, I hope the SRM can be modified so this won’t happen to others.