WINC1500 with STM32F407

Go To Last Post
64 posts / 0 new

Pages

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

Goiatz wrote:

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

Hi Goiatz

I have the same problem with PIC32 MCU, how did you solve it?

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

Hello s.fiore,

I had also the same problem as many people here with the wait_for_bootrom function. For me it looks like that sometimes the firmware gets in a state of error in the and is not able to perform a reset by software so it hangs forever in this loop.

My solution was to add a reset througt the reset pin in the and considerably increase the sleep times.

 

by the way I have also here the Adafruit shield for the ATWINC1500 adafruit provides some libraries to operate the shield and in their library the sleep time of the reset function is considerably bigger.

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

Note that the last post in this thread, before s.fiore resurrected it, was one year ago - so it is unlikely that that the original posters are still listening!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Erick1989 wrote:

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.


Thank you Erick,

Did you only increase the duration of the nm_bsp_reset () function?

Did you insert some more reset than that within the nm_bsp_init () function?

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

I did increased the nm_bsp_reset() time and I also insert the reset function in other places, unfortunatelly I do not have time to look for it preciselly now.

I recall that after unsucessful SPI initialization the master, your mcu, only received the same byte sequence no matter what you sent to the SPI than the software after some tries branches to a reset command thought SPI bus.

Just under this reset using SPI I insert a nm_bsp_reset() and a sleep function after that I was not able to cause the problem again.

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

Hello All,

 

I have SPI bus error issue in WINC1500 + NUCELO_F429ZI board, It reads the chip ID firmware version correctly. but Write block is failed while sending the connect command. I have connected using the Jumper wires with WINC1500 XPRO board and NUCLEO_F429ZI board.

 

Please advice on this issue, I stuck here. 

 

Console Log:

System clock by default 180 MHz 

--------------

Chip ID 1503a0
Firmware ver   : 255.6.0 Svnrev 16368
Firmware Build Apr  6 2018 Time 17:16:54
Firmware Min driver ver : 19.3.0
Driver ver: 19.5.4
Driver built at Jun 27 2018     16:21:07
main: m2m_wifi_init call error!(-6) --> -6 stands for Bus error.

 

 

---------------------------------------------------------------------------------------------------

void nm_bus_wifi_spi_init(SPI_HandleTypeDef *hspi)

{

    GPIO_InitTypeDef  GPIO_InitStruct;

 

    /* Peripheral clock enable */

    SPI_WIFI_CLK_ENABLE();

 

    /* Configure GPIO pin : PA4 - we are using ST GPIO definitions for winc1500 */

    GPIO_InitStruct.Pin   = SPI_WIFI_CS_PIN;

    GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;

    GPIO_InitStruct.Pull  = GPIO_PULLUP;

    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;

    GPIO_InitStruct.Alternate = 0;

    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    HAL_GPIO_WritePin(SPI_WIFI_CS_GPIO_PORT,SPI_WIFI_CS_PIN,GPIO_PIN_SET);

 

    /**SPIx GPIO Configuration

    PB3     ------> SPI_WIFI_SCK

    PB4     ------> SPI_WIFI_MISO

    PB5     ------> SPI_WIFI_MOSI

    */

    GPIO_InitStruct.Pin = SPI_WIFI_SCK_PIN|SPI_WIFI_MISO_PIN|SPI_WIFI_MOSI_PIN;

    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;

    GPIO_InitStruct.Pull = GPIO_PULLDOWN;

    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;

   GPIO_InitStruct.Alternate = SPI3_WIFI_AF;

    HAL_GPIO_Init(SPI_WIFI_MOSI_GPIO_PORT, &GPIO_InitStruct);

}

 

 

/*

* @fn nm_bus_init

* @brief Initialize the bus wrapper

* @return M2M_SUCCESS in case of success and M2M_ERR_BUS_FAIL in case of failure

*/

sint8 nm_bus_init(void *pvinit)

{

sint8 result = M2M_SUCCESS;

 

/* WiFi SPI init function - called from nm_bus_init() */

 

hspiWifi.Instance    = SPI_WIFI;

hspiWifi.Init.Mode    = SPI_MODE_MASTER;

hspiWifi.Init.Direction    = SPI_DIRECTION_2LINES;

hspiWifi.Init.DataSize    = SPI_DATASIZE_8BIT;

hspiWifi.Init.CLKPolarity    = SPI_POLARITY_LOW;

hspiWifi.Init.CLKPhase    = SPI_PHASE_1EDGE;

hspiWifi.Init.NSS    = SPI_NSS_SOFT;

hspiWifi.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;

hspiWifi.Init.FirstBit    = SPI_FIRSTBIT_MSB;

hspiWifi.Init.TIMode    = SPI_TIMODE_DISABLE;

hspiWifi.Init.CRCCalculation   = SPI_CRCCALCULATION_DISABLE;

hspiWifi.Init.CRCPolynomial    = 10;

//   hspiWifi.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;

//   hspiWifi.Init.NSSPMode = SPI_NSS_PULSE_DISABLE;

if (HAL_SPI_Init(&hspiWifi) != HAL_OK)

{

M2M_ERR("SPI bus Initialization error\r\n");

}

 

HAL_SPI_MspInit(&hspiWifi);

return result;

}

 

 

 

 

 

 

Saravana

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

Hi everyone,

 

I'm aware that this thread is inactive but I'm hoping that someone with some knowledge of this may read this. I'm attempting to use the WINC1500 with an STM32F7 board and cannot get the winc chip to respond. The problem I have is that wait_for_bootrom() is never terminating because spi_read_reg in nmspi.c is failing to read a response. I can see that the single read command is being sent, and the response command is also being sent. When it tries to read the response in spi_data_read(), the code is never finding the response header. I can see that the loop is looking for a byte beginning with 0xF, however the response I am getting is 0x20. Due to this, the do-while loop is exiting after retry hits zero and the message "[mni spi]: Failed data response read...(%02x)" is being shown.

 

I am using the same spi settings as the ones used in the code posted by Harwinder. I have replaced the HAL library files with the equivalent stm32f7xx files.

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

Hi sir,

i want to interface ATWINC3400  wifi/ble module with host STM32H7 ,using uart and spi i have interfaced but host application code is developing using KEIL

how do i  import ATWINC3400 libraries and driver code from atmel studio  to keil 

 

 

Thanks

 

 

Last Edited: Thu. Nov 14, 2019 - 09:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would suggest you download the latest ASF 3.47.0 first. The WINC3400 driver is in <common\components\wifi\winc3400\wifi_drv> folder. APIs you need to port for your hardware are in the <bsp\source> and <bus_wrapper\source> folders. The goal is to provide equivalent functions listed in nm_bsp.h and nm_bus_wrapper.h for your hardware.

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

Hii harwinder

 

      i have been trying to port the ATWinc3400 wifi code to stm32h7 controller. i downloaded the ASF 3.47 and trying to port.

  1)how to port and which files need to add 

 

Please provide any reference to port

 

Thanks

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

Hello sir,

    I am working on ATWINC3400 Module with STM32H753IIT6 board and I am facing the same issue that execution is blocked in wait_for_bootrom can you please tell me how you solved that issue so it will be helpful for me. 

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

Hello,

 I am working with WINC3400 module and interface with STM32H753IIT6 facing the same issue of bootrom can you please tell how you solved that it will be helpful for me.

 

Thank You.

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

hello

If the voltage of the Battery input is too low, you see this same problem

Hans T

Pages