Wi-Fi Combo Forum Discussions
Here's some bugs and fixes that would be good to get into the release:
1. LwIP default interface and static IP
When using a static IP, a default interface is not set (it is for DHCP.) As such, trying to make a TCP connection do a different subnet (with a gateway) fails.
wiced_result_t wiced_ip_up( wiced_interface_t interface, wiced_network_config_t config, const wiced_ip_setting_t* ip_settings )
{
if ( ( static_ip == WICED_FALSE ) && ( config == WICED_USE_EXTERNAL_DHCP_SERVER ))
{
....
/* Bring up the network interface */
netif_set_up( &IP_HANDLE(interface) );
netif_set_default( &IP_HANDLE(interface) );
...
}
else
{
netif_set_up( &IP_HANDLE(interface) );
netif_set_default( &IP_HANDLE(interface) );
....
}
}
2. LwIP TCP client connection
When making a TCP client connection, if it fails the first time, any subsequent retries will crash the app. The netconn itself is deleted, but the pointer is left with its prior no longer valid value.
WICED/network/LwIP/WICED/tcpip.c
wiced_result_t wiced_tcp_connect( wiced_tcp_socket_t* socket, const wiced_ip_address_t* address, uint16_t port, uint32_t timeout )
{
....
lwip_error = netconn_connect( socket->conn_handler, (ip_addr_t*) &temp, port, (uint16_t) timeout );
if ( lwip_error != ERR_OK )
{
netconn_delete( socket->conn_handler );
socket->conn_handler = NULL;
return LWIP_TO_WICED_ERR( lwip_error );
}
3. STM32F2xx SPI master with DMA - clocks not enabled
When using DMA, the peripheral clocks are not enabled.
WICED/platform/MCU/STM32F2xx/peripherals/platform_spi.c
platform_result_t platform_spi_init( const platform_spi_t* spi, const platform_spi_config_t* config )
{
....
/* Init and enable SPI */
SPI_Init( spi->port, &spi_init );
SPI_Cmd ( spi->port, ENABLE );
if ( config->mode & SPI_USE_DMA )
{
/* Enable DMA peripheral clock */
if (spi->tx_dma.controller == DMA1)
{
RCC->AHB1ENR |= RCC_AHB1Periph_DMA1;
}
else
{
RCC->AHB1ENR |= RCC_AHB1Periph_DMA2;
}
}
platform_mcu_powersave_enable();
return PLATFORM_SUCCESS;
}
4. STM32F2xx SPI master with DMA - typo
This bug was reported on forums 2 years but remains unfixed. Address operator missing on DR register.
WICED/platform/MCU/STM32F2xx/peripherals/platform_spi.c
static void spi_dma_config( const platform_spi_t* spi, const platform_spi_message_segment_t* message )
{
DMA_InitTypeDef dma_init;
uint8_t dummy = 0xFF;
....
/* Setup DMA stream for TX */
dma_init.DMA_Channel = spi->tx_dma.channel;
dma_init.DMA_PeripheralBaseAddr = ( uint32_t )&(spi->port->DR);
dma_init.DMA_DIR = DMA_DIR_MemoryToPeripheral;
....
}
5. STM32F2xx SPI master with DMA - typo
This bug was reported on forums 2 years but remains unfixed. RX init has TX in it.
WICED/platform/MCU/STM32F2xx/peripherals/platform_spi.c
static void spi_dma_config( const platform_spi_t* spi, const platform_spi_message_segment_t* message )
{
DMA_InitTypeDef dma_init;
uint8_t dummy = 0xFF;
....
/* Init and activate RX DMA channel */
DMA_Init( spi->rx_dma.stream, &dma_init );
SPI_I2S_DMACmd( spi->port, SPI_I2S_DMAReq_Rx, ENABLE );
....
}
5. STM32F2xx SPI master with DMA - complete flag check
This bug was reported on forums 2 years but remains unfixed. The line highlighted below is wrong, as the complete_flags variable is not suitable for passing to the GetFlagStatus function and throws an assertion.
WICED/platform/MCU/STM32F2xx/peripherals/platform_spi.c
static platform_result_t spi_dma_transfer( const platform_spi_t* spi, const platform_spi_config_t* config )
{
uint32_t loop_count;
/* Enable dma channels that have just been configured */
DMA_Cmd( spi->tx_dma.stream, ENABLE );
DMA_Cmd( spi->rx_dma.stream, ENABLE );
/* Wait for DMA to complete */
/* TODO: This should wait on a semaphore that is triggered from an IRQ */
loop_count = 0;
while ( ( DMA_GetFlagStatus( spi->tx_dma.stream, spi->tx_dma.complete_flags ) == RESET ) )
{
loop_count++;
/* Check if we've run out of time */
....
}
Instead it should be something like:
while ((get_dma_irq_status(spi->tx_dma.stream) & spi->tx_dma.complete_flags) == RESET)
Show LessHi all,
I am going to use BCM43907 as SDIO device along with i.MX6 Dual running Linux as SDIO host for the next project phase.
Is it possible for BCM43907 can work as BCM43362?
Could you please provide any suggestions?
Thanks,
Tan
Show LessBased on the popular Cypress WiFi chipset and partner modules from Murata, Wubby's turn key software environment dramatically simplifies the development, deployment and post sales-support of everyday IoT objects. Wubby consists of an ecosystem which contains software components such as a cloud agent, core, IDE and client that have been specifically designed to embrace the entire lifecycle of IoT product development.
To learn more, visit theie partner space here on the community: Wubby or take a look at the following getting started video:
Show LessHi team,
I am a new embedded engineer developing a wireless lighting control unit which we hope to use Broadcom hardware in for the mass manufacture of a wifi home automation product. I am new to WICED and am using the 3.5.2 SDK with the BCM943362WCD4_EVB wifi board. At the moment, I am trying to understand the process of how the wifi board connects to a local wifi network and stores that information. Specifically, I am trying to achieve the following:
Modify the temp_control example app to display the current wifi network SSID on the main.html page. Is the Wifi SSID stored somewhere that I can pass to the front end?
Looking at the scan and appliance examples, I can see that it is possible to search, find, display and connect to available wifi networks. I am just unable to replicate the process myself. I have been hunting through those examples which led me to look in the wifi.c and device_configuration_http_content.c files for the appropriate code to copy but am getting really confused with all of the functions and variables which seem to be defined elsewhere and are not commented very thoroughly.
Is anyone able to demystify this for me? Alternatively, are there any tutorials or well commented pieces of code that I can follow? Any guidance would be much appreciated!!
Cheers,
Matt
Show LessIn WICED/RTOS/<ThreadX or FreeRTOS>/WICED/rtos.h there are such comments :
/* Configuration of Built-in Worker Threads
*
* 1. wiced_hardware_io_worker_thread is designed to handle deferred execution of quick, non-blocking hardware I/O operations.
* - priority : higher than that of wiced_networking_worker_thread
* - stack size : small. Consequently, no printf is allowed here.
* - event queue size : the events are quick; therefore, large queue isn't required.
*
* 2. wiced_networking_worker_thread is designed to handle deferred execution of networking operations
* - priority : lower to allow wiced_hardware_io_worker_thread to preempt and run
* - stack size : considerably larger than that of wiced_hardware_io_worker_thread because of the networking functions.
* - event queue size : larger than that of wiced_hardware_io_worker_thread because networking operation may block
*/
But in WICED/RTOS/wiced_rtos_common.c, wiced_result_t wiced_rtos_init( void ) creates those worker threads as this :
result = wiced_rtos_create_worker_thread( WICED_HARDWARE_IO_WORKER_THREAD, WICED_DEFAULT_WORKER_PRIORITY, HARDWARE_IO_WORKER_THREAD_STACK_SIZE, HARDWARE_IO_WORKER_THREAD_QUEUE_SIZE );
result = wiced_rtos_create_worker_thread( WICED_NETWORKING_WORKER_THREAD, WICED_NETWORK_WORKER_PRIORITY, NETWORKING_WORKER_THREAD_STACK_SIZE, NETWORKING_WORKER_THREAD_QUEUE_SIZE );
And the priority macros are defined in include/wiced_defaults.h
#define WICED_NETWORK_WORKER_PRIORITY (3)
#define WICED_DEFAULT_WORKER_PRIORITY (5)
All above are the same for both SDK-3.5.2 & 3.7.0, (also both for ThreadX & FreeRTOS).
Got confused about those RED sections above, they doesn't look consistent to me.
To follow the "design" I think it should be modified that WICED_HARDWARE_IO_WORKER_THREAD is created with priority < 3.
Or the comments should be modified so people are not misled and can use them correctly.
(It's interesting that this is not mentioned in this old post : Worker IO Thread Priority is lower than Network IO thread priority ? .
Iis a bug introduced in recent SDK versions?)
This question might be slightly off topic for this forum, but I'll ask anyway.
I have a BCM943364WCD1 and am looking for some NeoPixel drivers with the STM32. Any recommendations?
Show LessI have a BCM9WCD5EVAL1_3 which has BCM943341WCD1 daughter board. I followed the OTA2 documentation to add ota2. However the ota2_bootloader is not building?
According to the doc it should build ota2_bootloader? not the sflash
This boar does not use external flash the supported BCM943907WAE_1 and BCM943909WCD1_3 platforms.
This is two part question:
1- Does ota2 support works on platforms with external flash only?
2- What would take to port to internal flash with one or two megabyte of flash?
Thanks
Nidal
MAKEFILE MAKECMDGOALS=snip.ping_powersave-BCM943341WCD1 ota2_image OTA2_SUPPORT is enabled
Creating security credentials
Building Serial Flash Loader App
Processing resources
MAKEFILE MAKECMDGOALS=waf.sflash_write-NoOS-BCM943341WCD1-SDIO OTA2_SUPPORT is disabled
Making config file for first time
Making DCT image
MAKEFILE MAKECMDGOALS=waf.sflash_write-NoOS-BCM943341WCD1-SDIO OTA2_SUPPORT is disabled
Compiling App_SFlash_write
Compiling Platform_BCM943341WCD1
Compiling WICED
Compiling WWD_NoOS_Interface
Compiling Lib_SPI_Flash_Library_BCM943341WCD1
Compiling Lib_GPIO_button
Compiling Lib_Wiced_RO_FS
Compiling STM32F4xx
Compiling common_GCC
Compiling STM32F4xx_Peripheral_Drivers
Compiling Lib_Ring_Buffer
Compiling Lib_crc
Compiling STM32F4xx_Peripheral_Libraries
Compiling App_Ping_powersave
Compiling Platform_BCM943341WCD1
Compiling WICED
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/App_SFlash_write.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/Platform_BCM943341WCD1.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/WICED.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/WWD_NoOS_Interface.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/Lib_SPI_Flash_Library_BCM943341WCD1.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/Lib_GPIO_button.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/Lib_Wiced_RO_FS.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/STM32F4xx.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/common_GCC.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/STM32F4xx_Peripheral_Drivers.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/Lib_Ring_Buffer.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/Lib_crc.a
Making build/waf.sflash_write-NoOS-BCM943341WCD1-SDIO/libraries/STM32F4xx_Peripheral_Libraries.a
Making waf.sflash_write-NoOS-BCM943341WCD1-SDIO.elf
waf.sflash_write-NoOS-BCM943341WCD1-SDIO
Show Less