cancel
Showing results for 
Search instead for 
Did you mean: 

IDW01M1 Wifi Sample Codes for STM32F411RE

Robert Kwan
Associate II
Posted on April 26, 2017 at 07:24

Hello!

I recently bought the IDW01M1 WiFi expansion board 

and I am trying to have it working with the STM32F411RE.

However, from the examples in en.x-cube-wifi1_firmware.zip,

I can find the .bin file for STM32F401RE-Nucleo only

and so I tried to flash this WiFi_VCOM .bin to the STM32F411RE board.

I can see LED1 is green, so power is ok.

No other LED On, so module is ok?!

When I use Tera Term, I don't see any output and when I send 'AT', no 'OK' either.

So my question is that  F401RE .bin image cannot work directly on F411RE board please?!

Since I am still a newbie to this WiFi module, I am not sure if it will be easy to recompile the sample application for F411RE then?!

Any suggestion / comment is welcome.

Thanks & Best Regards,

Robert

#stm32f411re-wifi-idw01m1
41 REPLIES 41
Posted on May 02, 2017 at 04:15

Photos would be far more effective at higher resolution, the new iteration of the forum is not limited to 100KB images, 2-3MB JPEGs will work much better, and the forum can scale.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Robert Kwan
Associate II
Posted on May 02, 2017 at 09:01

Thanks for the update, Mridu!

Unfortunately, I don't have any other board except all the F411RE here.

However, I don't understand why the hw flow control would be the issue if it works for your F411RE there then?!

Anyway, I just sent you my email address too.

Thanks & Best Regards,

Robert

Posted on May 02, 2017 at 08:22

Hi Robert,

we are actually using an older version of IAR (v7.4). But honestly I don't think that is the issue.

What I do think could be an issue is the hw flow control which is not set on the module.

Do you happen to have any supported boards like Nucleo-F401RE/L476 with you which you can use to run the VCOM example and set the hw flow control on the module and see if that makes any difference?

The LED status you have mentioned while running the mbed example is correct and similar behaviour should happen while running the x-cube examples.

Note: mbed library does not use the flow control and hence you are able to run it correctly.

regards,

Mridu

Posted on May 02, 2017 at 08:49

to share bin image, can you send me your email address to

mailto:mridupawan.das@st.com

Robert Kwan
Associate II
Posted on May 02, 2017 at 19:23

Hi Mridu,

Due to time zone difference I think,

Sorry that I just tried it

And unfortunately, it is still not working with the .bin image you gave.

That seems to match more with what I thought of either compiler tool version or hardware version difference?!

Thanks & Best Regards,

Robert

Robert Kwan
Associate II
Posted on May 25, 2017 at 23:41

After having some more suggestions from Mridu and trying out different things,

I can finally merge our internal mbed based codes with the IDW01M1 Server Socket Sample codes and build ok after some twists here and there.

However, it would still trap in wifi_reset() without passing through successfully!

Therefore, I would really appreciate if anyone can give some more suggestion please.

  1. I basically use all the stm32f4xx_hal_xxx.o from mbed and modified its linker script to make it compilable.

   

  1. from the Server_Socket sample codes, I take all except the main.c and system_stm32f4xx.c (I use the one from mbed.)

   And from the main.c, I take out the initialization code to my main.cpp to start with, i.e.

int main(void)

