# Morse\_sdio\_reg32\_write failed

**URL:** <https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207>\
**Category:** Linux\
**Created:** [December 18, 2024, 12:47am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207 "2024-12-18T00:47:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![termus](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@termus](https://community.morsemicro.com/u/termus)\
**Post date:** [December 18, 2024, 12:47am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/1 "2024-12-18T00:47:05Z")

</div>

So i renamed bcf\_mf08651\_us.bin to bcf\_default.bin and this how looks like:

```auto
termus@debian:~$ sudo dmesg | grep morse
[23.282597] morse micro driver registration. Version 0-rel_1_12_4_2024_Jun_11-6-g63cd0768
[23.308443] morse_sdio mmc1:0001:1: sdio new func 1 vendor 0x325b device 0x306 block 0x8/0x8
[23.309019] morse_sdio mmc1:0001:2: sdio new func 2 vendor 0x325b device 0x306 block 0x200/0x200
[23.309788] morse_sdio mmc1:0001:2: Device node not found
[23.325800] morse_sdio mmc1:0001:2: No pin configs found, using defaults...
[23.376083] morse_sdio mmc1:0001:2: Loaded firmware from morse/mm6108.bin, size 433044, crc32 0x436ba524
[23.416113] morse_sdio mmc1:0001:2: Loaded BCF from morse/bcf_default.bin, size 1003, crc32 0xaf924dcf
[34.181635] morse_sdio mmc1:0001:2: sdio_memcpy_toio failed: 18446744073709551506
[34.189431] morse_sdio mmc1:0001:2: morse_sdio_dm_write failed -110
[34.864377] morse_sdio mmc1:0001:2: sdio writel failed 4294967280
[34.874173] morse_sdio mmc1:0001:2: morse_sdio_reg32_write failed 18446744073709551600
[35.961203] morse_sdio mmc1:0001:2: morse_sdio_set_func_address_base -16
[35.968538] morse_sdio mmc1:0001:2: morse_sdio_get_func failed
[35.979971] morse_sdio mmc1:0001:2: morse_sdio_reg32_write failed 18446744073709551611
[36.639928] morse_sdio mmc1:0001:2: morse_sdio_set_func_address_base -16
[36.651741] morse_sdio mmc1:0001:2: morse_sdio_get_func failed
[36.663142] morse_sdio mmc1:0001:2: morse_sdio_reg32_write failed 18446744073709551611
[37.335604] morse_sdio mmc1:0001:2: morse_sdio_set_func_address_base -16
[37.342426] morse_sdio mmc1:0001:2: morse_sdio_get_func failed
[37.351942] morse_sdio mmc1:0001:2: morse_sdio_reg32_write failed 18446744073709551611
[38.465743] morse_sdio mmc1:0001:2: morse_sdio_set_func_address_base -16
[38.473721] morse_sdio mmc1:0001:2: morse_sdio_get_func failed
[38.479750] morse_sdio mmc1:0001:2: morse_sdio_reg32_write failed 18446744073709551611
[39.147934] morse_sdio mmc1:0001:2: morse_sdio_set_func_address_base -16
[39.155790] morse_sdio mmc1:0001:2: morse_sdio_get_func failed
[39.161760] morse_sdio mmc1:0001:2: morse_sdio_reg32_write failed 18446744073709551611
[39.170094] morse_sdio mmc1:0001:2: morse_firmware_init failed: -5
[39.857628] morse_sdio_probe failed. The driver has not been loaded!
[39.864168] morse_sdio: probe of mmc1:0001:2 failed with error -5

```

---

<div class="post-metadata">

**Author:** ![ajudge](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ajudge](https://community.morsemicro.com/u/ajudge)\
**Post date:** [December 18, 2024, 1:04am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/2 "2024-12-18T01:04:08Z")

</div>

@termus I’ve moved this thread to a new topic.

Assuming an ARM host, the errors shown here:

- -110 → ETIMEDOUT
- -16 → EBUSY
- -5 → EIO

These usually indicate an issue communicating with the chip. This can be caused by signal integrity problems, poor supplies, the chip not coming out of reset, amongst many others.

How are you connecting your Alfa module to your board? Do you have any details on the hardware which you can share?

---

<div class="post-metadata">

**Author:** ![termus](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@termus](https://community.morsemicro.com/u/termus)\
**Post date:** [December 18, 2024, 1:13am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/3 "2024-12-18T01:13:26Z")

</div>

> [@ajudge](#):
>
> How are you connecting your Alfa module to your board? Do you have any details on the hardware which you can share?

Module is this: [AHM26108D – ALFA Network Inc.](https://www.alfa.com.tw/products/ahm26108d?_pos=18&_sid=dd3c5ff31&_ss=r&variant=39922067898440)

Host photo: [https://linmob.net/purism-librem5-visual-impressions/librem5-back-modem-wifi.jpg](https://linmob.net/purism-librem5-visual-impressions/librem5-back-modem-wifi.jpg)

---

<div class="post-metadata">

**Author:** ![ajudge](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ajudge](https://community.morsemicro.com/u/ajudge)\
**Post date:** [December 18, 2024, 1:18am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/4 "2024-12-18T01:18:30Z")

</div>

If you have a logic analyzer, can you capture the RESET and SDIO lines on the module?

Can you share the device tree file for the libre board?

I can see schematics for the Librem 5 boards are available. Which revision are you using?

---

<div class="post-metadata">

**Author:** ![termus](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@termus](https://community.morsemicro.com/u/termus)\
**Post date:** [December 18, 2024, 1:34am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/5 "2024-12-18T01:34:18Z")

</div>

> [@ajudge](#):
>
> If you have a logic analyzer, can you capture the RESET and SDIO lines

I dont have logic analizer.

> [@ajudge](#):
>
> Can you share the device tree file for the libre board?

> **[librem5\_evergreen\_mainboard\_schematic.pdf](https://developer.puri.sm/Librem5/_downloads/5d5f955566b3c35f6c4b23127b5fda86/librem5_evergreen_mainboard_schematic.pdf)**
>
> 1219.98 KB

> [@ajudge](#):
>
> I can see schematics for the Librem 5 boards are available. Which revision are you using?

Evergreen

---

<div class="post-metadata">

**Author:** ![ajudge](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ajudge](https://community.morsemicro.com/u/ajudge)\
**Post date:** [December 18, 2024, 2:33am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/6 "2024-12-18T02:33:51Z")

</div>

> Can you share the device tree file for the libre board?

I mean the .dts file Linux uses to configure hardware. You should be able to extract this from the device by installing `dtc` on the device and running `dtc -I fs -O dts /sys/firmware/devicetree/base -o librem5.dts`.

---

<div class="post-metadata">

**Author:** ![termus](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@termus](https://community.morsemicro.com/u/termus)\
**Post date:** [December 18, 2024, 2:40am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/7 "2024-12-18T02:40:29Z")

</div>

> [@ajudge](#):
>
> I mean the .dts file Linux uses to configure hardware.

> **[arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts · pureos/byzantium ·...](https://source.puri.sm/Librem5/linux/-/blob/pureos/byzantium/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts?ref_type=heads)**
>
> The kernel source for the Librem 5 and its devkit

---

<div class="post-metadata">

**Author:** ![termus](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@termus](https://community.morsemicro.com/u/termus)\
**Post date:** [December 18, 2024, 2:42am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/8 "2024-12-18T02:42:03Z")

</div>

Others SDIO Legacy WLAN(Redpine)(SpakLan) modules work just fine… i not sure what going on this time.

---

<div class="post-metadata">

**Author:** ![ajudge](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ajudge](https://community.morsemicro.com/u/ajudge)\
**Post date:** [December 18, 2024, 1:14pm UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/9 "2024-12-18T13:14:29Z")

</div>

I’ll continue to check what I can on the hardware side, but this looks very similar to [Mmc2: error -110 whilst initialising SDIO card - #19 by ajudge](https://community.morsemicro.com/t/mmc2-error-110-whilst-initialising-sdio-card/149/19).

While the MM6108 can support a 1.8V I/O voltage for the SDIO lines, the RESET line needs to operate in the “VBAT” domain, 3.3V.

Unfortunately at this stage the solution may require a pull-up resistor to be inserted on the RESET line to 3.3V, as well as some device tree adjustment to configure the SD2\_RESET pin as an open drain GPIO, and finally adding an mm6108 specific child node in the `usdhc2` controller to provide a reset-gpios to the Morse driver so it can control that GPIO.

Are you in a position where you can add a hardware pullup to that RESET line? Does the bootloader allow you to load an alternative device tree binary?

---

<div class="post-metadata">

**Author:** ![termus](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@termus](https://community.morsemicro.com/u/termus)\
**Post date:** [December 19, 2024, 2:01pm UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/10 "2024-12-19T14:01:30Z")

</div>

> [@ajudge](#):
>
> Are you in a position where you can add a hardware pullup to that RESET line?

I may on module land, not on phone land as it may malfuntions on others working modules. Also on phone side it needed disassembling the case. So pull-up on Phone land it not viable.

> [@ajudge](#):
>
> bootloader allow you to load an alternative device tree binary?

Yes there is a option to load a different device tree.

At the moment i want to test same mm6108 module to Laptop Librem 14 as it support sdio via M2-E too.

---

<div class="post-metadata">

**Author:** ![ajudge](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ajudge](https://community.morsemicro.com/u/ajudge)\
**Post date:** [December 20, 2024, 12:22am UTC](https://community.morsemicro.com/t/morse-sdio-reg32-write-failed/207/11 "2024-12-20T00:22:47Z")

</div>

Interested to see how you go with the laptop.

Regarding the Librem5, once you get a pull-up to 3V3 on the RESET line, you’ll need to add the following to a top level device tree file.

```c
&iomuxc {
	pinctrl_usdhc2_morse: usdhc2-morsegrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK 0x83
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD 0xc3
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xc3
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xc3
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xc3
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xc3
			MX8MQ_IOMUXC_SD2_RESET_B_GPIO2_IO19	0xa1
		>;
	}
}

&usdhc2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc2_morse>;
	mm6108_sdio: mm6108_sdio@0 {
		compatible = "morse,mm610x";
		reset-gpios = <&gpio2 19 0>;
		status = "okay";
		reg = <2>;
	}
}

```

This reconfigures the dedicated SD RESET line to be an open drain GPIO and gives the Morse Micro driver control of it.
