How to compile stuff (in my case Wifi module) on the VF2?

Hi guys,

Is there a guide on how to set up a compile environment inside the VF2 ?

I dont want to crosscompile.

I know there is the image coming with the USB Wifi driver but i want to learn kernel anyway so my first task is to compile the ESWIN 6600U module for the board.

Now my last kernel i compiled was like 10 years ago and it was on x64 so way easier.

Now i got like to this point with the help of mzs:

make -C /lib/modules/5.15.0-starfive/build O=/lib/modules/5.15.0-starfive/build M=/home/user/eswin_6600u modules
make[1]: Entering directory ‘/usr/src/linux-headers-5.15.0-starfive’
make[2]: Nothing to be done for ‘include/generated/vdso-offsets.h’.
warning: the compiler differs from the one used to build the kernel
The kernel was built by: riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0
You are using: gcc (Debian 10.2.1-6) 10.2.1 20210110
CC [M] /home/user/eswin_6600u/ecrnx_msg_tx.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[2]: *** [scripts/Makefile.build:277: /home/user/eswin_6600u/ecrnx_msg_tx.o] Error 126
make[2]: *** Deleting file ‘/home/user/eswin_6600u/ecrnx_msg_tx.o’
make[1]: *** [Makefile:1868: /home/user/eswin_6600u] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-5.15.0-starfive’
make: *** [Makefile:145: modules] Error 2

I already installed the riscv version of gcc in the same version as the kernel was compiled with but im at a loss here.

Some of you managed to compile the module on the VF2.

Could you write a short gnereic guide on how to compile it on the board ?

This could also be used as a general compile guide i guess not just for kernel modules.

Thanks a lot!

Hello Manux,

you have to re compile the linux kernel again, then you can re- complie the ESWIN.
Or do you use my kerenl which is already cross compiled.

  1. git clone GitHub - starfive-tech/linux
  2. cd linux
  3. touch .scmversion
  4. git checkout --track origin/JH7110_VisionFive2_devel
  5. vi Makefile
VERSION = 5
PATCHLEVEL = 15
SUBLEVEL = 0
EXTRAVERSION = -starfive
NAME = Trick or Treat
  1. git pull
  2. sudo apt install flex
  3. sudo apt install bison
  4. sudo apt install bc
  5. make starfive_visionfive2_defconfig
  6. make -j3

Then go to:

  1. cd /home/user/eswin_6600u

make KERNELDIR=/<path to linux from step 1>/linux/ KBUILDDIR=/<path to linux from step 1>/linux/ product=6600u

Makefile:142: "select chip is 6600u."
Makefile:144: "select slave is used CEVA RTOS."
rm -rf *.ko
make -C /home/damian/data/linux/ O=/home/damian/data/linux/ M=/home/damian/data/eswin_6600u modules
make[1]: Entering directory '/home/damian/data/linux'
  CC      arch/riscv/kernel/vdso/vgettimeofday.o
  VDSOLD  arch/riscv/kernel/vdso/vdso.so.dbg
  VDSOSYM include/generated/vdso-offsets.h
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_msg_tx.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_msg_rx.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_utils.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_cmds.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_cfgfile.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_strs.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_txq.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_mod_params.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_platform.o
  CC [M]  /home/damian/data/eswin_6600u/ipc_host.o
  CC [M]  /home/damian/data/eswin_6600u/hal_desc.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_iwpriv.o
  CC [M]  /home/damian/data/eswin_6600u/fw_head_check.o
  CC [M]  /home/damian/data/eswin_6600u/slave_log_buf.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_tdls.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_mesh.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_main.o
