The debugging issues between NUC972DF63YC and WiFi Hallow

hi,when we debug the communication between NUC972DF63YC and WiFi Hallow,encounter the follow issue:
cannot be used as an AP
①Execute the following command on the AP side to start the hotspot for connection status verification.

hostapd_s1g -dd /etc/wifi/hostapd_s1g.conf &
ifconfig wlan0 192.168.11.1
killall  dnsmasq 
dnsmasq -i wlan0 -C  /etc/wifi/dnsmasq.conf &

②Execute the following commands ,connect to a hotspot and obtain an IP address on the STA side.

wpa_supplicant_s1g -Dnl80211 -iwlan0 -c /etc/wifi/wpa_supplicant_s1g.conf -dd &
udhcpc -i wlan0 & 

Connection failed,‌ and the AP’s serial port printed the following message :

NUC970 IBR 20151008.1735
No Key
Boot from NAND
2KB
NAND boot!


U-Boot 2016.11 (Dec 28 2024 - 00:43:56 +0800)

CPU: NUC972
Board: NUC972
DRAM:  64 MiB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   emac
Error: emac address not set.

Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x200000, size 0x1400000
 20971520 bytes read: OK

NAND read: device 0 offset 0x180000, size 0x20000
 131072 bytes read: OK
## Booting kernel from Legacy Image at 00007fc0 ...
   Image Name:   Linux-5.10.140
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4394800 Bytes = 4.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01600000
   Booting using the fdt blob at 0x1600000
   XIP Kernel Image ... OK
   Loading Device Tree to 03d64000, end 03d6d023 ... OK

