WINC1500 with STM32F407

Go To Last Post
51 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Everyone smiley,

 

I have purchased WINC1500 module from ELEMENT14 INDIA and designed PCB for the module. I want to interface it with the STm32F407.

As per the ATMEL SPI Porting Guide, I have port the stack on the STM controller. But, it is giving initialization error. Then using the debugger, I found that during initialization, the stack is transmitting following bytes over the SPI :

b[0]=0XCA ;  COMMAND

b[1]=0X00 ;   add>>16

b[2]=0X10 ;   add>>8

b[3]=0X00 ;   add

b[4]=0XCA ;   CRC 7

 

SPI is transmitting the correct bytes serially and it is observed on the CRO.

Stack expects the response from the WIFI module but it gives no response , it gives 0x00.

DESIRED RESPONSE PACKET FROM MODULE : ( 0xCA, 0xF).

 

Kindly suggest me some solution for the above mentioned problem I am facing.

 

Regards

Harwinder

 

Last Edited: Fri. Oct 16, 2015 - 12:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

What frequency your SPI is running at? You may want to lower it to like 12 MHz for a start.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am Using 12Mhz,But i have try other also 8Mhz ,4Mhz,1Mhz,16Mhz but it gives same response.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Then I would look at other pins next, like CE, SS, WAKE.

 

In general, I really have no idea how to debug this.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Harwinder wrote:
I have purchased WINC1500 module ... and designed PCB for the module.

Before going to a custom PCB, have you got this working on a development/evaluation board?

 

It's always good to start from a known-good system - then, when your custom hardware doesn't work, you can compare & contrast the known-good system.

 

Are you sure you have the correct SPI Mode?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes I used the correct SPI mode (SPI Mode 0) according to datasheet.In atmel studio WINC1500 examples i have seen that they are using SPI mode 0.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Harwinder wrote:
In atmel studio WINC1500 examples i have seen that they are using SPI mode 0.

The trouble with SPI - unlike, say, I2C - is that it has no official definition.

 

So, while is probably safe to assume that Atmel's meaning of "SPI mode 0" is the same as ST's meaning of "SPI mode 0" - that is not guaranteed...

 

See: http://www.avrfreaks.net/comment...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

Quote:

So, while is probably safe to assume that Atmel's meaning of "SPI mode 0" is the same as ST's meaning of "SPI mode 0" - that is not guaranteed...

 

See: http://www.avrfreaks.net/comment/1566616#comment-1566616

I Re conformed that in atmel Example they use CPOL=low,CHPA=low, And i have set the same setting in STM.So there no issue in SPI mode.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And, similarly, you're sure that Atmel's meanings of "CPOL" and "CHPA" are the same as ST's ?

 

Again, having a known-good reference system would help ...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi Harwinder, i actually have the development kit for the WINC1500 and have some of the examples up and running.

One thing i will point out is that this is a relatively new product and has bugs as i have found.

i have been informed that there is a new version of ASF due out at some stage to address issues which i am waiting on.

There is no API documentation available that i can find as yet.

So maybe there is more you need to do than just send that command and expect an answer.

Where did you get the information from to port your code across to the STM part ?

I would really suggest as awneil suggested that you get a development kit and then you can look at the commands sent and compare to your ported code.

 

Paul

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As rev says, the support for this product is, shall we say, "not fully mature" - even on Atmel's own processors.

And the support does seem to rely upon ASF - which is no help to you.

 

