cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing ISM43362 wifi module via UART (B-L475E IOT Board)

martinj3456
Associate III
Posted on April 15, 2018 at 01:49

Hi all,

Have anyone tried to interface ISM43362 wifi module with STM32 via UART? Is there any available UART driver or example-tutorial?

In a custom PCB, we have connected ISM43362 module with L476 UART pins following B-L475E-IOT01 schematic. Later I found that the wifi driver in B-L475E-IOT01 is only provided for SPI (although ISM43362 is connected with both SPI and UART pins in

B-L475E-IOT01

). I'm not finding (over

internet) any UART driver for ISM43362 module that can be ported to this project.

In the first attempt, I've started with B-L475E-IOT01 board and WiFi_Client_Server cube example and tried to replace SPI pin configuration by UART pins and SPI Transmit-receive instructions by UART Tx-Rx. It didn't work, probably SPI and UART communication protocol is different for ISM43362. I'm not finding the exact sequence of AT commands in the AT manual.

Please guide me if anyone interfaced

ISM43362 wifi module via UART.

Thank you in advance for your kind suggestion.

14 REPLIES 14
Posted on May 03, 2018 at 09:14

Hi Martin,

Its quite simple to make a UART interface to 

ISM43362 wifi module. 

If you can see the call flow of 0690X0000060AxlQAE.png

Please make a UART init in WIFI_init and use the HAL APIs to read / write from the interface. 

Hope this helps you. 

Thanks

Phanirajkiran

Jessy J
Associate II
Posted on May 03, 2018 at 09:25

I am using STM32F4 EVALUATION Board. I want to implement an echo server based on netconn. I did the configuration of ethenret and tcp/ip and lwip. When I ping it works correctly but when type ' C:\>echotool IP_address /p tcp /r 7 /n 15 /t 2 /d Testing LwIP TCP echo server' in the command prompt it shows me this error ' reponse time out ' I did not understand why it is not working ??? 

when I debug the programm I noticed that the OS by osKernelStart does not call the function of tcpecho_thread that contains the foncions of receiving and sending datas. But it calls all the other thread.. I did not understand why It does not call the thread of tcp echo server. 

I used this code for the tcp echo server 

/*

* tcp_echoserver.c

*/

//Includes

#include 'DeclarationsCommunes.h'

#if LWIP_TCP

#if LWIP_NETCONN

#include 'lwip/sys.h'

#include 'lwip/api.h'

#define TCPECHO_THREAD_PRIO ( tskIDLE_PRIORITY + 4 )

/*tcpecho_thread function description*/

void tcpecho_thread(void *arg)

{

struct netconn *conn, *newconn;

err_t err, accept_err;

struct netbuf *buf;

void *data;

u16_t len;

LWIP_UNUSED_ARG(arg);

/* Create a new connection identifier. */

conn = netconn_new(NETCONN_TCP);

if (conn!=NULL)

{

/* Bind connection to well known port number 7. */

err = netconn_bind(conn, NULL, 7);

if (err == ERR_OK)

{

/* Tell connection to go into listening mode. */

netconn_listen(conn);

while (1)

{

/* Grab new connection. */

accept_err = netconn_accept(conn, &newconn);

/* Process the new connection. */

if (accept_err == ERR_OK)

{

while (netconn_recv(newconn, &buf) == ERR_OK)

{

do

{

netbuf_data(buf, &data, &len);

netconn_write(newconn, data, len, NETCONN_COPY);

}

while (netbuf_next(buf) >= 0);

netbuf_delete(buf);

}

/* Close connection and discard connection identifier. */

netconn_close(newconn);

netconn_delete(newconn);

}

}

}

else

{

netconn_delete(newconn);

}

}

}

/****************** SERVER CODE ****************/

/*TCP echo server thread is created in tcpecho_init function*/

void tcpecho_init(void)

{

sys_thread_new('tcpecho_thread', tcpecho_thread, NULL, DEFAULT_THREAD_STACKSIZE, TCPECHO_THREAD_PRIO);

}

#endif /* LWIP_TCP */

#endif /* LWIP_TCP */

I am so blocked. Can anyone help me please ?? 

Posted on May 03, 2018 at 10:52

Hello Martin

First to debug this sort of issue is. Can you debug whether a first context switch is happening to your code or not. Please check this.

Thanks

Phanirajkiran

Jessy J
Associate II
Posted on May 03, 2018 at 10:57

I debug it but it blocks in the function that call the tcpechoserver ' 

tcpecho_init() ' when I stop the debug it goes to the 'portmacro.h ' file .. If I understandit well is it a problem of interrupt or memory of the heap. 

Another question how to configure the heap memory ?? 

I am using freeRTOS v9.0.0 

From stm32cubMX configuration I got only the 'heap_4.c' file 

Posted on May 03, 2018 at 11:58

can you attach Portmacro.h. Looks to heap issue.

Once have a look to this VDO:

https://www.youtube.com/watch?v=C-Fg434jCdc

Please check the size of heap instartup_stm32XX.s ,

Heap_Size EQU

Please once readUM1722 manual from ST.

The total amount of available heap space is set by configTOTAL_HEAP_SIZE - which is defined in FreeRTOSConfig.h.

The xPortGetFreeHeapSize() API function returns the total amount of heap space that remains unallocated (allowing the configTOTAL_HEAP_SIZE setting to be optimised), but does not provide information on how the unallocated memory is fragmented into smaller blocks.

Thanks

Phanirajkiran

Jessy J
Associate II
Posted on May 03, 2018 at 12:07

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6ua&d=%2Fa%2F0X0000000bxr%2FLWaZIRQ09LcxdXmHODwRMgWGDxAEE_.2Yz_bcGzB6F0&asPdf=false
Posted on May 03, 2018 at 12:14

Hey echo server on STM32 is there on this manual.

Please once check this  UM1713

DM00103685.pdf file name.

http://www.st.com/content/ccc/resource/technical/document/user_manual/65/e8/20/db/16/36/45/f7/DM00103685.pdf/files/DM00103685.pdf/jcr:content/translations/en.DM00103685.pdf

 0690X0000060AyFQAU.png0690X0000060AuFQAU.png
Jessy J
Associate II
Posted on May 03, 2018 at 12:17

Yes I have this document and I am following it already and I did all what is supposed to be done but I do not know why I can not connect to the echo server. I does not recognize the IP dress when I ping it in the command prompt. I have two months now blocked in this situation and I do not what to do 

Thank you for your help

Posted on May 03, 2018 at 12:36

Hey you are getting response timeout. 

When i see the other link : its request time out .

https://forums.xilinx.com/t5/Embedded-Processor-System-Design/LwIP-echo-Server/td-p/25966

 

Just increase time out instead of 2 make it 6.

https://www.freertos.org/FreeRTOS_Support_Forum_Archive/January_2013/freertos_STM32_FreeRTOS_and_lwIP_-_Timeout_problems_6566052.html