Mmc1: Timeout waiting for hardware interrupt

Hi @ajudge, just wanted to give you an update on our attempts to turn off the ADMA.

At first we implemented the patch exactly as you described. However, that resulted in errors communicating with the eMMC memory during boot. The boot sequence could not complete.

Then we decided to change the patch slightly, where, if I understand correctly, we only turn off ADMA for the mmc1 interface to which the halow module is connected. Is this understanding correct?

We were able to boot up the device without errors on the mmc2 interface, but the timeout error on mmc1 persisted.

Next we have tried to setup the sdhci.debug_quirks=0x40 in U-boot. Depending on how we do that it was either unable to boot up, or the error remained unresolved.

I will try to see if there are other ways of implementing the quirks this week.

Do you have any other suggestions we could try?

Thank you for this. I was having the same problem on an i.MX93-based design and was able to get the interface loaded and scanning.

My design is using Yocto Scarthgap (6.6.36).

Really glad to hear this helped you @tim.carney.cargt!

@SanderV ah, I was using NAND on board instead of eMMC (which was having issues), unfortunately the simple solution I’ve provided is going to apply globally. Applying the sdhci.debug_quirks is also going to apply globally.

Digging through the 5.15 kernel source I have, there is actually a device-tree property which might be suitable!

The following code-block comes from sdhci.c

	if (caps) {
		host->caps = *caps;
	} else {
		host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
		host->caps &= ~lower_32_bits(dt_caps_mask);
		host->caps |= lower_32_bits(dt_caps);
	}

If my understanding of the linux sdhci driver is correct, this should be where the iMX esdhc_readl_le is called from. This means that you should be able to set the sdhci-caps-mask property in the mmc1 devicetree node such that it disables SDHCI_CAN_DO_ADMA2. I wish I had found this earlier!

ie,

&mmc1 {
    ...
    sdhci-caps-mask = <0x00080000>;
    ...
}

Hi @ajudge

Thanks, that makes sense!

I have been playing around with the property after removing the patch, but so far not the results we are looking for. The system is persistent in using ADMA.

root@ucm-imx8m-mini:~# dmesg | grep ADMA
[    1.597838] mmc2: SDHCI controller on 30b60000.mmc [30b60000.mmc] using ADMA
[    2.305003] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA
[    2.376908] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA 

I have added your suggestion to the device tree as shown below

&usdhc2 {
	#address-cells = <1>;
    	#size-cells = <0>;
	compatible = "fsl,imx8mm-usdhc";
	assigned-clocks = <&clk IMX8MM_CLK_USDHC2>;
	assigned-clock-rates = <6000000>;
	pinctrl-names = "default"; 
	//, "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
	//pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
	//pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
	bus-width = <4>;
	vmmc-supply = <&reg_usdhc2_vmmc>;
	status = "okay";
	//pinctrl-assert-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
	/delete-property/ cd-gpios;
	keep-power-in-suspend;
	non-removable;
	no-1-8-v;
	disable-wp;
	enable-sdio-wakeup;
	no-sd;
	fsl,sdio-async-interrupt-enabled;	
	sdhci-caps-mask = <0x00080000>;
	no-adma;
	mm6108_sdio: mm6108_sdio@0 {
		compatible = "morse,mm610x";
		reset-gpios = <&gpio1 8 0>;
		power-gpios = <&gpio3 24 GPIO_ACTIVE_LOW>, <&gpio3 20 GPIO_ACTIVE_HIGH>;
		//interrupt-parent = <&gpio2>;
		//interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
		//max-frequency = <5000000>;
		status = "okay";
		reg = <2>;
		bus-width = <4>;
	};
};

I have tried different variations that I found online:

sdhci-caps-mask = <0x00080000>;
sdhci-caps-mask = <0x00070000>;
sdhci-caps-mask = <0x000C0000>;
sdhci-caps-mask = <0x00200000>; # force PIO mode
sdhci-caps-mask = <0x00080000 0x00000000>;
sdhci-caps-mask = <0x00070000 0x00000000>;
sdhci-caps-mask = <0x000C0000 0x00000000>;
sdhci-caps-mask = <0x00200000 0x00000000>;

