cancel
Showing results for 
Search instead for 
Did you mean: 

MPU nteraction with a Endpointrest through wifi

SigmaPrime
Senior

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.

22 REPLIES 22

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.

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

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

watch -d -n 3 "iw dev wlan0 station dump; iwconfig wlan0; cat /proc/net/wirelss"

Every 3s: iw dev wlan0 station dump; iwconfig wlan0; cat /pr2000-01-01 00:08:57

[ 531.831451] brcmfmac: brcmf_cfg80211_dump_station Enter, idx 0

[ 531.843592] brcmfmac: brcmf_sdio_bus_txctl Enter

[ 531.850672] brcmfmac: brcmf_sdio_kso_control Enter: on=1

[ 531.861867] brcmfmac: brcmf_sdio_isr Enter

[ 531.868476] brcmfmac: brcmf_sdio_bus_rxctl Enter

[ 531.875442] brcmfmac: brcmf_sdio_isr Enter

sh: iwconfig: command not found

Inter-| sta-|  Quality    |  Discarded packets        | Missed | WE

 face | tus | link level noise | nwid crypt  frag retry  misc | beacon | 22

 wlan0: 0000  0   0   0    0   0   0   0   0    0

[ 531.919190] brcmfmac: brcmf_sdio_kso_control Enter: on=0

Every 3s: iw dev wlan0 station dump; iwconfig wlan0; cat /pr2000-01-01 00:09:00

Exactly that is not a sign of error.

My setup is using buildroot with the ST provided kernel. Threrfore I can't really help you with the mainline one. Maybe consider migrating if the ST kernel fits your needs?

Yeah It's plan B.

shane mattner
Associate III

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?

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

Olivier GALLIEN
ST Employee

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

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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

shane mattner
Associate III

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?