(OSD3358) SD card detect

Hi,
U-Boot: 2019.04
Kernel: 4.19.106-bone49
The micro SD card holder I am using has a normal open switch used for card detect. One side of the switch is connected to common. The other side is connected to pad A16 (SPIO_CS1). A16 is configured mode(7) making it GPIO0_5. The BBB uses C15 configured as GPIO0_6.

I have made these changes to my device tree used by the kernel.

mmc1_pins: pinmux_mmc1_pins {
	pinctrl-single,pins = <
		AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE7)	/* (A16) spio_cs0.gpio0_5 */
	>;
};

&mmc1 {
	vmmc-supply = <&vmmcsd_fixed>;
	bus-width = <0x4>;
	pinctrl-names = "default";
	pinctrl-0 = <&mmc1_pins>;
	cd-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
	status = "okay";
};

Now for the questions,
I don’t have an external pullup resistor on the line from the switch to pad A16. I beleive that AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE7) will enable an internal pullup.
Do I understand correctly that PIN_INPUT_PULLUP does enable a soft pullup?

I understand that ‘AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE7)’ defines what A16 is (in this case a GPIO0_5 with pullup enabled) but does not tell the kernel that it is to be used as the SD card detect input signal.
The ‘cd-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;’ tells the kernel to use gpio0_5 as the card detect input. ‘GPIO_ACTIVE_LOW’ tells the kernel that the card is inserted when the input is LOW.
Do I understand correctly?

I have downloaded and built libgpiod tools. I can use gpioget gpiochip0 5 to check the state of gpio0_5 input.
gpioget reports ‘1’ when the card is not inserted (detect switch is open).
gpioget reports ‘0’ when the card is inserted (detect switch is closed).

Does ‘0’ equal ‘ACTIVE_LOW’?

I don’t know if my changes are working correctly.
What does the kernel do with the card detect input?
How do I test that the kernel is working correctly with the card detect input?

Thank you,

Correct, PIN_INPUT_PULLUP enables the internal weak pullup…

I’m never 100% sure on this, so i need to look it up… Depending on kernel that wasn’t always the case… But yeah, i belive a ‘0’ on the line should tell the drive it was inserted/present…

https://elixir.bootlin.com/linux/v5.11/source/include/dt-bindings/gpio/gpio.h#L15

Try one, fire up journalctl -f yank the microsd, watch the log, then stick it back in… Then try the other… :wink:

Regards,

Robert,
I found a problem. With the SD card removed, I can boot from the eMMC and login. When I insert the SDcard, my system immediately reboots like I pressed the reset button. The problem is repeatable. I need to check u-boot console output to see if it thinks the power was cycled or reset was pressed. I can boot from the SDcard (holding switch-2 while power is applied) without problems.
Any ideas why inserting the SDcard would cause a reboot?

Thank you,

That is very very strange… Make sure “quiet” is disabled on the command line, so we could see the full serial log to see if something is triggering the reboot…

Our patched version of u-boot, will also dump the watchdog registers to give us a little hint of what caused the reboot…

Regards,

Robert,
I’m not sure what part of the log is the watchdog registers.
Step 1. power on board without SDcard inserted.
Step 2. wait for boot to complete.
Step 3. login (optional. the board will reboot if you are logged in or not)
Step 4: insert SDcard

Here is the u-boot and kernel serial logs. I removed the rootfs logs to make post shorter.

SD card is not inserted. applied power to board

U-Boot SPL 2019.04 (Jul 31 2020 - 12:15:22 -0500)
Trying to boot from MMC2
Loading Environment from EXT4... OK