And two additional properties

broken-adma;
no-adma;

None of which seemed to have the desired effect.

It appears as though something might be overriding the device tree settings regarding ADMA. I did check in /proc/device-tree to ensure that the new property shows up and it does.

Any ideas what the problem could be?

Hm, that’s very frustrating and it definitely looks like it’s still forcefully enabling ADMA.

Can you modify __sdhci_read_caps in sdhci.c and add a debug print to the following code block (and verify the code block is actually there), just to verify the host->caps are being applied?

	if (host->quirks & SDHCI_QUIRK_MISSING_CAPS)
		return;

	if (caps) {
		host->caps = *caps;
	} else {
		host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
		host->caps &= ~lower_32_bits(dt_caps_mask);
		host->caps |= lower_32_bits(dt_caps);
		// add a debug print here - printk("using caps 0x%x\n", host->caps);
	}

Just fixing some things in our build environment at the moment. Will hopefully be able to do this before the weekend.

Just thinking one step ahead. Could we modify your proposed patch such that it targets only a specific interface, mmc1 in my case?

That’s very likely possible. Naively I would expect you could simply compare host->ioaddr against the base address of the mmc host controller you care about. In this case, it looks like mmc1 is an alias for usdhc2 so check host->ioaddr == 0x30b50000. Obviously not ideal as it is a hardcoded solution, but definitely good to check.

Make sure to verify that address.

I happened upon this thread as I am also running into ADMA failures with an mm6018 module but in my case its on an IMX8MP SoC.

I don’t see any broken-adma or no-adma property in the kernel so that seems invalid.

As far as your sdhci-caps-mask this is a 64bit value so to disable ADMA2 you would need to give it two 32bit values otherwise your trying to set the upper 64bits which is not what you want:
sdhci-caps-mask = <0x0 0x00080000>; /* disable ADMA2 */

Due to ‘ADMA Err: 0x00000007’ in your case here being an ADMA length mismatch try setting MORSE_SDIO_RW_ADDR_BOUNDARY_MASK to 0xffff0004 instead of the default 0xffff0000 which will reduce the ADMA length to 65532 instead of 65536. For me this resolved the ‘ADMA Err: 0x00000007’ on the IMX8MP but I still am having ADMA transfer errors.

In my case I’m disabling ADMA yet still getting ‘Timeout waiting for hardware Interrupt’ on some modules on my board:
[ 0.980955] mmc0 bounce up to 128 segments into one, max segment size 65536 bytes
[ 1.025937] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using DMA
[ 1.053192] mmc0: new high speed SDIO card at address 0001

  • cat /sys/kernel/debug/mmc0/ios
    clock: 50000000 Hz
    vdd: 21 (3.3 ~ 3.4 V)
    bus mode: 2 (push-pull)
    chip select: 0 (don’t care)
    power mode: 2 (on)
    bus width: 2 (4 bits)
    timing spec: 2 (sd high-speed)
    signal voltage: 0 (3.30 V)
    driver type: 0 (driver type B)
  • cat /sys/bus/mmc/devices/mmc0:0001/vendor
    0x325b
  • cat /sys/bus/mmc/devices/mmc0:0001/device
    0x0306
  • modprobe mac80211
  • insmod dot11ah.ko
    [ 31.196248] dot11ah: module verification failed: signature and/or required key missing - tainting kernel
    [ 31.207863] Morse Micro Dot11ah driver registration. Version 0-rel_1_12_4_2024_Jun_11-6-g63cd0768
  • insmod morse.ko bcf=bcf_default.bin country=US