/home/damian/data/eswin_6600u/fullmac/ecrnx_main.c: In function 'ecrnx_cfg80211_tdls_mgmt':
/home/damian/data/eswin_6600u/fullmac/ecrnx_main.c:3200:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
 3200 |         if ((status_code == 0) &&
      |            ^
/home/damian/data/eswin_6600u/fullmac/ecrnx_main.c:3207:5: note: here
 3207 |     case WLAN_TDLS_SETUP_REQUEST:
      |     ^~~~
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_rx.o
/home/damian/data/eswin_6600u/fullmac/ecrnx_rx.c: In function 'ecrnx_rx_reord_sta_init':
/home/damian/data/eswin_6600u/fullmac/ecrnx_rx.c:1369:83: warning: expression does not compute the number of elements in this array; element type is 'short int', not 'int' [-Wsizeof-array-div]
 1369 |             memset(&reord_cntrl->skip_sn, 0xffffffff, sizeof(reord_cntrl->skip_sn)/sizeof(int));
      |                                                                                   ^
/home/damian/data/eswin_6600u/fullmac/ecrnx_rx.c:1369:83: note: add parentheses around the second 'sizeof' to silence this warning
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_tx.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_calibration_data.o
  CC [M]  /home/damian/data/eswin_6600u/usb/usb.o
  CC [M]  /home/damian/data/eswin_6600u/usb/ecrnx_usb.o
  CC [M]  /home/damian/data/eswin_6600u/usb/core.o
  CC [M]  /home/damian/data/eswin_6600u/usb/fw.o
  CC [M]  /home/damian/data/eswin_6600u/eswin_port/eswin_utils.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_amt.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_radar.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_debugfs.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_fw_dump.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_fw_trace.o
  CC [M]  /home/damian/data/eswin_6600u/ecrnx_debug.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_p2p.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_debugfs_func.o
  CC [M]  /home/damian/data/eswin_6600u/fullmac/ecrnx_debugfs_custom.o
  LD [M]  /home/damian/data/eswin_6600u/wlan_ecr6600u_usb.o
  MODPOST /home/damian/data/eswin_6600u/Module.symvers
  CC [M]  /home/damian/data/eswin_6600u/wlan_ecr6600u_usb.mod.o
  LD [M]  /home/damian/data/eswin_6600u/wlan_ecr6600u_usb.ko
  1. Install module and firmware

wlan_ecr6600u_usb.ko

Regards
Damian

2 Likes

Thank you! Will try this.

However i was under the impression that installed kernel-headers are enough to build modules ?

Thanks again!

Yes correct. But on the visionfive 2 debian image some files missing. Under the folder /lib/modules/5.15.0-starfive/build the folder is incomplete some files are missing.

The build will fail. That is the reason for the whole Step 1.

Best regards
Damian

2 Likes

Hello @Manux,

above my detail Installation with log from build wifi driver

Thanks i got the kernel compiled and noticed that the wifi driver was already in there
so i did a
make modules_install
and the modules got copied to /lib/modules.
Then i modprobed the wifi module

This resulted in RAM errors in dmesg and after a reboote the board did not boot up again.

So now im doing it all over and this time i will not do the module_install

I think this soft bricked the board somehow.

Will let you know how it goes when i follow your instructions exactly.

Best
Manux

Ok i redid the whole thing with the stock kernel

now the module does build but can not be loaded:

root@starfive:/home/user/eswin_6600u# insmod wlan_ecr6600u_usb.ko
insmod: ERROR: could not insert module wlan_ecr6600u_usb.ko: Invalid module format

root@starfive:/home/user/eswin_6600u# modprobe wlan_ecr6600u_usb
modprobe: ERROR: could not insert ‘wlan_ecr6600u_usb’: Exec format error

Any ideas ?
Thanks!

Hello Manux,

what is the output in dmesg and you copied the firmware to /lib/firmware ?

if you type “file wlan_ecr6600u_usb.ko” or “readelf -h wlan_ecr6600u_usb.ko” what does it say ?

There is no additional output in dmesg when i try to load the module.
Yes firmware bin file is copied.

Hi mzs,

Thanks for your help!

Here is the output:

root@starfive:/home/user/linux# readelf -h drivers/net/wireless/eswin/wlan_ecr6600u_usb.ko
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2’s complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: RISC-V
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 591208 (bytes into file)
Flags: 0x1, RVC, soft-float ABI
Size of this header: 64 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 64 (bytes)
Number of section headers: 38
Section header string table index: 37
root@starfive:/home/user/linux# file drivers/net/wireless/eswin/wlan_ecr6600u_usb.ko
drivers/net/wireless/eswin/wlan_ecr6600u_usb.ko: ELF 64-bit LSB relocatable, UCB RISC-V, RVC, soft-float ABI, version 1 (SYSV), BuildID[sha1]=e70a5f115a8cbf5a28e340b143f1da3e0caaddc1, not stripped

Damian, is this binary “wlan_ecr6600u_usb.ko” anywhere online to be downloaded? I have the firmware already.

Thx

Aubrey

Hi Daminan,
I managed to load the module with insmod.

This is the dmesg output:

[46247.462047] wlan_ecr6600u_usb: loading out-of-tree module taints kernel.
[46247.667933] [ecrnx] ecrnx_mod_init() enter, line:4476
[46247.672995] wlan_ecr6600u_usb-ECR6600U_V1.1.0B03P06-build:2023-01-14 11:41:19 CST
[46247.896430] [ecrnx] eswin_core_create exit!!
[46247.897480] [ecrnx] eswin_core_register entry!!
[46247.902131] usbcore: registered new interface driver eswin_usb
[46247.918976] [ecrnx] eswin_core_register_work entry, dl_fw = 1!!
[46247.919019] [ecrnx] eswin_fw_file_chech,kernel fw download, Checking firmware… (ECR6600U_transport.bin)
[46247.944404] [ecrnx] eswin_fw_file_chech, request fw OK and size is 146952
[46247.951244] [ecrnx] fw_check_head,firmware build time: 2022-12-02 02:50:36
[46247.958163] [ecrnx] fw_check_head,firmware information: (ECR6600U_V1.1.0B05P02)
[46247.965478] [ecrnx] eswin_core_register_work entry, start fw download!!
[46247.966325] [ecrnx] dl-fw >> sync, ret: 0
[46247.977354] [ecrnx] dl-fw >> sync, ret: 0
[46247.981955] [ecrnx] firmware downloading 1%
[46247.986498] [ecrnx] firmware downloading 2%
[46247.990999] [ecrnx] firmware downloading 3%
[46247.995499] [ecrnx] firmware downloading 4%
[46248.000009] [ecrnx] firmware downloading 5%
[46248.004502] [ecrnx] firmware downloading 6%
[46248.009010] [ecrnx] firmware downloading 7%
[46248.013423] [ecrnx] firmware downloading 8%
[46248.017944] [ecrnx] firmware downloading 9%
[46248.022444] [ecrnx] firmware downloading 10%
[46248.027047] [ecrnx] firmware downloading 11%
[46248.031629] [ecrnx] firmware downloading 12%
[46248.036210] [ecrnx] firmware downloading 13%
[46248.040821] [ecrnx] firmware downloading 14%
[46248.045411] [ecrnx] firmware downloading 15%
[46248.049928] [ecrnx] firmware downloading 16%
[46248.054508] [ecrnx] firmware downloading 17%
[46248.059117] [ecrnx] firmware downloading 18%
[46248.063711] [ecrnx] firmware downloading 19%
[46248.068305] [ecrnx] firmware downloading 20%
[46248.072918] [ecrnx] firmware downloading 21%
[46248.077509] [ecrnx] firmware downloading 22%
[46248.082009] [ecrnx] firmware downloading 23%
[46248.086620] [ecrnx] firmware downloading 24%
[46248.091213] [ecrnx] firmware downloading 25%
[46248.095810] [ecrnx] firmware downloading 26%
[46248.100398] [ecrnx] firmware downloading 27%
[46248.104998] [ecrnx] firmware downloading 28%
[46248.109592] [ecrnx] firmware downloading 29%
[46248.114180] [ecrnx] firmware downloading 30%
[46248.118693] [ecrnx] firmware downloading 31%
[46248.123274] [ecrnx] firmware downloading 32%
[46248.127887] [ecrnx] firmware downloading 33%
[46248.132469] [ecrnx] firmware downloading 34%
[46248.137061] [ecrnx] firmware downloading 35%
[46248.141641] [ecrnx] firmware downloading 36%
[46248.146221] [ecrnx] firmware downloading 37%
[46248.150813] [ecrnx] firmware downloading 38%
[46248.155311] [ecrnx] firmware downloading 39%
[46248.159904] [ecrnx] firmware downloading 40%
[46248.164503] [ecrnx] firmware downloading 41%
[46248.169098] [ecrnx] firmware downloading 42%
[46248.173686] [ecrnx] firmware downloading 43%
[46248.178280] [ecrnx] firmware downloading 44%
[46248.182896] [ecrnx] firmware downloading 45%
[46248.187425] [ecrnx] firmware downloading 46%
[46248.192018] [ecrnx] firmware downloading 47%
[46248.196605] [ecrnx] firmware downloading 48%
[46248.201191] [ecrnx] firmware downloading 49%
[46248.205785] [ecrnx] firmware downloading 50%
[46248.210382] [ecrnx] firmware downloading 51%
[46248.214975] [ecrnx] firmware downloading 52%
[46248.219568] [ecrnx] firmware downloading 53%
[46248.224068] [ecrnx] firmware downloading 54%
[46248.228691] [ecrnx] firmware downloading 55%
[46248.233274] [ecrnx] firmware downloading 56%
[46248.237885] [ecrnx] firmware downloading 57%
[46248.242478] [ecrnx] firmware downloading 58%
[46248.247091] [ecrnx] firmware downloading 59%
[46248.251681] [ecrnx] firmware downloading 60%
[46248.256312] [ecrnx] firmware downloading 61%
[46248.260820] [ecrnx] firmware downloading 62%
[46248.265402] [ecrnx] firmware downloading 63%
[46248.270013] [ecrnx] firmware downloading 64%
[46248.274606] [ecrnx] firmware downloading 65%
[46248.279200] [ecrnx] firmware downloading 66%
[46248.283779] [ecrnx] firmware downloading 67%
[46248.288390] [ecrnx] firmware downloading 68%
[46248.292909] [ecrnx] firmware downloading 69%
[46248.297516] [ecrnx] firmware downloading 70%
[46248.302109] [ecrnx] firmware downloading 71%
[46248.306703] [ecrnx] firmware downloading 72%
[46248.311282] [ecrnx] firmware downloading 73%
[46248.315877] [ecrnx] firmware downloading 74%
[46248.320473] [ecrnx] firmware downloading 75%
[46248.325063] [ecrnx] firmware downloading 76%
[46248.329578] [ecrnx] firmware downloading 77%
[46248.334159] [ecrnx] firmware downloading 78%
[46248.338770] [ecrnx] firmware downloading 79%
[46248.343363] [ecrnx] firmware downloading 80%
[46248.347957] [ecrnx] firmware downloading 81%
[46248.352536] [ecrnx] firmware downloading 82%
[46248.357147] [ecrnx] firmware downloading 83%
[46248.361740] [ecrnx] firmware downloading 84%
[46248.366254] [ecrnx] firmware downloading 85%
[46248.370833] [ecrnx] firmware downloading 86%
[46248.375413] [ecrnx] firmware downloading 87%
[46248.380024] [ecrnx] firmware downloading 88%
[46248.385085] [ecrnx] firmware downloading 89%
[46248.389598] [ecrnx] firmware downloading 90%
[46248.394178] [ecrnx] firmware downloading 91%
[46248.398776] [ecrnx] firmware downloading 92%
[46248.403369] [ecrnx] firmware downloading 93%
[46248.407961] [ecrnx] firmware downloading 94%
[46248.412542] [ecrnx] firmware downloading 95%
[46248.417152] [ecrnx] firmware downloading 96%
[46248.421752] [ecrnx] firmware downloading 97%
[46248.426358] [ecrnx] firmware downloading 98%
[46248.430949] [ecrnx] firmware downloading 99%
[46248.435994] [ecrnx] firmware downloading 100%
[46248.440560] [ecrnx] fimeware download successfully!
[46248.445561] [ecrnx] eswin_core_register_work entry, finish and stop fw download!!
[46249.506281] [ecrnx] eswin_core_register_work entry, dl_fw = 0!!
[46249.513837] [ecrnx] eswin_core_register_work entry, amt_mode = 0!!
[46249.520882] [ecrnx] ecrnx_cfg80211_init() enter, line:4185
[46249.533043] [ecrnx] parse amt.cfg delta gain fail
[46249.537866] [ecrnx] parse amt.cfg cfo fail
[46249.542038] [ecrnx] parse amt.cfg mac fail
[46249.546383] [ecrnx] MAC Address is:00:00:00:00:00:00
[46249.551412] [ecrnx] host driver log ecrnx_printk_mask is:0x10800f
[46249.557733] [ecrnx] ECRNX_PRINTK_MASK_ERR is set;
[46249.562600] [ecrnx] ECRNX_PRINTK_MASK_WARN is set;
[46249.567530] [ecrnx] ECRNX_PRINTK_MASK_INIT is set;
[46249.572435] [ecrnx] ECRNX_PRINTK_MASK_EXIT is set;
[46249.577328] [ecrnx] ECRNX_PRINTK_MASK_CFG80211 is set;
[46249.582554] [ecrnx] ECRNX_PRINTK_MASK_FW_DOWNLOAD is set;
[46249.588052] [ecrnx] firmware log level is:2
[46249.592321] [ecrnx] firmware log level type:0 (print to chip’s uart)
[46249.598797] [ecrnx] ecrnx_ipc_init() enter, line:385
[46249.603794] [ecrnx] ecrnx_usb_init() enter, line:413
[46249.609284] [ecrnx] ecrnx_set_vers() enter, line:4097
[46249.614341] ieee80211 phy0: PHY features: [NSS=1][CHBW=40][VHT][HE][BFMEE][MUMIMORX]
[46249.622100] ieee80211 phy0: FW features: [BCN][AUTOBCN][HWSCAN][CMON][MROLE][AMPDU][CHNL_CTXT][REORD][P2P][P2P_GO][UMAC][HE][BFMEE][MFP][MU_MIMO_RX]
[46249.635420] ieee80211 phy0: HT supp 1, VHT supp 0, HE supp 1
[46249.650786] ieee80211 phy0: New interface create p2p0
[46249.656040] [ecrnx] eswin_core_register_work exit!!
[46249.666122] eswin_usb 1-1.1:1.0 wlx2e0547a1187d: renamed from p2p0
[46249.730520] eswin_usb 1-1.1:1.0 wlx2c0547a1187d: renamed from wlan0
[46249.852637] [ecrnx] ecrnx_cfg80211_set_power_mgmt() enter, line:2526
[46249.867546] [ecrnx] ecrnx_close() enter, line:868
[46249.872272] eswin_usb 1-1.1:1.0 wlx2e0547a1187d: CLOSE
[46249.932862] ieee80211 phy0: HT supp 1, VHT supp 0, HE supp 1
[46249.959609] [ecrnx] ecrnx_cfg80211_set_power_mgmt() enter, line:2526
[46249.977229] [ecrnx] ecrnx_open: Status Error(1)
[46249.994765] [ecrnx] ecrnx_open: Status Error(1)
[46250.171883] [ecrnx] ecrnx_open: Status Error(1)
[46250.179527] [ecrnx] ecrnx_open: Status Error(1)
[46250.203365] [ecrnx] ecrnx_cfg80211_scan() enter, line:1466
[46250.208915] [ecrnx] ecrnx_cfg80211_scan:scan_request:0x000000002eb2376a
[46250.215813] [ecrnx] send finish:ecrnx_cfg80211_scan
[46250.221350] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:201
[46250.230158] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3267, name: rx_comp
[46250.238212] CPU: 0 PID: 3267 Comm: rx_comp Tainted: G O 5.15.0-starfive #1
[46250.246502] Hardware name: StarFive VisionFive V2 (DT)
[46250.251649] Call Trace:
[46250.254102] [] dump_backtrace+0x1c/0x24
[46250.259517] [] dump_stack_lvl+0x40/0x58
[46250.264927] [] dump_stack+0x14/0x1c
[46250.269987] [] ___might_sleep+0xde/0xee
[46250.275398] [] __might_sleep+0x42/0x6c
[46250.280720] [] kmem_cache_alloc+0x96/0x188
[46250.286393] [] ecrnx_rx_scanu_result_ind+0xde/0x3e0 [wlan_ecr6600u_usb]
[46250.295061] [] cmd_mgr_msgind+0xfc/0x14e [wlan_ecr6600u_usb]
[46250.302758] [] ecrnx_rx_handle_msg+0x74/0x104 [wlan_ecr6600u_usb]
[46250.310890] [] ecrnx_msgind+0x3c/0x9e [wlan_ecr6600u_usb]
[46250.318326] [] usb_host_rx_handler+0x150/0x37a [wlan_ecr6600u_usb]
[46250.326536] [] ecrnx_rx_callback+0xc4/0x110 [wlan_ecr6600u_usb]
[46250.334485] [] usb_rx_comp_cb+0x6e/0xbc [wlan_ecr6600u_usb]
[46250.342086] [] eswin_rx_comp_thread+0x8e/0x196 [wlan_ecr6600u_usb]
[46250.350295] [] kthread+0xfe/0x110
[46250.355192] [] ret_from_exception+0x0/0xc
[46251.253149] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:201
[46251.261975] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3267, name: rx_comp
[46251.270116] CPU: 0 PID: 3267 Comm: rx_comp Tainted: G W O 5.15.0-starfive #1
[46251.278451] Hardware name: StarFive VisionFive V2 (DT)
[46251.283624] Call Trace:
[46251.286090] [] dump_backtrace+0x1c/0x24
[46251.291532] [] dump_stack_lvl+0x40/0x58
[46251.296967] [] dump_stack+0x14/0x1c
[46251.302048] [] ___might_sleep+0xde/0xee
[46251.307488] [] __might_sleep+0x42/0x6c
[46251.312837] [] kmem_cache_alloc+0x96/0x188
[46251.318533] [] ecrnx_rx_scanu_result_ind+0xde/0x3e0 [wlan_ecr6600u_usb]
[46251.327686] [] cmd_mgr_msgind+0xfc/0x14e [wlan_ecr6600u_usb]
[46251.335878] [] ecrnx_rx_handle_msg+0x74/0x104 [wlan_ecr6600u_usb]
[46251.344506] [] ecrnx_msgind+0x3c/0x9e [wlan_ecr6600u_usb]
[46251.352433] [] usb_host_rx_handler+0x150/0x37a [wlan_ecr6600u_usb]
[46251.361133] [] ecrnx_rx_callback+0xc4/0x110 [wlan_ecr6600u_usb]
[46251.369569] [] usb_rx_comp_cb+0x6e/0xbc [wlan_ecr6600u_usb]
[46251.377655] [] eswin_rx_comp_thread+0x8e/0x196 [wlan_ecr6600u_usb]
[46251.386350] [] kthread+0xfe/0x110
[46251.391277] [] ret_from_exception+0x0/0xc
[46251.717065] [ecrnx] ecrnx_rx_scanu_start_cfm: receive scanu cfm, status:0
[46251.724025] [ecrnx] ecrnx_rx_scanu_start_cfm: cfm status:0, scan_request:0x000000002eb2376a
[46254.120621] [ecrnx] ecrnx_cfg80211_scan() enter, line:1466
[46254.126283] [ecrnx] ecrnx_cfg80211_scan:scan_request:0x000000008f495c40
[46254.133368] [ecrnx] send finish:ecrnx_cfg80211_scan
[46254.138615] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:201
[46254.147480] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3267, name: rx_comp
[46254.155627] CPU: 0 PID: 3267 Comm: rx_comp Tainted: G W O 5.15.0-starfive #1

That looks fine, I do not see anything wrong with it. Well that is me out of ideas (for now).

Ok i just now realized that the new linux sources do indeed have to module included. A quick look into the kernel config confirmed that the driver for Wifi is compiled into the kernel so no module. This could be why i get the erros when i try to load it.

However:
It is not recognized as a wifi device in the network mananger. So the firmware is probly not loaded.

I will try agai with a fresh image as i played around quite a bit

Thanks!
Manux

1 Like

Ok something wierd is happening.

The wifi driver is compiled INTO the kernel. However it seems the module is still built and installed. AFAIK this should not happen if it is * in the kernel.

root@starfive:/home/user# lsmod
Module Size Used by
wlan_ecr6600u_usb 331776 0

However there is no wifi device:

root@starfive:/home/user# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 6c:cf:39:00:20:2b brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 6c:cf:39:00:20:2c brd ff:ff:ff:ff:ff:ff
inet 192.168.0.204/24 brd 192.168.0.255 scope global dynamic noprefixroute eth1
valid_lft 86276sec preferred_lft 86276sec

in Dmesg:

12.536941] eswin_usb 1-1.2:1.0: Direct firmware load for ECR6600U_transport.bin failed with error -2
[ 12.546210] [ecrnx] eswin_fw_file_chech, error status = -2
[ 12.552275] [ecrnx] MAC Address is:00:11:22:33:44:5f
[ 12.557247] [ecrnx] host driver log level is:3
[ 12.561796] [ecrnx] firmware log level is:2
[ 12.566069] [ecrnx] firmware log level type:0 (print to chip’s uart)

Hello
Do you copied the firmware to /lib/firmware ?
→ Direct firmware load for ECR6600U_transport.bin failed with error -2
It seems that the firmware ECR6600U_transport.bin is missing

You can find the firmware in my repo

Then you can do the steps here descriped
https://www.makeuseof.com/connect-to-wifi-with-nmcli/

Ok i finally managed to compile the kernel and the module is loaded.
I see it in Networkmanager and i can connect to Wifi.

At least theroeticly. There is no connection.
The password is correct but it does not connect and just gets back to the password prompt.

I also tried to connect to a free wifi without password. This also does not work.
Both networks are 2.4 ghz.

you tried with the console (see link ) too ?

Hi

Yes firmware is now present and the error in dmesg did vanish however. I still can not connect. What is strange is that NetworkManager does find the Wifi module two times. That is two devices are listed in the GUI.