6 years, 7 months ago.

ES_WIFI and SPIRIT1 conflicting

The wifi example provided for this board uses SPI to communicate with the wifi module, conflicting with the SPIRIT1, which also uses SPI. How can I set the ES_WIFI to use UART instead?

Inventek provides the firmware for the module to use UART, but there are no instructions on how to upload it to the module on this board.

Question relating to:

STM32L4 Discovery kit IoT node, low-power wireless, BLE, NFC, SubGHz, Wi-Fi

1 Answer

6 years, 5 months ago.

Hi

In the https://os.mbed.com/teams/ST/code/DISCO_L475VG_IOT01A_wifi/file/c61a93635433/es_wifi_conf.h/ file you can choose the USART instead of SPI using this macro:

#define ES_WIFI_USE_SPI                             0   

It seems that same race condition issue raises also while using wifi and ble at the same time. The strange thing is that ble initialization works, ble advertising works as well while doing wifi activity, but whenever a master connects (I'm using a simple GATT service implementation) connection callback is never called, with code running in spi low-level management driver. Also, starting at that exact moment, wifi communication stops working.

I tried to set ES_WIFI_USE_SPI to 0, but it seems that DISCO_L475VG_IOT01A_wifi lib only contains spi implementation, related to es_wifi_io.h and .c.

Is there an alternative implementation for UART?

By the way, I also tried to manage callback dispatching for the two modules with two separate threads acting each on a separate event queue, with a shared mutex used to access spi bus in a mutually exclusive way, but it seems that spi internal state is not properly managed by low-level drivers, with several cross-talking data issues...

posted by Lorenzo Maiorfi 30 Dec 2017