[   31.333796] morse micro driver registration. Version 0-rel_1_12_4_2024_Jun_11-6-g63cd0768
[   31.342017] MORSE_SDIO_RW_ADDR_BOUNDARY_MASK=0xffff0004
[   31.353319] morse_sdio mmc0:0001:1: sdio new func 1 vendor 0x325b device 0x306 block 0x8/0x8
[   31.361969] morse_sdio mmc0:0001:2: sdio new func 2 vendor 0x325b device 0x306 block 0x200/0x200
[   31.370975] morse_sdio mmc0:0001:2: Device node not found
[   31.376429] morse_sdio mmc0:0001:2: No pin configs found, using defaults...
[   41.742436] mmc0: Timeout waiting for hardware interrupt.
[   41.747857] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[   41.754301] mmc0: sdhci: Sys addr:  0x43780080 | Version:  0x00000002
[   41.760744] mmc0: sdhci: Blk size:  0x00000004 | Blk cnt:  0x00000001
[   41.767186] mmc0: sdhci: Argument:  0x149a4004 | Trn mode: 0x00000013
[   41.773630] mmc0: sdhci: Present:   0x01f8820e | Host ctl: 0x00000003
[   41.780072] mmc0: sdhci: Power:     0x00000000 | Blk gap:  0x00000080
[   41.786513] mmc0: sdhci: Wake-up:   0x00000008 | Clock:    0x000000ff
[   41.792955] mmc0: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
[   41.799398] mmc0: sdhci: Int enab:  0x107f100b | Sig enab: 0x107f100b
[   41.805840] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000502
[   41.812282] mmc0: sdhci: Caps:      0x07eb0000 | Caps_1:   0x0000b400
[   41.818723] mmc0: sdhci: Cmd:       0x0000353a | Max curr: 0x00ffffff
[   41.825166] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
[   41.831607] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[   41.838048] mmc0: sdhci: Host ctl2: 0x00000000
[   41.842494] mmc0: sdhci-esdhc-imx: ========= ESDHC IMX DEBUG STATUS DUMP =========
[   41.850064] mmc0: sdhci-esdhc-imx: cmd debug status:  0x2100
[   41.855727] mmc0: sdhci-esdhc-imx: data debug status:  0x22a0
[   41.861472] mmc0: sdhci-esdhc-imx: trans debug status:  0x23a2
[   41.867306] mmc0: sdhci-esdhc-imx: dma debug status:  0x2400
[   41.872966] mmc0: sdhci-esdhc-imx: adma debug status:  0x2500
[   41.878715] mmc0: sdhci-esdhc-imx: fifo debug status:  0x2680
[   41.884462] mmc0: sdhci-esdhc-imx: async fifo debug status:  0x2750
[   41.890730] mmc0: sdhci: ============================================
[   41.897418] morse_sdio mmc0:0001:2: sdio readl failed 4294967186
[   41.903468] morse_sdio mmc0:0001:2: morse_sdio_reg32_read failed 18446744073709551506
[   41.911332] morse_sdio mmc0:0001:2: morse read chip id failed: -5
[   41.917657] morse_sdio_probe failed. The driver has not been loaded!

Thanks for the correction on the sdhci-caps-mask property @tharvey.

In my case I’m disabling ADMA yet still getting ‘Timeout waiting for hardware Interrupt’ on some modules on my board

Just to clarify, does this mean you have other modules/boards which are working with the iMX8?

I ask because, as in post #18, I saw failures on the first CMD53 read in the init sequence (Argument: 0x149a4004, same as yours) which was caused by a poor supply of power to the module carrier board I was using (one of our own RPi hats). From memory, this is the first part of the init sequence where the data lines are driven by the MM6108.

If you have access to a logic analyzer, capturing a trace and finding the CMD53 read with argument 0x149a4004 might help give some hints as to what is going on.

@tharvey thanks for the suggestion! Using the device tree property as you suggested finally allowed me to use disable ADMA.

@ajudge Now I am getting the error below regarding a FW pointer manifest. Have you encountered this before?