So, unless you have some really solid direct FAE support on this (which doesn't seem to be the case?), I think you may be in for an uphill struggle ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You may want to take a look at the Software code used on the ATSAMW25-XPRO for inspiration.

SAMW25 is SAMD21+WINC1500 in a module.

 

Link to ATSAMW25-XPRO board and datasheet:

http://uk.futureelectronics.com/en/Search.aspx?dsNav=Ntk:PartNumberSearch%7catSAMW25%7c1%7c,Ny:True,Nea:True

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A new version of ASF was released today which solved the issues i have had.

But i noticed there is still no API documentation.

So not sure how you ported your code across.

 

Paul

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK Thanks Everyone for your support.i have attached the spi porting guide pdf so please check it.I am going to buy development kit from atmel.After running examples on that i will post the whole code for how to use winc1500 with STM32 or any other MCU.

 

Thanks

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Harwinder ..

 

can you please share how to use winc1500 with any other MCU? I mean without using the API.

 

Thanks

 

 

All in Time.
 

Last Edited: Thu. Aug 27, 2015 - 11:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hello Everyone,

Finally i have port the winc1500 code to STM mcu. I have attached the full project made in Keil MDK5 for STM32F407 microcontroller.we Port to any mcu by changing only two files.

1:-nm_bsp_samd21.c

2:-nm_bus_wrapper_samd21.c

So please refer to attachment and look how to port and if you have any probelm in porting let me know about that i will try my best to solve it.

Thanks

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Harwinder,

 

Thank you for the project. Please can you send me the détails of the STM32F4 pins used for WINC1500 (INT, SPI, Chip Enable, ...)  on this project

 

Best regards,

Last Edited: Wed. Jan 27, 2016 - 09:19 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

winc Reset =PB1

Chip Select =PB2

IRQN          =PB0

SCK           =PB10

Mosi,miso =PC2,PC3

SS           =PD14

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thankyou. But in your project you are using PA1 PA2 PA3 PE3 PA4 in main.c and PA5 6 7 for spi. Have you a version uptodate ? Thx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ohh actually you are reading comments in code those are wrong. so please donot read comments see code i had used these pins that i mention in reply.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In fact, I found the use of the PAxx also in the code 

 

void nm_bsp_reset(void)
{
    HAL_GPIO_WritePin(GPIOA,CONF_WINC_PIN_CHIP_ENABLE,GPIO_PIN_RESET);
    HAL_GPIO_WritePin(GPIOA,CONF_WINC_PIN_RESET,GPIO_PIN_RESET);
    nm_bsp_sleep(100);
    HAL_GPIO_WritePin(GPIOA,CONF_WINC_PIN_CHIP_ENABLE,GPIO_PIN_SET);
    nm_bsp_sleep(10);
    HAL_GPIO_WritePin(GPIOA,CONF_WINC_PIN_RESET,GPIO_PIN_SET);
    nm_bsp_sleep(10);

 

Can you share us an uptodate version please ?

 

Thank you

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ya you are right

sorry i get confused b/w 2 codes so now right pins for code that is upload by me is

winc Reset =PA1

Chip Select =PA2

IRQN          =PA0

PA5     ------> SPI1_SCK

  PA6     ------> SPI1_MISO
    PA7     ------> SPI1_MOSI 

SS           =PA3

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you,

 

I Have tested the pinout, the initialization is sussessful but the execution is bloqued on the function wait_for_bootrom :

 

 while(1) {
  reg = nm_read_reg(0x1014); / wait for efuse loading done /
  if (reg & 0x80000000) {
   break;
  }

 

What mean ?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it will wait for response from winc1500 module so if you are using debugging then run it it may take some time.use serial terminal to monitor what is going on.and also please write in English i was confused in bootrom.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you

 

Now I have this Debug message 

 

HELLO....(APP)(INFO)Chip ID fff5ffff
main: m2m_wifi_init call error!(-5)

 

I use a STM32F407 Discovery board

 

Why in the beginning of the main, you putted PE3 and PA4 on high level ?

Last Edited: Wed. Jan 27, 2016 - 02:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

send me your circuit diagram only then i can tell u about error.

in main i putted PE3 and PA4 on high level  because i am using discovery kit so PE3 is enable pin of some other chip on board so to disable that i putt it high.and PA4 is SS pin so i put it on high so that winc process only valid data.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you,

 

here is a picture of the board STM32F4 Discovery connected to the WINC1500-X-Plained and the used pinout 

 

Thank you

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok connect VBAT=3V Also and try then and let me know .

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

which VBAT ? on board or Winc ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

VBAT on winc side to 3V

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, I dont find a VBAT pin on the WINC1500 X Plained Kit

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

try this code with same connections

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Same problem. I obtained on the console the message :

 

ELLO....se read...(00)(APP)(ERR)[spi_data_read][379][nmi spi]: Failed data response read...(00)
(APP)(ERR)[spi_read_reg][619][nmi spi]: Failed data read...
(APP)(ERR)[spi_data_read][379][nmi spi]: Failed data response read...(00)
(APP)(ERR)[spi_read_reg][619][nmi spi]: Failed data read...
.........

.......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It means your connection are not correct so recheck ur connection by multimeter this code is working for me for for same hardware

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you very much! this topic is what I'm looking for,

 

Do you try this with Xplained module? or just ATWINC1500 with your own schemetic?

 

If you using Xplained module, where do you connect the ID pin? No connect? or VCC, GND, or another GPIO?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In your picture, PA4 has connection(must have no connection) & PA0(must connect to IRQ) has no connection, I think you have a wrong connection.

Last Edited: Thu. Feb 4, 2016 - 06:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how could you get that message? From uart?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

 

finally the WINC1500Xplained works  on STM32L476 :)

 

I have used the same code of Harwinder and I have only changed the SPI Baudrate Prescalar to 256

 

Thank you Harwinder for your help :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you mean this one?

 

hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;

 

4 to 256?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone,

 

I am trying to use winc1500 with STM32f429I-disco kit . 

But I am not able to read CHIP id. I am getting error same as above.

 

"HELLO....(APP)(INFO)Chip ID fff5ffff
main: m2m_wifi_init call error!(-5)
"

 

Does any one help me here?

 

I have configured following pins for my board.

SPI4 

SCK--> PE2

NSS --> PE4

MISO--> PE5

MOSI --> PE6

 

Wake --> PF3

IRQ--> PF2

Chip enable --> PF5

Reset --> PF6

 

I trying to use "Harwinder" 's code for my reference. 

Thanks for your time.

--Regards,

Meet Shah

 

 

--
Regards,
Meet Shah

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HELLO 

can you upload your project in file .Zip, for see what are you did :) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

   hi Harwinder i need your helps! 

i make a connection between a STM32f427 and WINC1500, i used your programme( i juste changed pins)! 

 

in initialisation "ret = m2m_wifi_init(&param)" , ret is != to M2M_SUCCESS, i don't know who are my problem 

if (M2M_SUCCESS != ret) {
        printf("main: m2m_wifi_init call error!(%d)\r\n", ret);
        while (1) {
        }
    }

 

thanks ! 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

for more precision my problem is here: 

    /* Apply device specific initialization. */
    ret = nm_drv_init(NULL);
    if(ret != M2M_SUCCESS)     goto _EXIT0;

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

my Ret value is matched here :     

 

if(strtmp.u8FirmwareMajor != M2M_DRIVER_VERSION_MAJOR_NO
            || strtmp.u8FirmwareMinor != M2M_DRIVER_VERSION_MINOR_NO)
    {
        ret = M2M_ERR_FW_VER_MISMATCH;
        M2M_ERR("Firmware version mismatch!\n");
    }

 

in this case Ret= -13, this is an error! 

 

someone can explain me what means! 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, please I want to know how you solved the problem of receiving 0x00 all the time? Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, I've recompiled the Atmel library for a cortex M3 STM32F100, with the Atollic Truestudio.

It's the temperature demo, so the sockets are working.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I'm working with ATWINC1500 module and STM32F103ZETb MCU. I have ported nm_bsp_samd21.c and nm_bus_wrapper_samd21.c to my MCU, and proved that the firmware is communicating correctly through the SPI interface. But when I've started with the software that ATmel provides, I have a problem in the wait_for_bootrom function, because I never reach the register to be 0x80000000 so I can't break from the loop. I mean this piece of code:

 

while(1) {
        reg = nm_read_reg(0x1014);    /* wait for efuse loading done */
        if (reg & 0x80000000) {
            break;
        }
        nm_bsp_sleep(1); /* TODO: Why bus error if this delay is not here. */
    }

 

I have looked to the code you provide and use it with the MCU you use, and it works, I have compared to my code but I'm not able to find the error. Does anybody know which can be the problem for that and how to resolve?

 

Thank you very much beforehand,

Goiatz

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everybody,

 

does anybody know the maximum UDP streaming data rate that can be achieved with Atmel's WINC1500 API?

I just achieve about 200kbps (Host MCU: 80Mhz main-clock, 40Mhz SPI-clock).

 

And it is possible to disable the green LED from winc1500 xplained pro extension board by host MCU?

 

Thanks for help,

Thinu

Last Edited: Sun. Feb 26, 2017 - 07:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello sir, where did you find the code such as "nm_bsp_samd21.c ". I can't find it on the website. Would you please share the information to me?  Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, everyone,

 

This post literally saved my life, in my current work I must port the code from ATWIN1500C to STM32F04 Discovery board but I am having a lot of trouble doing it, from tomorrow on I am going to use the code which was supplied here.

Thought I still have a question, during the last weeks I have been working restlessly on porting the code I am using STM32F04 Discovery and System Workbench and I can't go forward and get the code to compile. First I created a project in StmCube than using this base I imported all files to System Workbench Project and tried to correct all the errors especially related to the indexer.

 

What was the procedure that you used to get the code working? Which steps?

 

Thank you, everyone, for your help.