U-Boot 2019.04 (Jul 31 2020 - 12:15:22 -0500)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... OK
Board: BeagleBone Black
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net:   eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 1 seconds
board_name=[A335BNLT] ...
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
Card did not respond to voltage select!
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
980 bytes read in 10 ms (95.7 KiB/s)
Loaded environment from /boot/uEnv.txt
debug: [dtb=zcpu-main.dtb] ...
Using: dtb=zcpu-main.dtb ...
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.19.106-bone49 ...
8069632 bytes read in 517 ms (14.9 MiB/s)
debug: [enable_uboot_overlays=] ...
loading /boot/dtbs/4.19.106-bone49/zcpu-main.dtb ...
53244 bytes read in 18 ms (2.8 MiB/s)
uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable...
debug: [console=ttyO0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait loglevel=7 coherent_pool=1M net.ifnames=0] ...
debug: [bootz 0x82000000 - 0x88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8fff0000, end 8ffffffb ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.106-bone49 (jak@ws271) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.030
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: WMI OSD3358 ZCPU
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 48 MiB at 0x9d000000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] random: get_random_bytes called from start_kernel+0x83/0x400 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait loglevel=7 coherent_pool=10
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 455168K/524288K available (8192K kernel code, 1002K rwdata, 3032K rodata, 1024K init, 314K bss, 19968K reserve)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf800000 - 0xbfe00000   (   6 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (9184 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   (1003 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 315 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 38465 entries in 76 pages
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000012] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000030] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000042] OMAP clocksource: timer1 at 24000000 Hz
[    0.000430] timer_probe: no matching timers found
[    0.000613] Console: colour dummy device 80x30
[    0.000637] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.000644] This ensures that you still see kernel messages. Please
[    0.000649] update your kernel commandline.
[    0.000696] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
[    0.047158] pid_max: default: 32768 minimum: 301
[    0.047422] Security Framework initialized
[    0.047436] Yama: becoming mindful.
[    0.047567] AppArmor: AppArmor initialized
[    0.047655] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.047668] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.048533] CPU: Testing write buffer coherency: ok
[    0.048587] CPU0: Spectre v2: using BPIALL workaround
[    0.049442] Setting up static identity map for 0x80100000 - 0x80100054
[    0.049588] rcu: Hierarchical SRCU implementation.
[    0.052387] EFI services will not be available.
[    0.053839] devtmpfs: initialized
[    0.063059] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.063564] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.063585] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.067334] xor: measuring software checksum speed
[    0.107161]    arm4regs  :  1222.000 MB/sec
[    0.147158]    8regs     :  1095.000 MB/sec
[    0.187157]    32regs    :  1056.000 MB/sec
[    0.227157]    neon      :  1706.000 MB/sec
[    0.227166] xor: using function: neon (1706.000 MB/sec)
[    0.227184] pinctrl core: initialized pinctrl subsystem
[    0.227877] DMI not present or invalid.
[    0.228271] NET: Registered protocol family 16
[    0.231780] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.257500] l4_wkup_cm:clk:0010:0: failed to disable
[    0.297290] audit: initializing netlink subsys (disabled)
[    0.298227] cpuidle: using governor menu
[    0.303247] audit: type=2000 audit(0.288:1): state=initialized audit_enabled=0 res=1
[    0.303577] OMAP GPIO hardware version 0.1
[    0.313012] No ATAGs?
[    0.313022] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.322239] raid6: using algorithm neonx8 gen() 0 MB/s
[    0.322256] raid6: .... xor() 0 MB/s, rmw enabled
[    0.322264] raid6: using neon recovery algorithm
[    0.327673] edma 49000000.edma: TI EDMA DMA engine driver
[    0.329688] SCSI subsystem initialized
[    0.329980] usbcore: registered new interface driver usbfs
[    0.330027] usbcore: registered new interface driver hub
[    0.330153] usbcore: registered new device driver usb
[    0.330750] pps_core: LinuxPPS API ver. 1 registered
[    0.330762] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.330783] PTP clock support registered
[    0.331365] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.331915] Advanced Linux Sound Architecture Driver Initialized.
[    0.332501] NetLabel: Initializing
[    0.332514] NetLabel:  domain hash size = 128
[    0.332520] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.332595] NetLabel:  unlabeled traffic allowed by default
[    0.333268] clocksource: Switched to clocksource timer1
[    0.449033] VFS: Disk quotas dquot_6.6.0
[    0.449116] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.449781] AppArmor: AppArmor Filesystem Enabled
[    0.458485] NET: Registered protocol family 2
[    0.459271] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.459302] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.459342] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.459380] TCP: Hash tables configured (established 4096 bind 4096)
[    0.459485] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.459505] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.459704] NET: Registered protocol family 1
[    0.460356] RPC: Registered named UNIX socket transport module.
[    0.460370] RPC: Registered udp transport module.
[    0.460377] RPC: Registered tcp transport module.
[    0.460384] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.461086] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.463987] Initialise system trusted keyrings
[    0.464287] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.470039] zbud: loaded
[    0.472434] NFS: Registering the id_resolver key type
[    0.472481] Key type id_resolver registered
[    0.472489] Key type id_legacy registered
[    0.472507] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.472769] fuse init (API version 7.27)
[    0.479739] Key type asymmetric registered
[    0.479759] Asymmetric key parser 'x509' registered
[    0.479844] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    0.480063] io scheduler noop registered
[    0.480076] io scheduler deadline registered
[    0.480400] io scheduler cfq registered (default)
[    0.480411] io scheduler mq-deadline registered
[    0.481849] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.483767] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    0.484762] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    0.487733] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
[    1.219059] console [ttyS0] enabled
[    1.223430] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a 8250
[    1.232960] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 32, base_baud = 3000000) is a 8250
[    1.242435] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 33, base_baud = 3000000) is a 8250
[    1.251945] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 34, base_baud = 3000000) is a 8250
[    1.262690] omap_rng 48310000.rng: Random Number Generator ver. 20
[    1.269005] random: fast init done
[    1.276565] libphy: Fixed MDIO Bus: probed
[    1.281035] random: crng init done
[    1.285946] CAN device driver interface
[    1.341347] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.349070] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    1.356743] libphy: 4a101000.mdio: probed
[    1.360892] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.370850] cpsw 4a100000.ethernet: Detected MACID = f4:5e:ab:32:87:04
[    1.377645] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.384087] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.389403] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies)
[    1.397550] cpsw 4a100000.ethernet: cpsw: Detected MACID = f4:5e:ab:32:87:06
[    1.405731] usbcore: registered new interface driver smsc95xx
[    1.411903] usbcore: registered new interface driver usb-storage
[    1.419772] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
[    1.429846] am335x-phy-driver 47401300.usb-phy: Linked as a consumer to regulator.0
[    1.440000] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[    1.445441] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
[    1.453088] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    1.461498] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.468773] usb usb1: Product: MUSB HDRC host driver
[    1.473773] usb usb1: Manufacturer: Linux 4.19.106-bone49 musb-hcd
[    1.479992] usb usb1: SerialNumber: musb-hdrc.0
[    1.485158] hub 1-0:1.0: USB hub found
[    1.489029] hub 1-0:1.0: 1 port detected
[    1.494561] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
[    1.504617] am335x-phy-driver 47401b00.usb-phy: Linked as a consumer to regulator.0
[    1.520608] omap_rtc 44e3e000.rtc: registered as rtc0
[    1.526456] i2c /dev entries driver
[    1.531788] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.539061] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
[    1.548549] /cpus/cpu@0: unsupported enable-method property: ti,am3352
[    1.555162] CPUidle arm: CPU 0 failed to init idle CPU ops
[    1.561472] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
[    1.570243] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.575344] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.1
[    1.607441] omap_hsmmc 481d8000.mmc: Linked as a consumer to regulator.1
[    1.641331] ledtrig-cpu: registered to indicate activity on CPUs
[    1.647944] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    1.654003] omap-aes 53500000.aes: will run requests pump with realtime priority
[    1.662957] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    1.671131] hidraw: raw HID events driver (C) Jiri Kosina
[    1.677574] usbcore: registered new interface driver usbhid
[    1.683358] usbhid: USB HID core driver
[    1.687681] remoteproc remoteproc0: wkup_m3 is available
[    1.695886] gnss: GNSS driver registered with major 242
[    1.703884] NET: Registered protocol family 10
[    1.711359] Segment Routing with IPv6
[    1.715307] mip6: Mobile IPv6
[    1.718374] NET: Registered protocol family 17
[    1.723024] can: controller area network core (rev 20170425 abi 9)
[    1.729450] NET: Registered protocol family 29
[    1.734077] Key type dns_resolver registered
[    1.738420] mpls_gso: MPLS GSO support
[    1.742422] ThumbEE CPU extension supported.
[    1.746797] Registering SWP/SWPB emulation handler
[    1.751633] omap_voltage_late_init: Voltage driver support not added
[    1.759486] registered taskstats version 1
[    1.763691] Loading compiled-in X.509 certificates
[    1.768667] mmc1: switch to bus width 8 failed
[    1.773234] zswap: loaded using pool lzo/zbud
[    1.778324] mmc1: new high speed MMC card at address 0001
[    1.785824] Btrfs loaded, crc32c=crc32c-generic
[    1.791443] mmcblk1: mmc1:0001 004GA0 3.69 GiB 
[    1.796171] AppArmor: AppArmor sha1 policy hashing enabled
[    1.802272] mmcblk1boot0: mmc1:0001 004GA0 partition 1 2.00 MiB
[    1.813959] mmcblk1boot1: mmc1:0001 004GA0 partition 2 2.00 MiB
[    1.824982] mmcblk1rpmb: mmc1:0001 004GA0 partition 3 512 KiB, chardev (244:0)
[    1.834893]  mmcblk1: p1
[    1.867111] tps6521x_pwrbutton tps65217-pwrbutton: DMA mask not set
[    1.874031] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
[    1.885289] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.891301] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.898316] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.904974] remoteproc remoteproc0: powering up wkup_m3
[    1.910335] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[    1.920823] cpu cpu0: Linked as a consumer to regulator.3
[    1.926516] remoteproc remoteproc0: remote processor wkup_m3 is now up
[    1.933083] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193
[    1.940094] cpu cpu0: Dropping the link to regulator.3
[    1.945675] cpu cpu0: Linked as a consumer to regulator.3
[    1.952948] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[    1.962433] ALSA device list:
[    1.965507]   No soundcards found.
[    1.971374] EXT4-fs (mmcblk1p1): INFO: recovery required on readonly filesystem
[    1.978812] EXT4-fs (mmcblk1p1): write access will be enabled during recovery
[    2.036743] EXT4-fs (mmcblk1p1): recovery complete
[    2.042867] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)
[    2.051090] VFS: Mounted root (ext4 filesystem) readonly on device 179:1.
[    2.064862] devtmpfs: mounted
[    2.072473] Freeing unused kernel memory: 1024K
[    2.077529] Run /sbin/init as init process
[    2.569839] systemd[1]: System time before build time, advancing clock.
[    2.638382] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTS)
[    2.660587] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 10 (buster)!

