Enabling Wifi on nRF7002

Hello everyone,

I'm trying to set up the Wifi stack on the nRF7002 and use it with MicroPython, but encountering a lot of difficulty with it. I cropped up a network_wlan.c file and added it to the build. I configured the CMakeLists.txt, prj.conf and nrf7002dk_nrf5340_cpuapp_ns.conf to the best of my knowledge (based on the given wifi samples) but I've hit a roadblock.

Since I've got no prior experience with this board or Zephyr, I decided to start by just enabling the Wifi_scan functionality.

Right now I can "choose" which error I'd like to see:
1). Given this "main_scan()" function which I'm calling via REPL to use in microPy:



When I try to invoke it via these commands, I get a Secure Fault:


Which lead me to the suspicion that the network interface is not initialized and "net_if_get_default()" (line 19 in the above function) is returning NULL.

2). So I decided to see if I can do a "net_if_set_default()" via the "active" function:
 


But this brings its own predicaments since the project won't build with this function; giving the error:


Where network_wlan.c:169: undefined reference to `__device_dts_ord_135' points to this line of code inside the "wlan_active()" function:


A bit of digging (github.com/.../41677) leads to the hypothesis that a few lines above, the definition of the Wifi interface doesn't actually work/ isn't instantiated and returns NULL:

Not sure if it makes a difference but: I'm using an Apple M1 MacBook.
I can provide any of the above files (or others) if needed, to be able to solve this mistery. I'm sure it's something trivial, but can't figure out what. -.-

Does anyone have any idea what might be causing these issues and what's the correct way of moving forward to be able to do a correct "wifi scan"? Thank you in advance and I hope you have a wonderful day!

Parents
  • Hi, 

    Try to enable SB_CONFIG_WIFI_NRF70 in the sysbuild.conf as our wifi examples.

    Regards,
    Amanda H.

  • Hello Amanda.

    Thank you for taking the time to look into my case.

    I tried your suggestion and got:

    I'll see what I can disable to make things fit.

    Edit:

    I'm not sure what else to disable at this point since we already disabled the NFC and BT to make Wifi fit. Ideally we'd have all 3 active in the project. Here are our two .config files, maybe you can spot something that's a memory hog which shouldn't be there. 

    prj.conf:

    nrf7002dk_nrf5340_cpuapp_ns.conf:

  • Tudor B. said:
    When building the rom_report using the command "west build -d build/mcuboot -t rom_report", but I get one of two errors.

    Do you build your application with mcuboot? Did you have the build/mcuboot folder? That command would analyze the RAM usage for mcuboot. 

    If you want to analyze your application, you should run 

    west build -d ./build/Your_App_Name -t ram_report

  • Managed to make everything fit by minimising TFM:

    Resulting in a much smaller ROM footprint:
    Normally the command we run is: 
    Adapting your suggestion to our command (west build -d nrf7002dk/nrf5340/cpuapp/ns -t ram_report) results in:
    Edit:
    I tried specifying the board also in the build command. I did a -- pristine, then a normal build, then a -t ram_report build and got:

  • Good to know you find the configs to reduce the image size. 

    As I explained, you executed the ram_report command for your application as: west build -d ./build/zephyr  -t ram_report

  • You were right. I managed to produce both the ram and rom report!

    I was missing the "./" when I previously tried running the command you mentioned. Slight smile

    Thank you very much Amanda!

    Also, since we moved on to another part of the project, I've hit another issue. Can I ask here or shall I make a separate ticket?

  • Please create a new support ticket for another issue. 

Reply Children
  • I understand. Then I guess this ticket can be closed since the problem is solved.

    Once again thank you very much for the help Amanda. All the best and have a great day! Smiley