Wi-Fi Combo Forum Discussions
Hello,
We are in the beginning of studying how to do the SW architecture and we would like to better undestand the role of „WICED“, it’s functionality and how it helps us in interfacing with our lwIP stack, RTOS and application. Would be possible get some support in this area? Are there any documents covering this topic and are there any examples?
Thanks,
J.
Show LessI have seen some network problems seemingly related to scenarios where the link goes down and then comes back up some time later.
1. data_abort exception in mbedtls_ssl_close_notify
2. prefetch abort exception in do_memp_free_pool (when the below assert has been removed)
3. lwip assert in do_memp_free_pool LWIP_ASSERT( "Freeing a buffer that is already freed", tmp_memp != memp );
4. lwip thread lockup / blocked in sys_arch_sem_wait(sem, 0), called from tcpip_send_msg_wait_sem
#1 and #2 have mostly went away after adding delays once link up callback is called and verifying the link is good and dhcp is valid prior to network comms (connect).
#3 I have no idea of the root cause but i guess there is a condition where a pointer is being free'd more than once.
#4 This is a hard one. I have seen this rarely in the past but I just had two our of 120 units lock up. Previously I have seen this happen when a tcp connect is attempted. Even though a timeout value is passed through the WICED network layers, there is a possibility of the wait forever for the semaphore in lwip. My application has no idea this is happening and the sytem monitor thread is happy so no watchdog. When this happens, the rest of my app code is running but no lwip code is executing including DHCP renews, renewal timers, course timer, etc.
I believe the last time i saw this with the debugger the call tree was
tcpip_send_msg_wait_sem
sys_arch_sem_wait(sem, 0);
Basically a message is posted to the tcpip thread but the semaphore is never released indicating the tcpip thread is not running.
Is there anyway to tell if the TCP timers are running or have been disabled from the application code?
#5
I periodically get an assert in do_memp_free_pool, "mem properly aligned" error intervals that would suggest DHCP renewal is about to start. In our testing our network has aggressive DHCP lease times @ 20 minutes which means renews happen every 10. I am seeing at least one device resetting in an hour period. Any ideas?
#4 and #5 are a major issue from a stability point. Our product has slim margin to perform a reset and connect back to the network.
CYW43907
Mainly using TCP + TLS but some UDP as well
DHCP client
My link up/down test triggers more errors when used with multiple Aruba AP's and deleting the ssid and recreating it versus testing with a single Netgear. When a network is deleted on Aruba AP's with a virtual controller it seems like it propagates from AP to AP so a client device may drop one and associate to the next prior to the network being deleted.
Show LessWe have purchased a Nebula-1DX_02, built a few demos (all good) and planning to develop our own board with STM32F429 and 1DX RF module. In anticipation, we started to prepare the tools (flash programming and debug). We purchased a J-Link EDU JTAG adapter and followed the instructions to to set up Debug Configuration. The debugger starts, but it does not stop at main() but stops inside the wwd_bus_init() function. We appreciate some help in finding out what could be wrong.
Show Less
This is the 1st time that I am using FreeRTOS in WICED (on an STM32F429) and I want to make sure that I am initializing tasks in the best place. I did it right after wiced_init() in the application start.
void application_start( )
{
wiced_init( );
TaskConfigID_handle = xTaskCreateStatic( TaskConfigID, "AssignID", CONFIG_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), ConfigIDStack, &ConfigID_buffer );
TaskICM20948_handle = xTaskCreateStatic( TaskICM20948, "IMU", IMU_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), ICM20948Stack, &ICM20948_buffer );
TaskBQ27411_handle = xTaskCreateStatic( TaskBQ27411, "FuelGauge", BAT_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), BQ28411Stack, &BQ27411_buffer );
TaskUI_handle = xTaskCreateStatic( TaskUI, "UserLED", UI_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), UIStack, &UI_buffer );
TaskSFlash_handle = xTaskCreateStatic( TaskSFlash, "SFlash", SFLASH_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), SFlashStack, &SFlash_buffer );
TaskDebug_handle = xTaskCreateStatic( TaskDebug, "Debug", DEBUG_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), DebugStack, &Debug_buffer );
TaskUSB_HS_handle = xTaskCreateStatic( TaskUSB, "USB_HS",USB_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), USB_HS_Stack, &USB_HS_buffer );
TaskWIFI_handle = xTaskCreateStatic( TaskWIFI, "WIFI", WIFI_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), WIFIStack, &WIFI_buffer );
TaskBlue_handle = xTaskCreateStatic( TaskWIFI, "Blue", BLUE_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), BlueStack, &Blue_buffer );
TaskRTC_handle = xTaskCreateStatic( TaskWIFI, "RTC", RTC_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), RTCStack, &RTC_buffer );
TaskOTA_handle = xTaskCreateStatic( TaskWIFI, "OTA", OTA_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), OTAStack, &OTA_buffer );
Show LessI am chasing down a heap issue and I am confused about the heap structure.
In the makefile, I am setting PLATFORM_HEAP_SIZE=256*1024. We have some large JSON structures and when we convert them to strings they can get over 100k characters.
When I print heap information using the example from command_console_mallinfo.c, I get the following
malloc_info {
arena: 31000; /* total space allocated from system */
ordblks: 4; /* number of non-inuse chunks */
smblks: 0; /* unused -- always zero */
hblks: 0; /* number of mmapped regions */
hblkhd: 0; /* total space in mmapped regions */
usmblks: 0; /* unused -- always zero */
fsmblks: 0; /* unused -- always zero */
uordblks: 26512; /* total allocated space */
fordblks: 4488; /* total non-inuse space */
keepcost: 2048; /* top-most, releasable (via malloc_trim) space */
};
******Mallinfo summary******
Total heap size: 31000 bytes
Memory in use: 26512 bytes
sbrk heap start: 0x004F76E8; size: 1739024
sbrk current free: 1708024
Total free memory: 1712512
******Mallinfo END******
I do not see a 256kB stack anywhere; it looks like the "total area" is 31000 bytes. In fact I am not sure what the difference between arena, heap and sbrk heap are. I could not find this in the SDK documentation.
I some later point, the heap info looks like this and all malloc() calls are failing:
sbrk heap size: 1739024
sbrk current free: 4088
malloc arena: 1734936
malloc allocated: 395672
malloc free: 1339264
Total free memory: 1343352
It looks like the memory has migrated from one heap to another, and malloc() is failing because there is very little memory left in the heap.
- Do you know what could cause this heap migration? We are using the cJSON library very heavily during these logs.
- How do I ensure there is ample heap available for the large JSON strings?
I am trying to add resources to the external filesystem (filesystem.bin) and I have configured the makefile per this example: Keep web content (.html, .js) on external flash in a filesystem .
The WIFI firmware is contained within the Filesystem.bin and the resource files correctly show "RESOURCES_IN_FILESYSTEM". However I cannot get the resources in the application to be part of the filesystem. I am using the snip/resource read and I have tried using :
LOCATION_CONFIGURABLE_RESOURCES += apps/resource_read/test_file01.txt
Additionally Platform_config.h contains:
/* WICED Resources uses a filesystem */
#define USES_RESOURCE_FILESYSTEM
/* Location on SPI Flash where filesystem starts */
#define FILESYSTEM_BASE_ADDR ( 0 )
My current Makefile is:
#
# Copyright 2018, Cypress Semiconductor Corporation or a subsidiary of
# Cypress Semiconductor Corporation. All Rights Reserved.
# This software, including source code, documentation and related
# materials ("Software"), is owned by Cypress Semiconductor Corporation
# or one of its subsidiaries ("Cypress") and is protected by and subject to
# worldwide patent protection (United States and foreign),
# United States copyright laws and international treaty provisions.
# Therefore, you may use this Software only as provided in the license
# agreement accompanying the software package from which you
# obtained this Software ("EULA").
# If no EULA applies, Cypress hereby grants you a personal, non-exclusive,
# non-transferable license to copy, modify, and compile the Software
# source code solely for use in connection with Cypress's
# integrated circuit products. Any reproduction, modification, translation,
# compilation, or representation of this Software except as specified
# above is prohibited without the express written permission of Cypress.
#
# Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
# reserves the right to make changes to the Software without notice. Cypress
# does not assume any liability arising out of the application or use of the
# Software or any product or circuit described in the Software. Cypress does
# not authorize its products for use in any products where a malfunction or
# failure of the Cypress product may reasonably be expected to result in
# significant property damage, injury or death ("High Risk Product"). By
# including Cypress's product in a High Risk Product, the manufacturer
# of such system or application assumes all risk of such use and in doing
# so agrees to indemnify Cypress against all liability.
#
NAME := Platform_XXXXX_rev1
#Name := Platform_CYW94343WWCD1_EVB
WLAN_CHIP := 4343W
WLAN_CHIP_REVISION := A1
WLAN_CHIP_FAMILY := 4343x
HOST_MCU_FAMILY := STM32L4xx
HOST_MCU_VARIANT := STM32L476
HOST_MCU_PART_NUMBER := STM32L476VGT6
BT_CHIP := 43438
BT_CHIP_REVISION := A1
BT_CHIP_XTAL_FREQUENCY := 37_4MHz
PLATFORM_SUPPORTS_BUTTONS := 1
ifndef BUS
BUS := SDIO
endif
VALID_BUSES := SDIO
# WIFI_FIRMWARE and WIFI_FIRMWARE_CLM_BLOB are now included into resources
# RESOURCES_LOCATION default to RESOURCES_IN_WICEDFS. But can be optionally config to RESOURCES_IN_DIRECT_RESOURCES
# WARNING: Config RESOURCES_LOCATION to RESOURCES_IN_DIRECT_RESOURCES will build firmware and blob to into main application
# and may cause internal flash to overflow
RESOURCES_LOCATION := RESOURCES_IN_WICEDFS
#EXTERNAL_MEMORY_RESOURCES = $(ALL_RESOURCES)
#ifeq ($(RESOURCES_LOCATION), RESOURCES_IN_DIRECT_RESOURCES)
#INTERNAL_MEMORY_RESOURCES = $(ALL_RESOURCES)
#GLOBAL_DEFINES += WWD_DIRECT_RESOURCES
#endif
GLOBAL_DEFINES += USE_ALT_FREERTOS
GLOBAL_DEFINES += USE_SABER
GLOBAL_DEFINES += BOOTLOADER_APP_LUT_NO_SECURE_FLAG
# Global includes
GLOBAL_INCLUDES := .
GLOBAL_INCLUDES += $(SOURCE_ROOT)libraries/inputs/gpio_button
# GLOBAL_INCLUDES += $(SOURCE_ROOT)wiced/platform/MCU/STM32L4xx/peripherals/CMSIS/Device/ST/STM32L4xx/include
# Global defines
# HSE_VALUE = STM32 crystal frequency = 26MHz (needed to make UART work correctly)
#GLOBAL_DEFINES += HSE_VALUE=26000000
GLOBAL_DEFINES += $$(if $$(NO_CRLF_STDIO_REPLACEMENT),,CRLF_STDIO_REPLACEMENT)
GLOBAL_DEFINES += WICED_DCT_INCLUDE_BT_CONFIG
GLOBAL_DEFINES += WICED_DISABLE_MCU_POWERSAVE
GLOBAL_DEFINES += WICED_ENABLE_MCU_RTC
WIFI_IMAGE_DOWNLOAD := buffered
# Source files
$(NAME)_SOURCES := platform.c \
gpio.c \
adc.c \
tim.c
$(NAME)_COMPONENTS += inputs/gpio_button
$(NAME)_COMPONENTS += filesystems/wicedfs
JLINK_NATIVE := 1
# WICED APPS
# APP0 and FILESYSTEM_IMAGE are reserved main app and resources file system
# FR_APP := resources/sflash/snip_ota_fr-BCM943362WCD6.stripped.elf
# DCT_IMAGE :=
# OTA_APP :=
FILESYSTEM_IMAGE := $(OUTPUT_DIR)/filesystem.bin
# WIFI_FIRMWARE :=
# APP0 :=
# APP1 :=
# APP2 :=
# WICED APPS LOOKUP TABLE
APPS_LUT_HEADER_LOC := 0x0000
APPS_START_SECTOR := 1
ifneq ($(APP),bootloader)
ifneq ($(MAIN_COMPONENT_PROCESSING),1)
$(info +-----------------------------------------------------------------------------------------------------+ )
$(info | IMPORTANT NOTES | )
$(info +-----------------------------------------------------------------------------------------------------+ )
$(info | Wi-Fi MAC Address | )
$(info | The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt | )
$(info | Ensure each target device has a unique address. | )
$(info +-----------------------------------------------------------------------------------------------------+ )
$(info | MCU & Wi-Fi Power Save | )
$(info | It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz | )
$(info | reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave | )
$(info | Application Note located in the documentation directory if you plan to use powersave features. | )
$(info +-----------------------------------------------------------------------------------------------------+ )
endif
endif
Show LessIs there any API in WICED studio to check if the device is currently scanning for wifi networks?
There is a function to suppress the scan, but I could not find any function to check if there is an ongoing scan.
Show LessI have configured my code to write exceptions to AONRAM to survive a reset and push the information out on the next reboot. This leaves me with a register dump of addresses. How do I determine where the LR address is pointing to? If I am running in debug mode, the debugger will stop and I have insight into the location with the disassembly window. Since this is a release image, is there a way to set GCC to build a list file?
On this site,
https://www.systutorials.com/240/generate-a-mixed-source-and-assembly-listing-using-gcc/
they mention adding the following commands to the GCC parameter list
-Wa,-adhln -g
In what makefile would I add this?
Processor: CYW43907
Show Less
Hello,
right now im getting into the WLAN capabilities of the CYW54907 with said development board.
I use the Config_join_ping code example to get the basics, but a problem has occured for me.
My PC is in the network connected via ethernet.
The dev board is connected to the network via WLAN.
Both IPv4 and IPv6 are configured on PC and board.
Now when i ping the IPs, there are some problems coming up and right now im out of ideas what could cause them:
PC pings board with IPv4 -> answer
PC pings board with IPv6 -> answer
Board pings PC with IPv4 -> answer
Board pings PC with IPv6 -> packages lost
BUT: Colleagues PC pings my PC with IPv6 -> answer
So my PC can be pinged by another PC via IPv6, but when i try to ping the same IPv6 with the CYW954907AEVAL1F, i always loose 100% of the packages.
What could cause this behaviour? Is there anything else i neet set up to use IPv6 with the board?
EDIT: Seems i found one possible reason, the ping-command only resolves IPv4 ping attempts and it seems the IPv6 is converted wrong. Ill dig into that
Show LessHi,
i'm getting compilation error as error: 'size_t' has not been declared even though the respective header file is included.
This error is encountered when I tried to include a file in app make file and similar files are included previously which were working fine.
can you suggest the way to sort out this issue.
I'm attaching the screenshot of it.
Show Less