root@ucm-imx8m-mini:~# dmesg | grep mmc1
[    1.523857] mmc1: CQHCI version 5.10
[    2.111694] mmc1: CQHCI version 5.10
[    2.131255] mmc1 bounce up to 128 segments into one, max segment size 65536 bytes
[    2.161751] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using DMA
[    2.247544] mmc1: new high speed SDIO card at address 0001
[    5.248085] morse_sdio mmc1:0001:1: sdio new func 1 vendor 0x325b device 0x306 block 0x8/0x8
[    5.249161] morse_sdio mmc1:0001:2: sdio new func 2 vendor 0x325b device 0x306 block 0x200/0x200
[    5.249309] morse_sdio mmc1:0001:2: Reading gpio pins configuration from device tree
[    5.260206] morse_sdio mmc1:0001:2: Loaded firmware from morse/mm6108.bin, size 433044, crc32 0x436ba524
[    5.260683] morse_sdio mmc1:0001:2: Loaded BCF from morse/bcf_default.bin, size 1077, crc32 0x1cbf23cb
[    6.865000] morse_sdio mmc1:0001:2: FW manifest pointer not set
[    8.487678] morse_sdio mmc1:0001:2: FW manifest pointer not set
[   10.121267] morse_sdio mmc1:0001:2: FW manifest pointer not set
[   10.127285] morse_sdio mmc1:0001:2: morse_firmware_init failed: -5
[   10.140535] morse_sdio: probe of mmc1:0001:2 failed with error -5

@SanderV this is typically seen when the version of the firmware or BCF binary does not match the version of the driver. Please make sure the sources are all from the same software release version.

If they are from the same version, can you share the sha256 hash of the firmware and bcf binary you are using on your device?
Or better still, attach the binaries here for inspection.

Hmm, no idea where that went wrong, but let’s hope it was a simple mistake.

See below the hash for both files and the files themselves are attached
Binaries.zip (216.6 KB)

root@ucm-imx8m-mini:/lib/firmware# sha256sum bcf_default.bin
b23bb5da82bf7a35335765894366c2954b4d33d8d9ff2616d6370b5395d27ee4  bcf_default.bin
root@ucm-imx8m-mini:/lib/firmware# sha256sum mm6108.bin
4ee1e64f39c100bf067748c5261c5502a22771b3ef2154abe20ffdc7a40cd4bf  mm6108.bin

This mm6108 binary looks like it’s from our 1.10.2 firmware. The bcf_default.bin you’re using looks to also be 1.10.2 for our mf08251 module.

An earlier log you provided shows the driver is 1.12.4
[43665.162614] morse micro driver registration. Version 0-rel_1_12_4_2024_Jun_11

1.12.4 binaries are available on GitHub. Try replace the mm6108.bin and bcf_mf08251.bin from these artefacts if you are still using 1.12.4.

That seems to have done the trick!

The driver now loads successfully, see below.

The next step would be to bring up an interface and connect it to an AP. How do you suggest we do that? Or perhaps you can point me to a resource on how to do that?