i removed the rootfs log section.

Debian GNU/Linux 10 arm ttyS0

default username:password is [debian:temppwd]

arm login: root
Password: 
Last login: Fri Feb 12 00:03:08 UTC 2021 on ttyS0

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@arm:~# 

succesful boot from eMMC .

inserted SDcard, immediate rboot…

U-Boot SPL 2019.04 (Jul 31 2020 - 12:15:22 -0500)
Trying to boot from MMC2
Loading Environment from EXT4... OK


U-Boot 2019.04 (Jul 31 2020 - 12:15:22 -0500)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Global external warm reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... OK
Board: BeagleBone Black
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net:   eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 1 seconds
board_name=[A335BNLT] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
980 bytes read in 49 ms (19.5 KiB/s)
Loaded environment from /boot/uEnv.txt
debug: [dtb=zcpu-main.dtb] ...
Using: dtb=zcpu-main.dtb ...
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.19.106-bone49 ...
8069632 bytes read in 587 ms (13.1 MiB/s)
debug: [enable_uboot_overlays=] ...
loading /boot/dtbs/4.19.106-bone49/zcpu-main.dtb ...
53244 bytes read in 96 ms (541 KiB/s)
uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable...
debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait loglevel=7 coherent_pool=1M net.ifnames=0] ...
debug: [bootz 0x82000000 - 0x88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8fff0000, end 8ffffffb ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.106-bone49 (jak@ws271) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.030
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: WMI OSD3358 ZCPU
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 48 MiB at 0x9d000000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] random: get_random_bytes called from start_kernel+0x83/0x400 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait loglevel=7 coherent_pool=10
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 455168K/524288K available (8192K kernel code, 1002K rwdata, 3032K rodata, 1024K init, 314K bss, 19968K reserve)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf800000 - 0xbfe00000   (   6 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (9184 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   (1003 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 315 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 38465 entries in 76 pages
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000012] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000030] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000042] OMAP clocksource: timer1 at 24000000 Hz
[    0.000425] timer_probe: no matching timers found
[    0.000612] Console: colour dummy device 80x30
[    0.000638] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.000645] This ensures that you still see kernel messages. Please
[    0.000651] update your kernel commandline.
[    0.000697] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
[    0.047165] pid_max: default: 32768 minimum: 301
[    0.047432] Security Framework initialized
[    0.047447] Yama: becoming mindful.
[    0.047573] AppArmor: AppArmor initialized
[    0.047662] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.047675] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.048541] CPU: Testing write buffer coherency: ok
[    0.048593] CPU0: Spectre v2: using BPIALL workaround
[    0.049435] Setting up static identity map for 0x80100000 - 0x80100054
[    0.049583] rcu: Hierarchical SRCU implementation.
[    0.052389] EFI services will not be available.
[    0.053833] devtmpfs: initialized
[    0.063074] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.063575] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.063596] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.067157] xor: measuring software checksum speed
[    0.107167]    arm4regs  :  1222.000 MB/sec
[    0.147164]    8regs     :  1095.000 MB/sec
[    0.187162]    32regs    :  1055.000 MB/sec
[    0.227163]    neon      :  1706.000 MB/sec
[    0.227171] xor: using function: neon (1706.000 MB/sec)
[    0.227189] pinctrl core: initialized pinctrl subsystem
[    0.227885] DMI not present or invalid.
[    0.228273] NET: Registered protocol family 16
[    0.231775] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.257494] l4_wkup_cm:clk:0010:0: failed to disable
[    0.297322] audit: initializing netlink subsys (disabled)
[    0.298256] cpuidle: using governor menu
[    0.303252] audit: type=2000 audit(0.288:1): state=initialized audit_enabled=0 res=1
[    0.303637] OMAP GPIO hardware version 0.1
[    0.313067] No ATAGs?
[    0.313076] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.322321] raid6: using algorithm neonx8 gen() 0 MB/s
[    0.322339] raid6: .... xor() 0 MB/s, rmw enabled
[    0.322347] raid6: using neon recovery algorithm
[    0.327771] edma 49000000.edma: TI EDMA DMA engine driver
[    0.329776] SCSI subsystem initialized
[    0.330068] usbcore: registered new interface driver usbfs
[    0.330113] usbcore: registered new interface driver hub
[    0.330239] usbcore: registered new device driver usb
[    0.330840] pps_core: LinuxPPS API ver. 1 registered
[    0.330852] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.330873] PTP clock support registered
[    0.331459] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.332002] Advanced Linux Sound Architecture Driver Initialized.
[    0.332579] NetLabel: Initializing
[    0.332593] NetLabel:  domain hash size = 128
[    0.332599] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.332674] NetLabel:  unlabeled traffic allowed by default
[    0.333343] clocksource: Switched to clocksource timer1
[    0.449296] VFS: Disk quotas dquot_6.6.0
[    0.449440] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.450047] AppArmor: AppArmor Filesystem Enabled
[    0.458751] NET: Registered protocol family 2
[    0.459535] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.459567] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.459608] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.459646] TCP: Hash tables configured (established 4096 bind 4096)
[    0.459750] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.459769] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.459968] NET: Registered protocol family 1
[    0.460615] RPC: Registered named UNIX socket transport module.
[    0.460629] RPC: Registered udp transport module.
[    0.460636] RPC: Registered tcp transport module.
[    0.460642] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.461515] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.464294] Initialise system trusted keyrings
[    0.464594] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.470381] zbud: loaded
[    0.472804] NFS: Registering the id_resolver key type
[    0.472851] Key type id_resolver registered
[    0.472859] Key type id_legacy registered
[    0.472879] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.473142] fuse init (API version 7.27)
[    0.480122] Key type asymmetric registered
[    0.480142] Asymmetric key parser 'x509' registered
[    0.480225] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    0.480440] io scheduler noop registered
[    0.480451] io scheduler deadline registered
[    0.480783] io scheduler cfq registered (default)
[    0.480794] io scheduler mq-deadline registered
[    0.482250] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.484150] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    0.485153] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    0.488115] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
[    1.219429] console [ttyS0] enabled
[    1.223800] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a 8250
[    1.233324] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 32, base_baud = 3000000) is a 8250
[    1.242820] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 33, base_baud = 3000000) is a 8250
[    1.252319] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 34, base_baud = 3000000) is a 8250
[    1.263021] omap_rng 48310000.rng: Random Number Generator ver. 20
[    1.269355] random: fast init done
[    1.277141] libphy: Fixed MDIO Bus: probed
[    1.281373] random: crng init done
[    1.286254] CAN device driver interface
[    1.341415] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.349138] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    1.356827] libphy: 4a101000.mdio: probed
[    1.360976] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.370943] cpsw 4a100000.ethernet: Detected MACID = f4:5e:ab:32:87:04
[    1.377743] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.384188] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.389508] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies)
[    1.397657] cpsw 4a100000.ethernet: cpsw: Detected MACID = f4:5e:ab:32:87:06
[    1.405855] usbcore: registered new interface driver smsc95xx
[    1.412032] usbcore: registered new interface driver usb-storage
[    1.419895] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
[    1.429974] am335x-phy-driver 47401300.usb-phy: Linked as a consumer to regulator.0
[    1.440128] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[    1.445566] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
[    1.453211] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    1.461616] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.468891] usb usb1: Product: MUSB HDRC host driver
[    1.473891] usb usb1: Manufacturer: Linux 4.19.106-bone49 musb-hcd
[    1.480110] usb usb1: SerialNumber: musb-hdrc.0
[    1.485279] hub 1-0:1.0: USB hub found
[    1.489155] hub 1-0:1.0: 1 port detected
[    1.494682] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
[    1.504749] am335x-phy-driver 47401b00.usb-phy: Linked as a consumer to regulator.0
[    1.520304] omap_rtc 44e3e000.rtc: already running
[    1.525693] omap_rtc 44e3e000.rtc: registered as rtc0
[    1.531484] i2c /dev entries driver
[    1.536801] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.544085] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
[    1.553611] /cpus/cpu@0: unsupported enable-method property: ti,am3352
[    1.560202] CPUidle arm: CPU 0 failed to init idle CPU ops
[    1.566452] omap_gpio 44e07000.gpio: Could not set line 5 debounce to 200000 microseconds (-22)
[    1.575237] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.580336] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.1
[    1.613840] omap_hsmmc 481d8000.mmc: Linked as a consumer to regulator.1
[    1.646982] ledtrig-cpu: registered to indicate activity on CPUs
[    1.653787] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    1.659937] omap-aes 53500000.aes: will run requests pump with realtime priority
[    1.668997] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    1.677447] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.685625] hidraw: raw HID events driver (C) Jiri Kosina
[    1.691801] usbcore: registered new interface driver usbhid
[    1.697644] usbhid: USB HID core driver
[    1.701647] mmc0: Problem switching card into high-speed mode!
[    1.708003] remoteproc remoteproc0: wkup_m3 is available
[    1.713504] mmc0: new SDHC card at address 0001
[    1.721085] gnss: GNSS driver registered with major 242
[    1.727037] mmcblk0: mmc0:0001 SD16G 3.75 GiB 
[    1.735206] NET: Registered protocol family 10
[    1.739961]  mmcblk0: p1
[    1.746748] Segment Routing with IPv6
[    1.750700] mip6: Mobile IPv6
[    1.753782] NET: Registered protocol family 17
[    1.758424] can: controller area network core (rev 20170425 abi 9)
[    1.764794] NET: Registered protocol family 29
[    1.769421] Key type dns_resolver registered
[    1.773758] mpls_gso: MPLS GSO support
[    1.777787] ThumbEE CPU extension supported.
[    1.782111] Registering SWP/SWPB emulation handler
[    1.786938] omap_voltage_late_init: Voltage driver support not added
[    1.794813] registered taskstats version 1
[    1.799034] Loading compiled-in X.509 certificates
[    1.804004] mmc1: switch to bus width 8 failed
[    1.808571] zswap: loaded using pool lzo/zbud
[    1.813643] mmc1: new high speed MMC card at address 0001
[    1.821161] Btrfs loaded, crc32c=crc32c-generic
[    1.826834] mmcblk1: mmc1:0001 004GA0 3.69 GiB 
[    1.831568] AppArmor: AppArmor sha1 policy hashing enabled
[    1.837727] mmcblk1boot0: mmc1:0001 004GA0 partition 1 2.00 MiB
[    1.850014] mmcblk1boot1: mmc1:0001 004GA0 partition 2 2.00 MiB
[    1.860426] mmcblk1rpmb: mmc1:0001 004GA0 partition 3 512 KiB, chardev (244:0)
[    1.869291]  mmcblk1: p1
[    1.907152] tps6521x_pwrbutton tps65217-pwrbutton: DMA mask not set
[    1.914073] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
[    1.925307] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.931320] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.938327] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.944977] remoteproc remoteproc0: powering up wkup_m3
[    1.950337] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[    1.960840] cpu cpu0: Linked as a consumer to regulator.3
[    1.966535] remoteproc remoteproc0: remote processor wkup_m3 is now up
[    1.973101] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193
[    1.973154] musb-hdrc musb-hdrc.0: VBUS_ERROR in a_wait_vrise (88, <AValid), retry #3, port1 0008010c
[    1.989426] cpu cpu0: Dropping the link to regulator.3
[    1.994985] cpu cpu0: Linked as a consumer to regulator.3
[    2.002373] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[    2.011819] ALSA device list:
[    2.014937]   No soundcards found.
[    2.023010] EXT4-fs (mmcblk0p1): INFO: recovery required on readonly filesystem
[    2.030426] EXT4-fs (mmcblk0p1): write access will be enabled during recovery
[    3.230619] EXT4-fs (mmcblk0p1): recovery complete
[    3.243161] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    3.251382] VFS: Mounted root (ext4 filesystem) readonly on device 179:1.
[    3.271366] devtmpfs: mounted
[    3.279088] Freeing unused kernel memory: 1024K
[    3.284113] Run /sbin/init as init process
[    4.206142] systemd[1]: System time before build time, advancing clock.
[    4.352501] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTS)
[    4.374672] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 10 (buster)!

