Custom kernel and rootfs build on db410c. Loading Wifi module

Hey guys,

I’m trying to do a custom Linux build for the 410c. I follow instructions on the board support page to build a kernel, extract device tree and create boot image. Everything is ok, I flash boot image and download developer version of rootfs from support page.
When I boot a board all the modules are loaded correctly and i can see wlan0.

But if I make a custom rootfs using Buildroot, then I can see that wcn36xx module is loaded, but I do not have a wlan0 interface. Last message in dmesg is
[ 78.706968] wcn36xx: mac address: XX:XX:XX:XX

If I modprobe wcn36xx -r and then load it back, then I get the same result. If I do the same thing with working rootfs, then I can see that driver is continuing to load a firmware.

Is there extra step that I have to do after module is loaded?
I know that there is a wcnss-start script, that writes start to /sys/kernel/remoreprec … /state. If I try to do it manually then I get a permissions error. Do I have to do this step?

I forgot to tell that I have copied firmware and modules folders from working rootfs to custom rootfs. This includes firmware/wfi folder and wcnss.mdt and other files

I will copy output from dmesg tomorrow if it is required

please include dmesg output, and also the output of “ip link” command.

[ 11.453390] sp : ffff800036647ae0
[ 11.453396] x29: ffff800036647ae0 x28: ffff800035c4ce20
[ 11.453401] x27: 00000000024000c0 x26: 0000000000000124
[ 11.453407] x25: ffff000008132710 x24: ffff000000b70680
[ 11.453412] x23: 0000000000000030 x22: 00000000fffffffe
[ 11.453418] x21: ffff000000b70028 x20: ffff000009121000
[ 11.453423] x19: ffff8000367b3810 x18: 0000000000000001
[ 11.453428] x17: 0000ffffa6eb8fd8 x16: ffff00000822e5c8
[ 11.453434] x15: 0000000000000008 x14: ffff000008e1e000
[ 11.453439] x13: 00000000000122a3 x12: 000000000000022c
[ 11.453444] x11: ffff000008a407f0 x10: ffff8000355fb400
[ 11.453449] x9 : ffff8000355fb400 x8 : ffff800037f44ae0
[ 11.453455] x7 : 0000000000895440 x6 : ffff8000355fb800
[ 11.453460] x5 : ffff800037f44ae0 x4 : ffff80000eb35b00
[ 11.453466] x3 : 0000000000000002 x2 : ffff80003524bf38
[ 11.453471] x1 : 0000000000000000 x0 : ffff80003524bfa8

[ 11.453475] —[ end trace 4be4cb3ac08d5c3b ]—
[ 11.453477] Call trace:
[ 11.453482] Exception stack(0xffff800036647910 to 0xffff800036647a40)
[ 11.453487] 7900: ffff8000367b3810 0001000000000000
[ 11.453493] 7920: ffff800036647ae0 ffff0000080961f8 ffff800037f44a80 ffff0000080e26ac
[ 11.453498] 7940: ffff800036647960 ffff0000080e26d4 ffff800035488d00 ffff800037f44a80
[ 11.453504] 7960: ffff800036647990 ffff0000080e40c0 ffff800035488d00 ffff800035489434
[ 11.453510] 7980: ffff800036647990 ffff0000080e40e4 ffff8000366479f0 ffff0000080e4224
[ 11.453516] 79a0: ffff800037f49100 0000000000000013 ffff80003524bfa8 0000000000000000
[ 11.453522] 79c0: ffff80003524bf38 0000000000000002 ffff80000eb35b00 ffff800037f44ae0
[ 11.453528] 79e0: ffff8000355fb800 0000000000895440 ffff800037f44ae0 ffff8000355fb400
[ 11.453534] 7a00: ffff8000355fb400 ffff000008a407f0 000000000000022c 00000000000122a3
[ 11.453539] 7a20: ffff000008e1e000 0000000000000008 ffff00000822e5c8 0000ffffa6eb8fd8
[ 11.453545] [] arch_teardown_dma_ops+0x28/0x48
[ 11.453552] [] of_dma_deconfigure+0xc/0x18
[ 11.453558] [] dma_deconfigure+0xc/0x18
[ 11.453565] [] driver_probe_device+0x330/0x438
[ 11.453571] [] __driver_attach+0xcc/0x118
[ 11.453576] [] bus_for_each_dev+0x4c/0x98
[ 11.453582] [] driver_attach+0x20/0x28
[ 11.453587] [] bus_add_driver+0x1f4/0x290
[ 11.453593] [] driver_register+0x60/0xf8
[ 11.453600] [] __platform_driver_register+0x40/0x48
[ 11.453634] [] qcom_venus_driver_init+0x14/0x1000 [venus_core]
[ 11.453642] [] do_one_initcall+0x38/0x128
[ 11.453648] [] do_init_module+0x5c/0x1b0
[ 11.453655] [] load_module+0x1d28/0x2270
[ 11.453661] [] SyS_finit_module+0xd0/0xe8
[ 11.453666] [] __sys_trace_return+0x0/0x4
[ 11.455678] qcom-venus: probe of 1d00000.video-codec failed with error -2
[ 11.492857] a204000.wcnss supply vddcx not found, using dummy regulator
[ 11.498004] remoteproc remoteproc1: a204000.wcnss is available
[ 11.508559] systemd-journald[1497]: File /var/log/journal/8b97811dd17d41c7beb57822a6b9310f/user-1005.journal corrupted or uncleanly shut down, renaming and replacing.
[ 11.528599] remoteproc remoteproc1: powering up a204000.wcnss
[ 11.528608] remoteproc remoteproc1: Booting fw image wcnss.mdt, size 7260
[ 12.003497] remoteproc remoteproc1: remote processor a204000.wcnss is now up
[ 12.124869] qcom_wcnss_ctrl remoteproc1:smd-edge.WCNSS_CTRL.-1.-1: WCNSS Version 1.5 1.2
[ 12.731381] systemd-journald[1497]: File /var/log/journal/8b97811dd17d41c7beb57822a6b9310f/user-1006.journal corrupted or uncleanly shut down, renaming and replacing.
[ 13.788079] Bluetooth: Core ver 2.22
[ 13.788284] NET: Registered protocol family 31
[ 13.792185] Bluetooth: HCI device and connection manager initialized
[ 13.795674] Bluetooth: HCI socket layer initialized
[ 13.802223] Bluetooth: L2CAP socket layer initialized
[ 13.802318] Bluetooth: SCO socket layer initialized
[ 13.817214] wcn36xx: mac address: 02:00:a5:c9:2e:48

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 02:00:a5:c9:2e:48 brd ff:ff:ff:ff:ff:ff

Now i fell stupid after posting this. ifconfig wlan0 up does a trick.

Do I have to add a something to systemd to do it automatically?

yes, you are right, everything was just fine :wink:

for systemd you can have a look at systemd-networkd it can be used to managed your connections at boot. we use network-manager in our images, which does that too, maybe you can add it, or there is connman which would work equally well.

Create a .network file (e.g. wlan0.network) in /etc/systemd/network/ with the following content:

[Match]
Name=wlan0
[Network]
DHCP=yes

The create a file named /etc/wpa_supplicant/wpa_supplicant-wlan0.conf with the content:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
    ssid="your-wifi-ssid"
    psk=<output from wpa_passphrase>
}

Then systemctl enable and start wpa_supplicant@wlan0 and systemd-networkd. wpa_supplicant will bring up the interface and join the network, systemd-networkd will pick this up and give you an IP address.

1 Like