Skip to main content
Robert Kwan
Associate II
April 26, 2017
Question

IDW01M1 Wifi Sample Codes for STM32F411RE

  • April 26, 2017
  • 24 replies
  • 5417 views
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
This topic has been closed for replies.

24 replies

Mridupawan Das
Visitor II
April 26, 2017
Posted on April 26, 2017 at 10:13

Hi,

by default the bin's are built for X-NUCLEO-IDw04A1.

you need to re-build for IDW01M1.

Also F411RE is not supported by default and you need to build with F411RE drivers idelly.

Robert Kwan
Associate II
April 26, 2017
Posted on April 26, 2017 at 19:54

Thanks for the info, Mridupawan!

Then I will have a lot to figure out...

1. Which parameter/s should I modify to make it built for X-NUCLEO-IDW01M1 instead please?

2. My original F411RE environment is just GCC-based command line with Cygwin

   and so I don't know how easy to incorporate the sample folder structure.

   I think /EWARM sub-folder in sample app is for IAR ARM IDE, /MDK-AM sub-folder is for Keil ARM IDE

   but no idea on what /SW4STM32 sub-folder is for which IDE?!

   And all of these have only /STM32F401RE-Nucleo reference folder but no STM32F411RE-Nucleo reference folder, so I am not sure what should be modified?!

Any suggestion please?

Thanks & Best Regards,

Robert

Robert Kwan
Associate II
April 27, 2017
Posted on April 27, 2017 at 00:55

Hello!

I have found out that

https://developer.mbed.org/teams/ST/code/HelloWorld_IDW01M1v2/

would work if I import their sample code to the online mbed compiler to compile for F411RE.

It will just work fine when I flash the .bin from the online mbed compiled output.

However, if I try to export the codes for toolchain: Make-GCC-ARM for NUCLEO-F411RE

as in

https://developer.mbed.org/teams/ST/code/HelloWorld_IDW01M1v2/export

it would not work at all,

because only the *.lib will be exported but no related *.h to use with the *.lib at all.

And I have no idea if those *.lib would work for F411RE or not at all?!

Therefore, I used

https://developer.mbed.org/teams/ST/code/HelloWorld_IDW01M1v2/compile