root@ucm-imx8m-mini:/opt/sdk/app# dmesg | grep morse
[    5.305864] morse micro driver registration. Version 0-rel_1_12_4_2024_Jun_11
[    5.311626] morse_sdio mmc1:0001:1: sdio new func 1 vendor 0x325b device 0x306 block 0x8/0x8
[    5.312730] morse_sdio mmc1:0001:2: sdio new func 2 vendor 0x325b device 0x306 block 0x200/0x200
[    5.312838] morse_sdio mmc1:0001:2: Reading gpio pins configuration from device tree
[    5.321038] morse_sdio mmc1:0001:2: Loaded firmware from morse/mm6108.bin, size 433044, crc32 0x436ba524
[    5.321677] morse_sdio mmc1:0001:2: Loaded BCF from morse/bcf_default.bin, size 907, crc32 0x4f55790f
[    5.917772] morse_sdio mmc1:0001:2: Driver loaded with kernel module parameters
[    5.917789] morse_sdio mmc1:0001:2:     enable_1mhz_probes                      : Y
[    5.917796] morse_sdio mmc1:0001:2:     enable_hw_scan                          : Y
[    5.917804] morse_sdio mmc1:0001:2:     enable_pv1                              : N
[    5.917808] morse_sdio mmc1:0001:2:     enable_page_slicing                     : N
[    5.917813] morse_sdio mmc1:0001:2:     log_modparams_on_boot                   : Y
[    5.917820] morse_sdio mmc1:0001:2:     enable_mcast_at_op_bw                   : N
[    5.917827] morse_sdio mmc1:0001:2:     enable_mcast_whitelist                  : Y
[    5.917838] morse_sdio mmc1:0001:2:     ocs_type                                : 1
[    5.917843] morse_sdio mmc1:0001:2:     enable_auto_mpsw                        : Y
[    5.917848] morse_sdio mmc1:0001:2:     duty_cycle_probe_retry_threshold        : 2500
[    5.917852] morse_sdio mmc1:0001:2:     duty_cycle_mode                         : 0
[    5.917856] morse_sdio mmc1:0001:2:     enable_auto_duty_cycle                  : Y
[    5.917862] morse_sdio mmc1:0001:2:     dhcpc_lease_update_script               : /morse/scripts/dhcpc_update.sh
[    5.917865] morse_sdio mmc1:0001:2:     enable_ibss_probe_filtering             : Y
[    5.917870] morse_sdio mmc1:0001:2:     enable_dhcpc_offload                    : N
[    5.917874] morse_sdio mmc1:0001:2:     enable_arp_offload                      : N
[    5.917878] morse_sdio mmc1:0001:2:     enable_bcn_change_seq_monitor           : 0
[    5.917882] morse_sdio mmc1:0001:2:     enable_cac                              : 0
[    5.917885] morse_sdio mmc1:0001:2:     max_mc_frames                           : 10
[    5.917890] morse_sdio mmc1:0001:2:     tx_max_power_mbm                        : 2200
[    5.917894] morse_sdio mmc1:0001:2:     enable_twt                              : Y
[    5.917898] morse_sdio mmc1:0001:2:     enable_mac80211_connection_monitor      : N
[    5.917902] morse_sdio mmc1:0001:2:     enable_airtime_fairness                 : N
[    5.917906] morse_sdio mmc1:0001:2:     enable_raw                              : Y
[    5.917910] morse_sdio mmc1:0001:2:     max_aggregation_count                   : 0
[    5.917914] morse_sdio mmc1:0001:2:     max_rate_tries                          : 1
[    5.917918] morse_sdio mmc1:0001:2:     max_rates                               : 3
[    5.917922] morse_sdio mmc1:0001:2:     enable_watchdog_reset                   : N
[    5.917926] morse_sdio mmc1:0001:2:     watchdog_interval_secs                  : 30
[    5.917930] morse_sdio mmc1:0001:2:     enable_watchdog                         : Y
[    5.917934] morse_sdio mmc1:0001:2:     country                                 : US
[    5.917938] morse_sdio mmc1:0001:2:     enable_cts_to_self                      : N
[    5.917942] morse_sdio mmc1:0001:2:     enable_rts_8mhz                         : N
[    5.917945] morse_sdio mmc1:0001:2:     enable_trav_pilot                       : Y
[    5.917949] morse_sdio mmc1:0001:2:     enable_sgi_rc                           : Y
[    5.917953] morse_sdio mmc1:0001:2:     enable_mbssid_ie                        : N
[    5.917957] morse_sdio mmc1:0001:2:     virtual_sta_max                         : 0
[    5.917961] morse_sdio mmc1:0001:2:     thin_lmac                               : 0
[    5.917965] morse_sdio mmc1:0001:2:     enable_dynamic_ps_offload               : Y
[    5.917969] morse_sdio mmc1:0001:2:     enable_ps                               : 2
[    5.917972] morse_sdio mmc1:0001:2:     enable_subbands                         : 2
[    5.917976] morse_sdio mmc1:0001:2:     enable_survey                           : Y
[    5.917980] morse_sdio mmc1:0001:2:     mcs10_mode                              : 0
[    5.917984] morse_sdio mmc1:0001:2:     mcs_mask                                : 1023
[    5.917988] morse_sdio mmc1:0001:2:     no_hwcrypt                              : 0
[    5.917992] morse_sdio mmc1:0001:2:     enable_ext_xtal_init                    : N
[    5.917996] morse_sdio mmc1:0001:2:     enable_otp_check                        : 1
[    5.918000] morse_sdio mmc1:0001:2:     bcf                                     :
[    5.918004] morse_sdio mmc1:0001:2:     serial                                  : default
[    5.918008] morse_sdio mmc1:0001:2:     debug_mask                              : 8
[    5.918013] morse_sdio mmc1:0001:2:     tx_status_lifetime_ms                   : 15000
[    5.918017] morse_sdio mmc1:0001:2:     tx_queued_lifetime_ms                   : 1000
[    5.918021] morse_sdio mmc1:0001:2:     max_txq_len                             : 32
[    5.918025] morse_sdio mmc1:0001:2:     default_cmd_timeout_ms                  : 600
[    5.918029] morse_sdio mmc1:0001:2:     enable_short_bcn_as_dtim_override       : -1
[    5.918034] morse_sdio mmc1:0001:2:     fw_bin_file                             :
[    5.918038] morse_sdio mmc1:0001:2:     sdio_reset_time                         : 400
[    5.918042] morse_sdio mmc1:0001:2:     macaddr_suffix                          : 00:00:00
[    5.918046] morse_sdio mmc1:0001:2:     macaddr_octet                           : 255
[    5.918050] morse_sdio mmc1:0001:2:     max_total_vendor_ie_bytes               : 514
[    5.918055] morse_sdio mmc1:0001:2:     coredump_include                        : 1
[    5.918059] morse_sdio mmc1:0001:2:     coredump_method                         : 1
[    5.918063] morse_sdio mmc1:0001:2:     enable_coredump                         : Y
[    5.918067] morse_sdio mmc1:0001:2:     sdio_clk_debugfs                        :
[    5.918071] morse_sdio mmc1:0001:2:     enable_mm_vendor_ie                     : Y
[    5.918468] morse_io: Device node '/dev/morse_io' created successfully