{

  WiFi_Status_t status = WiFi_MODULE_SUCCESS;

  char *protocol = 't';

  uint32_t portnumber = 32000;

  __GPIOA_CLK_ENABLE();

  HAL_Init();

  /* Configure the system clock to 64 MHz */

  SystemClock_Config();

  /* configure the timers  */

  Timer_Config( );

  UART_Configuration(115200);

#ifdef USART_PRINT_MSG

  UART_Msg_Gpio_Init();

  USART_PRINT_MSG_Configuration(&UART_MsgHandle,115200);

#endif 

  config.power=wifi_active;

  config.power_level=high;

  config.dhcp=on;//use DHCP IP address

  Set_UartMsgHandle(&UART_MsgHandle);

  wifi_state = wifi_state_idle;

  status = wifi_get_AP_settings();

  if(status!=WiFi_MODULE_SUCCESS)

  {

    printf('\r\nError in AP Settings');

    return 0;

  }

  printf('\r\nInitializing the wifi module...\r\n');

  /* Init the wi-fi module */

  status = wifi_init(&config);

  if(status!=WiFi_MODULE_SUCCESS)

  {

    printf('Error in Config');

    return 0;

  }

  printf('\r\nInitializing complete.\r\n');

  1. But it gets stuck at wifi_reset() inside the wifi_init().

  1. Therefore, I suspect if my STMF411XE.ld or Makefile may still be incorrect?!

     Or if it would be even worse if it is due to any mix-up of HAL_xxx drivers please?!

Any suggestion please?

Thanks & Best Regards,

Robert

P.S. The board is working fine if I just run the sample Server_Socket application 'as-is' without any code modification but I can't use it this way because our internal code is based on mbed HAL driver and .cpp codes!

Posted on May 27, 2017 at 11:48

Hi Robert,

I suggest to refer to 

https://community.st.com/wifimodules

. Did you already take a look in there?

What's the content of 

wifi_reset() function?

Regards

jerry

Robert Kwan
Associate II
Posted on May 30, 2017 at 12:08

Thanks, Jerry.

However, I think that you did not get my point from my previous post.

The sample reference code would work on the HW already, so nothing wrong with the HW, I believe.

It is more on the combination on using mbed HAL driver vs the different driver implementation of the sample reference code here...

And I have no clue on how to fix that as I cannot tell where the problem may be in which driver component?!

Or it may be the linkerScript.ld difference between the sample code implementation and mbed HAL implementation, I suspect... but again, I don't know how to deal with that.

Any other suggestion please?

Thanks & BR,

Robert

Posted on May 30, 2017 at 11:35

 ,

 ,

Thanks, Jerry!

So do you mean that I should repost it to the wifi forum please?!

Here is the wifi_reset():

void wifi_reset(void)

 ,

{

 ,

 , RESET_WAKEUP_GPIO_CLK_ENABLE(),

 ,

 , __GPIOA_CLK_ENABLE(),

 , wifi_instances.GPIO_InitStruct.Pin , , , , , , = WiFi_RESET_GPIO_PIN,

 ,

 , wifi_instances.GPIO_InitStruct.Mode , , , , , = GPIO_MODE_OUTPUT_PP,

 ,

 , wifi_instances.GPIO_InitStruct.Pull , , , , , = GPIO_PULLUP,

 ,

 , wifi_instances.GPIO_InitStruct.Speed , , , , = GPIO_SPEED_HIGH,

 , HAL_GPIO_Init(WiFi_RESET_GPIO_PORT, &,wifi_instances.GPIO_InitStruct),

// , IO_status_flag.WiFi_WIND_State.WiFiHWStarted = WIFI_FALSE,

 ,

 , wifi_connected = 0, //reset wifi_connected to get user callback

 ,

// , memset((void*)&,IO_status_flag.WiFi_WIND_State,0x00,sizeof(IO_status_flag.WiFi_WIND_State)), /*reset the WIND State?*/

 ,

 , IO_status_flag.WiFi_WIND_State = Undefine_state,

 , /* === , , RESET PIN - PC12 , , ===*/

 ,

 , HAL_GPIO_WritePin(WiFi_RESET_GPIO_PORT, WiFi_RESET_GPIO_PIN, GPIO_PIN_RESET),

 ,

 , HAL_Delay(200),

 ,

 , /* === , , SET PIN - PC12 , , ===*/

 ,

 , HAL_GPIO_WritePin(WiFi_RESET_GPIO_PORT, WiFi_RESET_GPIO_PIN, GPIO_PIN_SET),

 ,

 , HAL_Delay(50),

 ,

 , HAL_GPIO_DeInit(WiFi_RESET_GPIO_PORT, WiFi_RESET_GPIO_PIN),

 , printf('\r\nOK point 1.5\r\n'),

♯ ifndef WIFI_USE_VCOM

 ,

 , while(IO_status_flag.WiFi_WIND_State != WiFiHWStarted)

 ,

 , , , {

 ,

 , , , , , __NOP(), //nothing to do

 ,

 , , , }

 ,

♯ endif

 ,

}

And the problem is no response for the while() loop above to come out of.

Thanks &, Best Regards,

Robert

Posted on May 30, 2017 at 11:49

If (WiFi_WIND_State != WiFiHWStarted) forever, means SPWF01S was rebooted after a radio off & save (AT+S.WIFI=0 + AT&W + reboot), or SPWF01S was rebooted but it's transmitting to a different baudrate un UART (default is 115200), or SPWF01S was NOT rebooted (is reset jumper closed in the right position?), or other cases...

I suggest to restore SPWF01S to factory configuration via HW (GPIO0 set to 2.5V at boot), check the reset jumper, then try again the init sequence.

Please note the behavior of LEDs on IDW board. Toggling, on, off, ...

jerry