Hello,
I’ve followed the setup procedure for npa-vee-rw612, on the latest main commit, and I’ve run the following simple Java program to scan Wi-Fi access points. Add implementation(libs.api.ecom.wifi) to the dependencies of your program’s build.gradle.kts if it’s not already there.
public static void main(String[] args) {
WifiManager wman = WifiManager.getInstance();
try {
AccessPoint scanResults[] = wman.scan();
for (AccessPoint ap : scanResults) {
LOGGER.info("found " + ap.getSSID());
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
I first encountered an error in bsp/sdk_overlay/middleware/wifi_nxp/wifidriver/wifi-imu.c:1626:
retry:
/* Comment out this line if CPU1 image is downloaded through J-Link.
* This is for load service case only.
*/
power_off_device(LOAD_WIFI_FIRMWARE);
wifi_io_d("%u IMU download WLAN FW.\n", OSA_TicksGet());
/* Download firmware */
ret = sb3_fw_download(LOAD_WIFI_FIRMWARE, 1, (uint32_t)fw_ram_start_addr);
/* If fw download is failed, retry downloading for 3 times. */
if (ret)
{
if (retry_cnt != 0)
{
retry_cnt--;
goto retry;
}
else
{
wifi_io_e("Download firmware failed"); // <--- failed here
mlanstatus = MLAN_STATUS_FAILURE;
return mlanstatus;
}
}
From there, I deduced that I was missing a binary blob. It appears that the Wi-Fi firmware is not linked into the final image and that NXP’s BSP expects it to have been flashed beforehand at a known address. You can find instructions at bsp/mcux-sdk/core/components/conn_fwloader/readme.txt.
Here’s what I did, using the JLinkExe command-line interpreter:
$ JLinkExe
J-Link>connect
Please specify device / core. <Default>: RW612
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>s
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "RW612" selected
J-Link>loadbin bsp/mcux-sdk/core/components/conn_fwloader/fw_bin/rw61x_sb_wifi_a2.bin,0x08400000
'loadbin': Performing implicit reset & halt of MCU.
ResetTarget() start
Reset via SYSRESETREQ and reset pin + halt after bootloader
MSPLIM cleared
ResetTarget() end - Took 118ms
Device specific reset executed.
Downloading file [/home/abruant/repos/npa-vee-rw612/npa-rw612-frdm/bsp/mcux-sdk/core/components/conn_fwloader/fw_bin/rw61x_sb_wifi_a2.bin]...
J-Link: Flash download: Bank 0 @ 0x08000000: 1 range affected (589824 bytes)
J-Link: Flash download: Total: 7.769s (Prepare: 0.237s, Compare: 1.862s, Erase: 2.215s, Program: 2.362s, Verify: 0.975s, Restore: 0.116s)
J-Link: Flash download: Program & Verify speed: 172 KB/s
O.K.
I suppose you could also do it with LinkServer, but I’m not familiar with it.
I then managed to run my scan application.
NXP VEE Port '1.0.0' '0cc4ba50-dirty'
NXP VEE Heap size: 829304 Bytes
NXP PA > VM START
[RW610 WiFi Driver][DEBUG] (WIFI_RW610_initialize_f) start
[RW610 WiFi Driver][DEBUG] Initialize WLAN Driver
Wi-Fi cau temperature : 27
MAC Address: C0:95:DA:01:02:03
PKG_TYPE: BGA
Set BGA tx power table data
[RW610 WiFi Driver][DEBUG] app_cb: WLAN: received event 12
[RW610 WiFi Driver][DEBUG] app_cb: WLAN initialized
[RW610 WiFi Driver][DEBUG] app_cb: WLAN: received event 14
[RW610 WiFi Driver][DEBUG] app_cb: WLAN: PS_ENTER
[RW610 WiFi Driver][DEBUG] app_cb: WLAN: received event 14
[RW610 WiFi Driver][DEBUG] app_cb: WLAN: PS_ENTER
[RW610 WiFi Driver][DEBUG] WLAN Driver Initialized
[RW610 WiFi Driver][DEBUG] (WIFI_RW610_initialize_f) end
[RW610 WiFi Driver][DEBUG] (WIFI_RW610_get_ap_count_f) start
[RW610 WiFi Driver][DEBUG] Scanning
[RW610 WiFi Driver][DEBUG]
10 networks were found:
[RW610 WiFi Driver][DEBUG] #1 [RW610 WiFi Driver][DEBUG] 02:00:00:00:01:01[RW610 WiFi Driver][DEBUG] "AP_1"
[RW610 WiFi Driver][DEBUG] #2 [RW610 WiFi Driver][DEBUG] 02:00:00:00:02:01[RW610 WiFi Driver][DEBUG] "AP_2"
[RW610 WiFi Driver][DEBUG] #3 [RW610 WiFi Driver][DEBUG] 02:00:00:00:02:02[RW610 WiFi Driver][DEBUG] (hidden)
[RW610 WiFi Driver][DEBUG] #4 [RW610 WiFi Driver][DEBUG] 02:00:00:00:03:01[RW610 WiFi Driver][DEBUG] "AP_3"
[RW610 WiFi Driver][DEBUG] #5 [RW610 WiFi Driver][DEBUG] 02:00:00:00:03:02[RW610 WiFi Driver][DEBUG] (hidden)
[RW610 WiFi Driver][DEBUG] #6 [RW610 WiFi Driver][DEBUG] 02:00:00:00:04:01[RW610 WiFi Driver][DEBUG] "AP_4"
[RW610 WiFi Driver][DEBUG] #7 [RW610 WiFi Driver][DEBUG] 02:00:00:00:05:01[RW610 WiFi Driver][DEBUG] "AP_5"
[RW610 WiFi Driver][DEBUG] #8 [RW610 WiFi Driver][DEBUG] 02:00:00:00:06:01[RW610 WiFi Driver][DEBUG] "AP_5"
[RW610 WiFi Driver][DEBUG] #9 [RW610 WiFi Driver][DEBUG] 02:00:00:00:03:03[RW610 WiFi Driver][DEBUG] "AP_3"
[RW610 WiFi Driver][DEBUG] #10 [RW610 WiFi Driver][DEBUG] 02:00:00:00:03:04[RW610 WiFi Driver][DEBUG] (hidden)
[... many DEBUG log entries...]
[main] INFO: found AP_1
[main] INFO: found AP_2
[main] INFO: found
[main] INFO: found AP_3
[main] INFO: found
[main] INFO: found AP_4
[main] INFO: found AP_5
[main] INFO: found AP_5
[main] INFO: found AP_3
[main] INFO: found
Hopefully, reflashing the Wi-Fi firmware will help solve the problem you’re experiencing, but I’ve not been able to reproduce it. As for your questions, some of them are very broad and mostly relate to NXP’s board support package, which MicroEJ does not maintain. Let’s first get the AP scan example running on the latest version of NPA.
- Which callback or operation normally runs immediately after the MAC address is printed?
Referring to my log, these seem to be verbose entries from the radio configuration.
- Is the
[RW610 WiFi Driver] name expected when using the FRDM-RW612?
This is the name I see in my example.
- Could this be caused by a mismatch between the Wi-Fi host driver and the RW61x Wi-Fi firmware?
This is what I assumed. Let us know if you can pin the problem down to a more precise scenario.
- Which versions of the NXP Platform Accelerator VEE Port, MCUXpresso SDK, FreeRTOS, Wi-Fi middleware, and RW61x firmware are recommended as a compatible combination?
The recommended versions are the ones you get by following the west init (on main) and west update commands in the setup procedure.
- Would upgrading or downgrading the entire VEE Port/BSP be recommended?
What version of npa-vee-rw612 is your work based on?
You can try the AP scan sample on the latest main commit. The BSP dependencies are expressed in npa-vee-rw612/west.yml at main · nxp-mcuxpresso/npa-vee-rw612 · GitHub.
- Is the following application dependency relevant to this initialization issue, or is it only a Java utility library?
I think your question is incomplete: I don’t know which dependency you’re referring to.
Best regards.