Thanks for all of your support!

1 Like

This is great to see @SanderV .

We’re currently in the process of migrating our documentation to something more accessible. But if you have access to the Morse Micro support portal I recommend reading the Linux porting guide - available here: https://www.morsemicro.com/download/mm-appnote-24-linux-porting-guide/

This has information for running hostapd_s1g and wpa_supplicant_s1g. The opensource repository containing source for both applications can be found at GitHub - MorseMicro/hostap

2 Likes

Thanks @ajudge !

So I have cross-compiled the binaries according to the porting guide and transferred them to the iMX8. Everything seems to have gone okay, but I am not yet able to connect to the AP.

I am using the AP by AsiaRF. The US version.

Let me post some results below.

root@ucm-imx8m-mini:/etc/wpa_supplicant_s1g# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 92  bytes 7838 (7.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 92  bytes 7838 (7.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:0a:52:0a:c8:21  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Trying to connect to the AP

root@ucm-imx8m-mini:~# wpa_supplicant_s1g -t -D nl80211 -s -i wlan0 -c /etc/wpa_supplicant_s1g/wpa_supplicant-wlan0.conf -B
        Long Sleep Mode: disabled
root@ucm-imx8m-mini:~# [  220.512518] wlan0: authenticate with 00:0a:52:0a:db:5f
[  220.804716] wlan0: send auth to 00:0a:52:0a:db:5f (try 1/3)
[  222.845622] wlan0: send auth to 00:0a:52:0a:db:5f (try 2/3)
[  224.861618] wlan0: send auth to 00:0a:52:0a:db:5f (try 3/3)
[  225.813588] wlan0: aborting authentication with 00:0a:52:0a:db:5f by local choice (Reason: 3=DEAUTH_LEAVING)
[  248.721804] wlan0: authenticate with 00:0a:52:0a:db:5f
[  249.024303] wlan0: send auth to 00:0a:52:0a:db:5f (try 1/3)
[  251.037623] wlan0: send auth to 00:0a:52:0a:db:5f (try 2/3)
[  253.053619] wlan0: send auth to 00:0a:52:0a:db:5f (try 3/3)
[  254.031018] wlan0: aborting authentication with 00:0a:52:0a:db:5f by local choice (Reason: 3=DEAUTH_LEAVING)