StartiBooting Linux on physical CPU 0x0
Linux version 5.10.140 (root@test-pc) (arm-nuvoton-linux-gnueabi-gcc.br_real (Buildroot 2021.02.6) 9.4.0, GNU ld (GNU Binutils) 2.35.2) #23 PREEMPT Fri Jan 3 09:29:04 CST 2025
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
CPU: VIVT data cache, VIVT instruction cache
OF: fdt: Machine model: Nuvoton NUC972 EVB
Memory policy: Data cache writeback
Zone ranges:
  Normal   [mem 0x0000000000000000-0x0000000003ffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x00000000027fffff]
  node   0: [mem 0x0000000002800000-0x0000000002aedfff]
  node   0: [mem 0x0000000002aee000-0x0000000003b9afff]
  node   0: [mem 0x0000000003b9b000-0x0000000003d11fff]
  node   0: [mem 0x0000000003d12000-0x0000000003ffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
Built 1 zonelists, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock3 rw rootfstype=yaffs2 rootflags=inband-tags console=ttyS0,115200n8 rdinit=/sbin/init mem=64M
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 51004K/65536K available (6515K kernel code, 718K rwdata, 1460K rodata, 192K init, 228K bss, 14532K reserved, 0K cma-reserved)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
rcu:    RCU event tracing is enabled.
        Trampoline variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
NR_IRQS: 625
clocksource: nuc970-timer1: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 62215505635 ns
sched_clock: 24 bits at 120kHz, resolution 8333ns, wraps every 69905062489ns
Console: colour dummy device 80x30
printk: console [ttyS0] enabled
Calibrating delay loop... 148.88 BogoMIPS (lpj=744448)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x8400 - 0x8458
rcu: Hierarchical SRCU implementation.
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
<DT> nuc970_dt_device_init +
<DT> nuc970_dt_device_init -
pinctrl-nuc970 apb:pinctrl@b0000000: Initialized NUC970/N9H30 pinctrl driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc: Linux media interface: v0.10
videodev: Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource nuc970-timer1
NET: Registered protocol family 2
IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
Initialise system trusted keyrings
workingset: timestamp_bits=30 max_order=14 bucket_order=0
jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
NET: Registered protocol family 38
Key type asymmetric registered
Asymmetric key parser 'x509' registered
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
io scheduler mq-deadline registered
io scheduler kyber registered
b8000000.serial: ttyS0 at I/O 0xf8000000 (irq = 36, base_baud = 750000) is a NUC970
b8000600.serial: ttyS6 at I/O 0xf8000600 (irq = 40, base_baud = 750000) is a NUC970
b8000700.serial: ttyS7 at I/O 0xf8000700 (irq = 45, base_baud = 750000) is a NUC970
b8000900.serial: ttyS9 at I/O 0xf8000900 (irq = 46, base_baud = 750000) is a NUC970
brd: module loaded
nuc970 mtd nand driver version: 20230701
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xda
nand: Winbond W29N02GV
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
attach: page 2048, SMRA size 64, 32
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
4 fixed-partitions partitions found on MTD device nand0
Creating 4 MTD partitions on "nand0":
0x000000000000-0x000000180000 : "u-boot"
0x000000180000-0x0000001a0000 : "device-tree"
0x000000200000-0x000001600000 : "kernel"
0x000001600000-0x000007a80000 : "user"
fmi-sm: registered successfully! mtdid=nand0
CAN device driver interface
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
NUC970 EHCI over-current active level low...
nuc970-ehci b0005000.usbh_ehci: Nuvoton NUC970 EHCI Host Controller
nuc970-ehci b0005000.usbh_ehci: new USB bus registered, assigned bus number 1
nuc970-ehci b0005000.usbh_ehci: irq 23, io mem 0xb0005000
nuc970-ehci b0005000.usbh_ehci: USB 2.0 started, EHCI 0.95
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
NUC970 EHCI init done.
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc970-ohci b0007000.usbh_ohci: Nuvoton NUC970 OHCI Host Controller
nuc970-ohci b0007000.usbh_ohci: new USB bus registered, assigned bus number 2
nuc970-ohci b0007000.usbh_ohci: irq 24, io mem 0xb0007000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
NUC970 OHCI init done.
usbcore: registered new interface driver usb-storage
nuc970-adc b800a000.adc: Nuvoton NUC970 Touch ADC Driver
nuc970-adc b800a000.adc: Missing ts-type property in the DT, select 4-wire mode
nuc970-adc b800a000.adc: Use default convert delay time
input: NUC970 Touch Screen as /devices/platform/apb/b800a000.adc/input/input0
i2c /dev entries driver
nuc970-i2c0 b8006000.i2c0: i2c-0: nuc970 I2C adapter
This is Version C 0x1230d008
NUC970 Crypto engine enabled.
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nau8822 0-001a: Failed to issue reset: -6
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
mmc0: new high speed SDIO card at address 0001
NET: Registered protocol family 17
can: controller area network core
NET: Registered protocol family 29
can: raw protocol
can: broadcast manager protocol
can: netlink gateway - max_hops=1
Key type dns_resolver registered
Loading compiled-in X.509 certificates
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
ALSA device list:
  No soundcards found.
yaffs: dev is 32505859 name is "mtdblock3" rw
cfg80211: failed to load regulatory.db
yaffs: passed flags "inband-tags"
random: crng init done
VFS: Mounted root (yaffs2 filesystem) on device 31:3.
devtmpfs: mounted
Freeing unused kernel memory: 192K
Kernel memory protection not selected by kernel config.
Run /sbin/init as init process
Starting syslogd: OK
Starting klogd: OK
/etc/init.d/S02sysctl: line 1: ../procps-ng/S02sysctl: not found
Starting mdev... OK
Initializing random number generator: OK
Saving random seed: OK
Starting network: ifup: interface lo already configured
OK
Starting dnsmasq: start-stop-daemon: invalid option -- 'i'
BusyBox v1.33.1 (2024-12-28 00:31:55 CST) multi-call binary.

Usage: start-stop-daemon [OPTIONS] [-S|-K] ... [-- ARGS...]

Search for matching processes, and then
-K: stop all matching processes
-S: start a process unless a matching process is found

Process matching:
        -u USERNAME|UID Match only this user's processes
        -n NAME         Match processes with NAME
                        in comm field in /proc/PID/stat
        -x EXECUTABLE   Match processes with this command
                        in /proc/PID/cmdline
        -p FILE         Match a process with PID from FILE
        All specified conditions must match
-S only:
        -x EXECUTABLE   Program to run
        -a NAME         Zeroth argument
        -b              Background
        -N N            Change nice level
        -c USER[:[GRP]] Change user/group
        -m              Write PID to pidfile specified by -p
-K only:
        -s SIG          Signal to send
        -t              Match only, exit with 0 if found
Other:
        -o              Exit with status 0 if nothing is done
        -v              Verbose
        -q              Quiet
FAIL

Welcome to Buildroot
buildroot login: root
# insmod /home/wingo/dot11ah.ko
dot11ah: loading out-of-tree module taints kernel.
Morse Micro Dot11ah driver registration. Version 0-rel_1_9_4_2023_Nov_02
# insmod /home/wingo/morse.ko
morse micro driver registration. Version 0-rel_1_9_4_2023_Nov_02
morse_sdio mmc0:0001:2: Reading gpio pins configuration from device tree
morse_sdio mmc0:0001:2: Driver loaded with kernel module parameters
morse_sdio mmc0:0001:2:     log_modparams_on_boot                   : Y
morse_sdio mmc0:0001:2:     enable_mcast_whitelist                  : Y
morse_sdio mmc0:0001:2:     ocs_type                                : 1
morse_sdio mmc0:0001:2:     enable_auto_mpsw                        : Y
morse_sdio mmc0:0001:2:     duty_cycle_mode                         : 0
morse_sdio mmc0:0001:2:     enable_auto_duty_cycle                  : Y
morse_sdio mmc0:0001:2:     dhcpc_lease_update_script               : /morse/scripts/dhcpc_update.sh
morse_sdio mmc0:0001:2:     enable_ibss_probe_filtering             : Y
morse_sdio mmc0:0001:2:     enable_dhcpc_offload                    : N
morse_sdio mmc0:0001:2:     enable_arp_offload                      : N
morse_sdio mmc0:0001:2:     enable_bcn_change_seq_monitor           : 0
morse_sdio mmc0:0001:2:     enable_cac                              : 0
morse_sdio mmc0:0001:2:     max_mc_frames                           : 10
morse_sdio mmc0:0001:2:     tx_max_power_mbm                        : 2200
morse_sdio mmc0:0001:2:     enable_twt                              : Y
morse_sdio mmc0:0001:2:     enable_mac80211_connection_monitor      : N
morse_sdio mmc0:0001:2:     enable_airtime_fairness                 : N
morse_sdio mmc0:0001:2:     enable_raw                              : Y
morse_sdio mmc0:0001:2:     max_aggregation_count                   : 0
morse_sdio mmc0:0001:2:     max_rate_tries                          : 1
morse_sdio mmc0:0001:2:     max_rates                               : 3
morse_sdio mmc0:0001:2:     enable_watchdog_reset                   : N
morse_sdio mmc0:0001:2:     watchdog_interval_secs                  : 30
morse_sdio mmc0:0001:2:     enable_watchdog                         : Y
morse_sdio mmc0:0001:2:     country                                 : AU
morse_sdio mmc0:0001:2:     enable_cts_to_self                      : N
morse_sdio mmc0:0001:2:     enable_rts_8mhz                         : N
morse_sdio mmc0:0001:2:     enable_trav_pilot                       : Y
morse_sdio mmc0:0001:2:     enable_sgi_rc                           : Y
morse_sdio mmc0:0001:2:     enable_mbssid_ie                        : N
morse_sdio mmc0:0001:2:     virtual_sta_max                         : 0
morse_sdio mmc0:0001:2:     thin_lmac                               : 0
morse_sdio mmc0:0001:2:     enable_coredump                         : Y
morse_sdio mmc0:0001:2:     enable_dynamic_ps_offload               : Y
morse_sdio mmc0:0001:2:     enable_ps                               : 2
morse_sdio mmc0:0001:2:     enable_subbands                         : 2
morse_sdio mmc0:0001:2:     enable_survey                           : Y
morse_sdio mmc0:0001:2:     mcs10_mode                              : 0
morse_sdio mmc0:0001:2:     mcs_mask                                : 1023
morse_sdio mmc0:0001:2:     no_hwcrypt                              : 0
morse_sdio mmc0:0001:2:     enable_otp_check                        : 1
morse_sdio mmc0:0001:2:     bcf                                     :
morse_sdio mmc0:0001:2:     serial                                  : default
morse_sdio mmc0:0001:2:     debug_mask                              : 8
morse_sdio mmc0:0001:2:     tx_status_lifetime_ms                   : 15000
morse_sdio mmc0:0001:2:     max_txq_len                             : 22
morse_sdio mmc0:0001:2:     default_cmd_timeout_ms                  : 1200
morse_sdio mmc0:0001:2:     sdio_reset_time                         : 400
morse_sdio mmc0:0001:2:     macaddr_suffix                          : 00:00:00
morse_sdio mmc0:0001:2:     macaddr_octet                           : 255
morse_sdio mmc0:0001:2:     max_total_vendor_ie_bytes               : 514
morse_sdio mmc0:0001:2:     sdio_clk_debugfs                        :
morse_sdio mmc0:0001:2:     enable_mm_vendor_ie                     : Y
uaccess char driver major number is 247
morse_io: Device node '/dev/morse_io' created successfully
#
#
# hostapd_s1g -dd /etc/wifi/hostapd_s1g.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/wifi/hostapd_s1g.conf
s1g oper class: 70, validated: 24
s1g channel 40
s1g mapped ht channel 155
ht channel set as 149
morse: execute morse_cli -i wlan0 raw disable
NL80211, code -1: Failed to rcvmsgs
Failed to set RAW config
RAW Settings: disable 4096 26900 1 disable
morse: execute morse_cli -i wlan0 raw disable 0
NL80211, code -1: Failed to rcvmsgs
Failed to set RAW config
Segmentation fault
#

Sometimes the device is recognized, sometimes it is not.
The attached image is a part of the schematic.
why?


Hi @panhaojie

From this part of your error log

hostapd_s1g -dd /etc/wifi/hostapd_s1g.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/wifi/hostapd_s1g.conf
s1g oper class: 70, validated: 24
s1g channel 40
s1g mapped ht channel 155
ht channel set as 149
morse: execute morse_cli -i wlan0 raw disable
NL80211, code -1: Failed to rcvmsgs
Failed to set RAW config
RAW Settings: disable 4096 26900 1 disable
morse: execute morse_cli -i wlan0 raw disable 0
NL80211, code -1: Failed to rcvmsgs
Failed to set RAW config
Segmentation fault

It looks like the HaLow wireless interface hasn’t been brought up. Suggest swapping ifconfig and hostapd_s1g commands so that you bring the wireless interface up first before running hostapd. I would also explicitly call ifconfig wlan0 up.

For example:

ifconfig wlan0 up 192.168.11.1
hostapd_s1g -dd /etc/wifi/hostapd_s1g.conf &
killall  dnsmasq 
dnsmasq -i wlan0 -C  /etc/wifi/dnsmasq.conf &