i removed the rootfs log section.

Debian GNU/Linux 10 arm ttyS0

default username:password is [debian:temppwd]

arm login: root
Password: 
Last login: Fri Feb 12 23:27:45 UTC 2021 on ttyS0

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

root@arm:~# 

successful boot from SDcard completed after inserting SDcard

Thank you,

Here is that section…

So something internally triggered a reset, but it wasn’t the watchdog…

	sys_reboot = readl(PRM_RSTST);
	if (sys_reboot & (1 << 9))
		puts("Reset Source: IcePick reset has occurred.\n");

	if (sys_reboot & (1 << 5))
		puts("Reset Source: Global external warm reset has occurred.\n");

	if (sys_reboot & (1 << 4))
		puts("Reset Source: watchdog reset has occurred.\n");

	if (sys_reboot & (1 << 1))
		puts("Reset Source: Global warm SW reset has occurred.\n");

	if (sys_reboot & (1 << 0))
		puts("Reset Source: Power-on reset has occurred.\n");

Regards,

Robert,

Your reply made me look at the am335x technical manual PRM_RSTST register. I found that I get the same messages if I press the reset button. Using an o-scope connected to WARMRST (A10). I notice that WARMRST is being triggered when I insert the SDcard. I am looking at my reset circuit to find what is triggering the WARMRST signal.
Thank you for your help.