WiFi Halow custom communication with STM32U575

Hi everyone,

I am developing a ** STM32U575 project** and I have started exploring the resources (mm-ekh08-u575 toolkit) for integrating with Silex Wi-Fi HaLow module, based on MM6108.

My project involves sending data acquired from a sensor with STM32U575 to another microcontroller connected to the WiFi Halow network i.e another STM32U575 or a RaspBerryPi.

I’m using Silex’s EVK module for SX-SDMAH. I followed the SX-SDMAH_IoT_SDK_Startup_Guide which explained how to start the iperf example on STM32U575 & EVB board that correctly works. I used another EVK module to check the communication. The data rate was only around 102 Kbit/s. Here’s the first question: *where to control tx power parameters and channel for that example?

Furthermore, I need to develop my own code. I understood how the code of the example works, but I miss to understand how to send the data i gathered from the sensor. Is there a particular instruction or set of instruction to perform that communication?

Thank you in advance for your help and any suggestions you can provide!

Hi @mark

where to control tx power parameters and channel for that example?

The channel is determined by the access point. Best place to control that will be through the AP Web UI. What are you using as an AP?

For the TX power parameters, Silex would have prepared a board configuration file - with a .mbin extension - for this module which sets the most appropriate TX power for each channel so that the hardware can meet regulatory requirements. Noting your low data rate, it would be worth verifying the BCF file is correctly set for the module. It would be worth confirming which BCF file to use with Silex, and then adjust the following line in the config.hjson to suit.

"bcf_file": "$MMIOT_ROOT/morsefirmware/bcf_mf08551.mbin"

On these platforms, you do have the capability to reduce the maximum TX power through the mmwlan API: enum mmwlan_status mmwlan_override_max_tx_power(uint16_t tx_power_dbm). This will not increase the TX power over the maximum allowed for the current channel in the configured regulatory domain. This override will only reduce the maximum TX power.


Is there a particular instruction or set of instruction to perform that communication?

You will want to look at the LwIP APIs. We have a UDP broadcast example which might be a simpler example to get you started.
LwIP has support for POSIX style sockets, so you should be able to follow most guides for socket programming and use them with LwIP. For the basics of connecting, receiving, and sending, I will often refer to a guide like Beej's Guide to Network Programming.

Thanks for your quick response. In the meanwhile I solved the problem
about the data rate. The issue consisted in a parameter that could be set in the iperf command on the AP, as specified in the guide provided by Silex. The command executed was:

iperf -c 192.168.200.2 -u -b 100K -i 10 -t 60

-b 100K specifies the bandwidth for data to be sent. It was enough to change 100K to the desired value.

Concerning the programming problem, I have read some documentation and I understood the logic behind the LwIP APIs, so I will find a way to write the script I need.

The problem now, is that I’m trying to use STM32CubeIDE to program. The problem is that I can’t build examples from MM_Iot due to this error:

The procedure I used to build the file, was to take the cube.ioc file from a stm32u575 project (that was available only in platformio, i’m referring to mm-ekh08-us) and then use the MM_IoT Software Package (downloaded here - CMSIS Pack v1.5.0). I’m aware that this pack was made for stm32u585, but I hoped it was compatible also for u575.

Thank you for the time you dedicate to me.

Hi @mark ,
Please define MMPKTMEM_TX_POOL_N_BLOCKS=32 and MMPKTMEM_RX_POOL_N_BLOCKS=32 globally in your project.

(in the cmsis-pack, you can find a two example projects, HaLow_example_spi and HaLow_example_sdio. you should be able to open and build them. these examples contains very useful project setups that can help you setting up your project.)

Kind Regards,
Milad.

Hi @Milad.
Thanks for the idea.
I tried to define that in my project but other problems comes up. I’m thinking that the example on STM32IDE were made only for U585 and that there is no direct compatibility with U575, that must be used only PlatformIO IDE.

Kind Regards,
mark.

Forgive me the second post in a row.
Is it possibile to modify the pinout configuration of an example (like udp_broadcast) for stm32U575 using CubeMX?
It wouldn’t be a problem if I were using STM32CubeIDE but the examples are working only on PlatformIO extension of VSCode.

Thanks in advance,
mark

Hi @mark ,
Technically, It shouldn’t matter which dev environment you choose and use to run/modify the examples and you should be able to change the project settings including pinouts or UART, SPI peripherals (in the ioc file using CubeMX ) and regenerate the project.

I’m not very familiar with platfromIO. but to make sure that you’re going on the right way, I suggest to open the ioc file in CubeMX and regenerate the code without making any change in CubeMX and build the project in platformIO. if that worked, proceed with making changes (and make sure to keep definitions in main.h aligned with the new settings) and verify that they work.
However, if you’re going to change the fundamental things such as SPI number or interrupts, make sure that you configure them exactly like the original SPI.

Kind regards.