to trace out all the files that got compiled by the online mbed compiler and then downloaded all the related *.cpp/*.h to mimick the same.

However, it still doesn't work well as I still have the following compile error which I cannot figure out at all?!

0690X00000606nYQAQ.pngI

I don't know why the codes in SPWFSA01.cpp would cause this invalid conversion from 'int' to 'const char*' error...

   SPWFSA01::SPWFSA01(PinName tx, PinName rx, PinName reset, PinName wakeup, bool debug)

    : _serial(tx, rx, 1024), _parser(_serial),

      _reset(reset, PIN_OUTPUT, PullNone, 1),

   _wakeup(wakeup, PIN_OUTPUT, PullNone, 0),

    dbg_on(debug)  <=== Problem HERE?!

{

    _serial.baud(115200);  // LICIO  FIXME increase the speed

    _parser.debugOn(debug);

}

Any idea please?!

Thanks & Best Regards,

Robert

Robert Kwan
Associate II
April 28, 2017
Posted on April 29, 2017 at 01:34

Hello Mridu,

Thanks for your message.

It's really frustrating and disappointing after trying so many different ways but still not able to get it working at all!

In fact, I was hoping that this Wifi module is more powerful and easy to use

as I already can use the ESP8266 NodeMCU ok.

I modified the IAR Project General Setting like this:-

0690X00000606rRQAQ.png

but not sure if any other details I may have missed?!

Looking forward to receiving your update soon.  Thanks.

On the other hand, I even tried to compile with the System Workbench but I found it difficult to get the project files set up correctly and so I gave up.

I will try to install Keil MDK IDE to see if it would make any difference later if I have time.

I know that my hardware should be ok because I tried the mbed sample codes and it worked but it doesn't have the mini AP capability I need unfortunately...

Thanks & Best Regards,

Robert

Mridupawan Das
Visitor II
April 29, 2017
Posted on April 29, 2017 at 12:17

Hi Robert,

here is a quick way to port to F411RE which I tried.(of which you have already done some steps)

Let's take the example of the WiFi_VCOM Application and toolset IAR (EWARM folder).

1. Inside EWARM, copy the 'STM32F401RE-Nucleo' and rename to 'STM32F411RE-Nucleo'

2. Copy two files: 'startup_stm32f411xe.s' and 'stm32f411xe_flash.icf' inside above created folder (You can find these files in examples of STM32Cube_FW_F4_Vx.yy.0 driver applications downloaded from the st website)

3. Open the project.eww and then open Project Settings

4. In 'General Options' tab, select correct device name: 'ST STM32F411RE'

5. In 'C/C++ Compiler->Preprocessor' tab, change 'Defined Symbols:' value: STM32F410xE to STM32F411xE

6. In 'Linker->Config' tab, select correct linker script file 'stm32f411xe_flash.icf' (already copied to home directory in previous step)

7. In workspace project file view: Example->EWARM-> select correct startup file: '

startup_stm32f411xe.s

' (already copied in home directory in previous step)

8. Build Project-> should be clean without errors.

Run project and check.

Type in console (tera-term). By default, module echo is OFF, so you will not see what you type unless you enable echo on your terminal.

Type AT and press enter and you should see OK as response on the terminal.

Test other AT commands.(e.g. AT+S.STS, AT+S.GCFG=...etc.)

Above steps worked for me.

I also checked Client_Socket example, which worked on the F411RE as well.

Hope I did not miss any step.

Let us know.

regards,

Mridu 

Duy Tran
Associate III
January 28, 2018
Posted on January 28, 2018 at 18:52

Hi

Das.Mridupawan

,

I tried your way to convert from F401RE to F411RE Nucleo but it failed. There is an error in file

stm32f4xx_ll_dma.h

Error[Pe020]: identifier 'DMA_SxM1AR_M1A' is undefined D:\Outstanding STM32\STM32CubeExpansion_WIFI1_V3.1.1\Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h 1621

I used the HTTP_Request example. Can you have a little look it it? Thank you so much. I think IAR is the most simple way to convert from F401RE to F411RE. I tried with Keil but it failed.

Best regards,

Duy

Robert Kwan
Associate II
May 1, 2017
Posted on May 01, 2017 at 20:37

Hi Mridu,

Thanks for your information.

I have already done most of your steps before.

The only difference was the .icf which I didn't know where to find and so I just renamed the F401 to F4

Now I got the right one as you pointed out.

However, my result is still same as before.

No response after typing AT.

I wonder if there is any tool or HW version issue as I can see that some other users are having similar issues

but no problem from your side.

I am using:-

And I noticed that the LEDs on my IDW01M1 Wifimodule would have only the GREEN light ON from all these sample app here. Is this correct?!

Because when I ran the mbed example, not only the GREEN LED but also the YELLOW LED would be ON and then I could see the RED and BLUE ones flashed at the beginning (maybe during reflash or init?!)

And after the reflash, the GREEN LD2 on F411RE board will also flashes.

All these are quite different from the XCUBE IDW01M1 Wifi Sample Codes.

Is the YELLOW LED supposed to be ON after correct Wifi module initialization even for XCube Wifi Sample Codes please?!

I don't have the scope to probe the GPIOs yet as I could see that you and others are helping Kerry in the other thread

but I think that our problems are similar. And so that's why if our IDW01M1 Wifimodules are newer Hardware version

than the ones you use now?!

Thanks & Best Regards,

Robert

Robert Kwan
Associate II
May 1, 2017
Posted on May 01, 2017 at 23:10

Hi Mridu,

Can you post your functional .bin for me to try please?!

Again, mine is with:-

#ifdef USE_STM32F4XX_NUCLEO 

#define CONSOLE_UART_ENABLED

#define SPWF01 => for X-NUCLEO-IDW01M1?!

//#define SPWF04 => for X-NUCLEO-IDw04A1?!

#endif

And I also tried to capture my setup photos for you to check here please.

0690X00000603oNQAQ.jpg0690X00000603oSQAQ.jpg

Thanks & Best Regards,

Robert

Tesla DeLorean
Guru
May 2, 2017
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 VenmoUp vote any posts that you find helpful, it shows what's working..
Mridupawan Das
Visitor II
May 2, 2017
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

Robert Kwan
Associate II
May 2, 2017
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

Robert Kwan
Associate II
May 2, 2017
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
May 25, 2017
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!

Gerardo GALLUCCI
ST Employee
May 27, 2017
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
May 30, 2017
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

Mridupawan Das
Visitor II
May 30, 2017
Posted on May 30, 2017 at 13:54

Hi Robert,

Are you getting all data through UART OK?

Is ring_buffer getting filled up with characters from the UART?

If not then there is some problem with UART (maybe driver etc.).

If yes, then then WIND:32 should be detected (which is the condition when it gets out of the wifi_reset() loop)

Regards,

Mridu

Robert Kwan
Associate II
May 30, 2017
Posted on May 30, 2017 at 16:22

Hi Mridu,

Thanks for the suggestion.

I will try to hook up Eclipse and OpenOCD to see if I can check the ring_buffer() then.

I think that it's pretty likely...

However, even if it is so, I still have no idea on how to go deeper down with the UART HAL driver then...

Anyway, I will try and update you later tomorrow...

Thanks & BR,

Robert

Robert Kwan
Associate II
May 31, 2017
Posted on May 31, 2017 at 02:44

Hello Mridu,

I just used the Eclipse & OpenOCD to see the ring_buffer info

and I can see that

0690X00000607CmQAI.png

The elements inside the wifi_instances.big_buff does have all the WIND:1:Poweron msg, etc..

So does it mean that somehow the UART path is broken due to mix build with mbed UART HAL driver and so those msgs cannot be popped up in the TeraTerm?!

Or as I suspect that my LinkerScript.ld cannot handle that correctly?!

(I sent that script.ld to your email last week.)

Thanks & Best Regards,

Robert