For hostapd I do get an error, because our Yocto build does not contain a certain library. I only intend to use this device as a client so that is not a problem for now

root@ucm-imx8m-mini:/etc/wpa_supplicant_s1g# hostapd_s1g -t -B -s hostapd.conf
hostapd_s1g: error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory

Contents of wpa_supplicant-wlan0.conf

country=US
ctrl_interface=/var/run/wpa_supplicant_s1g

pmf=2
sae_pwe=1

network={
        scan_ssid=1
        ssid="MM_AsiaRF-AAEC"
        key_mgmt=SAE
        psk="12345678"
        pairwise=CCMP

}

Let me know if there are other commands you would like to see. I might be missing something obvious here

Usually you will see this sequence of supplicant logs when your device has failed to authenticate with the AP.

[  220.804716] wlan0: send auth to 00:0a:52:0a:db:5f (try 1/3)
[  222.845622] wlan0: send auth to 00:0a:52:0a:db:5f (try 2/3)
[  224.861618] wlan0: send auth to 00:0a:52:0a:db:5f (try 3/3)
[  225.813588] wlan0: aborting authentication with 00:0a:52:0a:db:5f by local choice (Reason: 3=DEAUTH_LEAVING)

This could be caused by a mismatch in configuration between the AP and station (I often forget the sae_pwe setting, which you do have).

I would have expected wpa_supplicant to not start, but without a libcrypto on the device, wpa_supplicant won’t be able to complete authentication. If possible, try to build openssl for your target and install it onto the device. This site has some helpful information for that. Adjust your architecture and toolchain as required: https://wiki.beyondlogic.org/index.php?title=Cross_Compiling_iw_wpa_supplicant_hostapd_rfkill_for_ARM#OpenSSL

It might be helpful to run wpa_supplicant with a higher output verbosity. Can you add -d or -dd to the command line?

Alright I have been able to cross-compile the required files and added them to my device. However, hostapd now throws the error below. I understand it is not recommended to cross-compile GLIBC, so I have asked a developer to help me upgrade it in our Yocto build.

root@ucm-imx8m-mini:/opt/sdk# hostapd_s1g -t -B -s hostapd.conf
hostapd_s1g: /lib/libc.so.6: version `GLIBC_2.34' not found (required by hostapd_s1g)

The -d or -dd tags do not give any additional information

It might take a few days for the new Yocto build to be ready. The current build runs GLIBC_2.33.

Is this behaviour that you expect from wpa_supplicant? Any other suggestions for me to try?

Thanks!

You should be able to “cross compile” hostap by creating a metalayer in Yocto which would link it to the correct glibc, and use the porting guide for instructions on how to run wpa_supplicant only. One of our community members did this previously for the Raspberry Pi 4, and I leveraged that work to build a Yocto layer for wpa_supplicant and hostap for the iMX6 target I was using for the rest of this thread.

See meta-morse/recipes-morse/morse-hostap/morse-hostap.bb at main · LOflynn/meta-morse · GitHub for the community made Raspberry Pi 4 one.

And here’s the bitbake files I was using for the Variscite iMX6 board, based on those above. If I find the time I’ll clean up the metalayer I was using and host it somewhere appropriate.

This has the added benefit that it should resolve dependencies rather trivially if you build the whole image.

morse-wpa-supplicant.bb (809 Bytes)
morse-hostap.bb (805 Bytes)

@SanderV another thing to check, please make sure your kernel has the following options enabled

CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
1 Like