Skip to main content
Visitor II
October 26, 2020
Question

MPU nteraction with a Endpointrest through wifi

  • October 26, 2020
  • 7 replies
  • 8036 views

Hello everyone,

I received my STM32MP157C-DK2 device and I built a Buildroot-image and flashed it successfully.

I am new to STM32 and to the IoT field so perhaps you can orient me and tell me which Programs I need to do so. I want to write a "hello_world" program that sends hello_world every x-seconds to an Endpoint-rest through Wifi.

Is it possible to only use Linux Bash/Shell interface to execute my Program? (I am familiar to these) and like I said I am only testing some features here like the ability of the DK2 to interact with Endpoint-rests.

Thank you all and have a nice day.

    This topic has been closed for replies.

    7 replies

    Technical Moderator
    November 5, 2020

    Hi @SigmaPrime​ ,

    If you are new to STM32MP1 I recommend you to go through our wiki.

    You can find some resource regarding Wifi setup.

    https://wiki.st.com/stm32mpu/wiki/How_to_setup_wifi_connection

    https://wiki.st.com/stm32mpu/wiki/How_to_configure_a_wlan_interface_on_hotspot_mode

    None related to endpoint-rest but maybe it can give you better view of MP1.

    Else please be aware that we are only supporting Yocto based solution, not Buildroot.

    For this we can recommend some partners.

    Olivier

    Visitor II
    November 5, 2020

    Thank you for your response

    Actually I am having trouble dealing with Buildroot and Wi-Fi connection. The patches installed and given by Buildroot are not actual.

    For someone newly introduced to buildroot I made some research and had some basic knowledge but some specific things like installing new patches and configuring drivers are not detailed and I try since 1 week to connect my board to Wi-Fi.

    This is what I get every time :

    Successfully initialized wpa_supplicant

    nl80211: 'nl80211' generic netlink not found

    Failed to initialize driver 'nl80211'

    wlan0: Unsupported driver 'nl80211'

    FAIL

    When I lshw I get: 

    lshw -class network *

    -network description: Ethernet interface physical id: 1 logical name: eth0 serial: 00:80:e1:42:6b:16 size: 1Gbit/s capacity: 1Gbit/s capabilities: ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=st_gmac driverversion=Jan_2016 duplex=full ip=192.168.8.15 link=yes multicast=yes port=MII speed=1Gbit/s

    My kernel and system Configurations are more than correct and I enable all needed features.

    Visitor II
    November 6, 2020

    Hi,

    for the On-Chip wifi module of the STM32MP157c-dk2 you must enable the broadcom FullMAC WLAN driver and its SDIO bus interface (the brcmfmac module is used) in the linux-menuconfig.

    In buildroot you have to activate the 'Broadcom BRCM bcm43xx' firmware at Target packages -> Hardware handling -> Firmware -> linux firmware -> Wifi firmware. Also you will need a .txt file to load the firmware. I got this one from the ST Starter Package cause it is not available in the buildroot package. Just search for 'brcmfmac43430-sdio.txt'. I tried this one (https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43430-sdio.txt) too wich worked as well, I did not test it though. You will see in the dmesg which .txt file is needed.

    Visitor II
    July 14, 2021

    Dear @Lukas Brückner​,

    thanks for the instructions!

    When using 'brcmfmac43430-sdio.txt' as you suggested, you need to activate the 'Broadcom BRCM bcm43***' firmware at Target packages instead of 'Broadcom BRCM bcm43xx'. Otherwise 'brcm/brcmfmac43430-sdio.bin' will not be available on the target.

    Visitor II
    November 10, 2020

    As you can see everything is on .. But how do I upload the .txt file ? do I have to do that before or after the build. If after then were (in which folder)

    0693W000005AuFMQA0.png0693W000005AuFHQA0.png 

    Visitor II
    November 10, 2020

    It goes to /lib/firmware/brcm on your target after building (you can use the buildroot overlay function for example). Buildroot will also copy the bcrm firmware to that folder, be sure to enable it, too.

    Visitor II
    November 10, 2020

    Blocked ... I did everything but still nothing

    Activated Broadcom FullMAC WLAN driver as module ( <M>)

    Activated SDIO bus interface support for FullMAC driver

    Activated wpa_supplicant dhcp etc ...

    for the driver I

    1- git clone git://github.com/murata-wireless/cyw-fmac-fw.git;protocol=https;nobranch=1;name=murata;destsuffix=murata

    2- git checkout -b 8d87950bfad28c65926695b7357bd8995b60016a

    3- got the .txt file from: https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt?fbclid=IwAR1KtSo4XzA8mV_tbL9ERkdBMduSwtbBed66_5tMDpq5D_wpFy69FSClC_s

    4 - my brcm directory on my target device (STM32MP157C-DK2) looks like in the photo I uploaded

    0693W000005B06LQAS.pngI don't know what is not working here.

    I can share my interfaces and wpa_supplicant files. Maybe there is a fault there but I don't thing so.

    Visitor II
    November 11, 2020

    yeah but I did everything right. the download part was a supplement.

    ifconfig -a does not output wlan0

    I only have sit0 lo and eth0

    Some detail I may want to share is that in linux-menuconfig under

    > Networking support > Wireless I get a "-*-" in front of "Wireless" and not a [*]

    Visitor II
    November 11, 2020

    Some detail I may want to share is that in linux-menuconfig under

    > Networking support > Wireless I get a "-*-" in front of "Wireless" and not a [*]

    That just means the wifi got selected from another option that depends on it.

    Are you using the ST provided kernel (https://github.com/STMicroelectronics/linux)?

    Maybe the dmesg output will help you as well.

    Visitor II
    November 11, 2020

    so the "-*-" is not a sign of error or somth ?

    No I am using Buildroot's kernel as I explained.

    Graduate II
    November 25, 2020

    Thank you @Lukas Brückner​  for the detailed troubleshooting steps. I tried the above steps and also still cannot get WiFi working on the STM32MP157-DK2 with Buildroot. I think perhaps I got 1 step farther than SigmaPrime because my error changed from

    Successfully initialized wpa_supplicant
    nl80211: 'nl80211' generic netlink not found
    Failed to initialize driver 'nl80211'
    wlan0: Unsupported driver 'nl80211'

    To:

    # wpa_supplicant -B -i wlan0 -W -D nl80211, wext -c /etc/wpa_supplicant.conf
    Successfully initialized wpa_supplicant
    Could not read interface wlan0 flags: No such device
    nl80211: Driver does not support authentication/association or connect commands
    nl80211: deinit ifname=wlan0 disabled_11b_rates=0
    Could not read interface wlan0 flags: No such device
    wlan0: Unsupported driver ''

    This change happened after I turned on 80211 support on the linux-menuconfig of Buildroot

    There's not much in the DTS or DTSI that mentions wifi (unlike ethernet that has all it's pins mapped). Could this be an issue?

    Visitor II
    November 26, 2020

    Hi @shane mattner​ ,

    I am unable to test right now, but as far as I could look it up you should have that in your stm32mp157c-dk2.dts file (I didn't put it there, this is shipped with the ST Kernel (https://github.com/STMicroelectronics/linux):

    /* Wifi */
    &sdmmc2 {
    	arm,primecell-periphid = <0x10153180>;
    	pinctrl-names = "default", "opendrain", "sleep";
    	pinctrl-0 = <&sdmmc2_b4_pins_a>;
    	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
    	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
    	non-removable;
    	st,neg-edge;
    	bus-width = <4>;
    	vmmc-supply = <&v3v3>;
    	mmc-pwrseq = <&wifi_pwrseq>;
    	#address-cells = <1>;
    	#size-cells = <0>;
    	status = "okay";
     
    	brcmf: bcrmf@1 {
    		reg = <1>;
    		compatible = "brcm,bcm4329-fmac";
    	};
    };

    So your wifi should be indeed mentioned in your device tree. Are you trying to use the mainline kernel (aka the one buildroot suggests you by default)? The mainline one seems not to have it. As you can sse in the device tree, the driver used for the wifi should be the bcm4329-fmac.

    Besides the device tree and the above mentioned device drivers I can share my Network support -> Wireless settings (see picture).

    Hope it helps!0693W000005ChfzQAC.png

    Technical Moderator
    November 26, 2020

    Hi all, @SigmaPrime​ , @shane mattner​ 

    Did you try to get some help from murata/cypress ?

    Very active support for Cypress forum :

    https://community.cypress.com/welcome

    Other links :

    BT: https://github.com/murata-wireless/cyw-bt-patch

    WLAN: https://github.com/murata-wireless/cyw-fmac-fw

    Hope it help,

    Olivier

    Visitor II
    November 26, 2020

    Hi

    Well I managed to work it out alone actually with the help of a friend.

    The solution concerns people using buildroot.

    1) Invoke the Kernel configuration utility using make linux-menuconfig in your Buildroot directory on

    your host machine.

    2) Enable Wireless Networking support under Networking support

    3) Enable cfg80211 - wireless configuration API, and Generic IEEE 802.11 Networking Stack

    (mac80211), under Networking Support,Wireless

    4) Enable EEPROM 93CX6 support under Device Drivers, Misc devices, EEPROM support. Required

    for RTL8187 module in my Wi-Fi dongle, may not be needed for your particular adapter

    5) Enable Wireless LAN driver support under Device Drivers, Network device support

    6) Invoke make menuconfig within the buildroot folder from a command prompt

    7) Select package iw required to configure wireless networking, under Target packages, Networking applications.

    Enable iproute2 if you want to use the ip utility instead of ifconfig.

    9) Select package wpa_supplicant and its sub-packages for WPA/WPA2 support:

    - Install wpa_cli binary

    - Install wpa_passphrase binary

    - Enable Support for soft Ap

    9) Activated Broadcom FullMAC WLAN driver as module ( : Press space several time to change it)

    10) Activated SDIO bus interface support for FullMAC driver

    11) Activated wpa_supplicant dhcp

    12) go to /lib/firmware and create a directory name firmware

    13) git clone git://github.com/murata-wireless/cyw-fmac-fw.git;protocol=https;nobranch=1;name=

    murata;destsuffix=murata

    14) git checkout -b 8d87950bfad28c65926695b7357bd8995b60016a. If you wnt to check the version then

    use:

    sha256sum brcmfmac43430-sdio.bin

    3ea748266c78351880d6389d672bd22eb0e13629c0607b5010a4a410d1395548 brcmfmac43430-sdio.bin

    15) get the .txt file from git repository of ST and put the .bin and .txt file on the /lib/firmware/brcm

    directory.

    16) copy the brcm43430-sdio.1DX.clm_blob to /lib/firmware/brcm and rename it to brcmfmac43430-

    sdio.clm_blob

    17) make

    18) flash your sdcard with the new image

    19) Wifi Setup on the target machine

    20) make

    21) flash your sdcard with the new image

    **Wifi Setup on the target machine**

    23) Use wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant.con

    24) modprobe brcmfmac

    25) ifconfig wlan0 up

    26) wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant.conf

    # wait a little bit

    27) ifconfig -a

    Graduate II
    November 26, 2020

    Are you using an external WiFi module? I'm trying to use the on-board module

    I still get the same errors as before. However, I discovered in Buildroot menuconfig that you have to turn on "Show packages that are also provided by busybox" in order to have DHCP appear as an option.

    How did you set up your build environment? I followed Bootlin's guide to STM32MP157-DK2.

    Can you provide your .config for the menuconfig and linux-menuconfig?

    Visitor II
    December 2, 2020

    I enumerated the steps in my previous command. The murata firmware is not recognized by buildroot that's why I downloaded one.

    Here is the package config file