Wi-Fi Combo Forum Discussions
Hi,
I downloaded new SDK which is studio5.2 and now try to test snip.scan with 4343WCD1 EVK, however there's no scan result
so I upgraded firmware to the one in the SDK which is "4343WA1.bin" but it was in vain.
With the EVB I have no problem with Wiced Studio 5.0.2
Does studio 5.2 support W4343CD1?
Thanks,
Soohwan.
Show LessThere is an invalid enumerated type conversion in the WICED 4.1 OTA2 bootloader. The function wiced_ota2_image_get_status() takes a wiced_ota2_image_type_t as its first parameter, but value passed in is an ota2_boot_type_t: OTA2_BOOT_UPDATE. This value isn't equivalent to any wiced_ota2_image_type_t so it will trigger the default behavior for any invalid image type. I'm not sure what the significance of this is. I was trying to fix something else when I ran across this bug.
int main( void ) // SEE apps/waf/ota2_bootloader/ota2_bootloader.c
{...
wiced_result_t result;
...
/* Check for Watchdog reset
* This overrides everything. Use ota2_failsafe to recover
*/
if (platform_watchdog_check_last_reset() == WICED_TRUE)
{
/* watchdog reset happened - which image do we try to use? */
wiced_ota2_image_status_t staged_update_status;
...
/* if the downloaded image is good, use that over the factory reset */
result = wiced_ota2_image_get_status( /*bug - should be and image type not a boot type*/OTA2_BOOT_UPDATE, &staged_update_status );
...
}
}
// SEE libraries/filesystems/ota2/wiced_ota2_image.h for the following:
typedef enum
{
OTA2_BOOT_NEVER_RUN_BEFORE = 0, /* Do not change this ENUM location */
OTA2_BOOT_NORMAL, /* Do not change this ENUM location */
/* Use these after failsafe recovery to continue the ota2 extraction preocess */
OTA2_BOOT_EXTRACT_FACTORY_RESET, /* Renamed in SDK-4.0.1, but stays the same ENUM as SDK OTA2_BOOT_FACTORY_RESET */
OTA2_BOOT_EXTRACT_UPDATE, /* Renamed in SDK-4.0.1, but stays the same ENUM as SDK OTA2_BOOT_FACTORY_RESET */
OTA2_BOOT_SOFTAP_UPDATE, /* Do not change this ENUM location */
OTA2_BOOT_LAST_KNOWN_GOOD, /* Do not change this ENUM location */
OTA2_BOOT_FACTORY_RESET,
OTA2_BOOT_UPDATE,
/* Use these before starting an extraction. If extraction is interrupted, use failsafe */
OTA2_BOOT_FAILSAFE_FACTORY_RESET,
OTA2_BOOT_FAILSAFE_UPDATE,
OTA2_MAX_BOOT_TYPES /* Not a valid boot type */
} ota2_boot_type_t;
typedef enum
{
WICED_OTA2_IMAGE_TYPE_NONE = 0,
WICED_OTA2_IMAGE_TYPE_FACTORY_RESET_APP,
WICED_OTA2_IMAGE_TYPE_CURRENT_APP,
WICED_OTA2_IMAGE_TYPE_LAST_KNOWN_GOOD,
WICED_OTA2_IMAGE_TYPE_STAGED
} wiced_ota2_image_type_t;
Show LessHi,
I have 2 versions of my code:
Version 1 : wiced 3.7 with 8 section in external memory
DCT_IMAGE_ENTRY_COUNT := 0
FILESYSTEM_IMAGE_ENTRY_COUNT := 1
WIFI_FIRMWARE_ENTRY_COUNT := 2
FR_APP_ENTRY_COUNT := 3
OTA_APP_ENTRY_COUNT := 4
APP0_ENTRY_COUNT := 5
APP1_ENTRY_COUNT := 6
APP2_ENTRY_COUNT := 7
Version 2 : wiced 5.1 with 9 section in external memory
DCT_IMAGE_ENTRY_COUNT := 0
FILESYSTEM_IMAGE_ENTRY_COUNT := 1
FR_WIFI_FIRMWARE_ENTRY_COUNT := 2
FR_APP_ENTRY_COUNT := 3
OTA_APP_ENTRY_COUNT := 4
APP0_ENTRY_COUNT := 5
APP1_ENTRY_COUNT := 6
APP2_ENTRY_COUNT := 7
WIFI_FIRMWARE_ENTRY_COUNT := 8
in version 2
FR_APP is the version 1 application
FR_WIFI_FIRMWARE is the version 1 wifi firmware
The version 2 works perfectly but when I make the factory reset the version 1 start but reboot each time when FreeRTOS start.
any idea ?
Show LessHello
I have my own external debugger that I want to hook into the STM32F4 on the BCM94343WWCD1_1. The blue shrouded header (J3) appears to correspond to what I want. But when I try to open the connection, although I can read the voltage, I appear to be unable to reset the device.
Is the on-board debugger holding onto this pin? Is there a resistor I can remove so that my external debugger may toggle?
I've looked at the schematics for the BCM94343WWCD1_1 but they seem to entirely omit the information from the black board. Where can I find those schematics? I could help myself if I was able to find them.
Best,
Louis
FYI, the eval board that I am mounted on appears to be the BCM9WCD9EVAL1. Unfortunately, it's schematics are not in WICED-Studio-5.1/43xxx_Wi-Fi/platforms/evaluation_boards
Show Less
I'm looking for the pinout for the J7 header on this evaluation board but can only find schematics for the BCM943364WCD1 module. Where can I find schematics for this EVB?
Regards,
Florian
Show LessThis fix resolve 2 issues, which reported her Possible OTA bug? :
1. app_header array overflow (..crash)
2. OTA update crash after 9 incremental firmware updates
Not resolve issues:
1. Crash after 112 incremental updates
2. Crash OTA update after factory restore *(if was before an update and new firmware sizes different by 1 sector). To resolve this, need clear apps headers sector in spi flash and restore default header.
wiced_result_t wiced_apps_set_size( image_location_t* app_header_location, uint32_t size )
{
sflash_handle_t sflash_handle;
app_header_t app_header;
uint8_t index;
uint32_t current_size = 0;
uint16_t empty_sector;
unsigned long flash_memory_size;
uint32_t available_sectors;
uint32_t sectors_needed;
init_sflash( &sflash_handle, PLATFORM_SFLASH_PERIPHERAL_ID, SFLASH_WRITE_NOT_ALLOWED );
sflash_read( &sflash_handle, app_header_location->detail.external_fixed.location, &app_header, sizeof(app_header_t) );
for ( index = 0; index < app_header.count; index++ )
{
current_size += app_header.sectors[ index ].count;
}
current_size *= SFLASH_SECTOR_SIZE;
if ( current_size >= size )
{
deinit_sflash( &sflash_handle);
return WICED_SUCCESS;
}
current_size = ( size - current_size );
sectors_needed = current_size / SFLASH_SECTOR_SIZE;
sectors_needed = ( current_size % SFLASH_SECTOR_SIZE ) ? ( sectors_needed + 1 ) : ( sectors_needed );
deinit_sflash( &sflash_handle);
//darius internaly check new header that do not overload next sector this about 112 times if each firmare bigger. Internaly was change
if ( wiced_apps_find_empty_location( app_header_location, &empty_sector ) != WICED_SUCCESS )
{
return WICED_ERROR;
}
sflash_get_size( &sflash_handle, &flash_memory_size );
available_sectors = ( flash_memory_size / SFLASH_SECTOR_SIZE ) - empty_sector;
/* Check whether number of sectors which are empty is more that the number of sectors required for an application */
if ( sectors_needed > available_sectors )
{
wiced_assert("Flash memory doesn't have enough space for this application update", 0!=0);
/* Application with requested size wont fit into flash memory chip */
return WICED_ERROR;
}
#if 1
/*Darius. Trivial change. Check whether number of sections which are empty is more that the number of sectors required for an application */
if ( app_header.count >= sizeof(app_header.sectors)/sizeof(app_header.sectors[0]) )
{
wiced_assert("App_header sections doesn't have enough space for this application update. Total error.", 0!=0);
/* We have sflash memory defragmentation */
return WICED_ERROR;
}
if( app_header.count>0 && (app_header.sectors[ app_header.count-1].start+app_header.sectors[ app_header.count-1 ].count)==empty_sector ){
app_header.sectors[ app_header.count-1].count += (uint16_t) sectors_needed;
}
else{
app_header.sectors[ app_header.count ].start = empty_sector;
app_header.sectors[ app_header.count++ ].count = (uint16_t) sectors_needed;
}
#else
app_header.sectors[ app_header.count ].start = empty_sector;
app_header.sectors[ app_header.count++ ].count = (uint16_t) sectors_needed;
#endif
init_sflash( &sflash_handle, PLATFORM_SFLASH_PERIPHERAL_ID, SFLASH_WRITE_ALLOWED );
/* printf("sectory count %d %d %d\n", app_header.count, app_header.sectors[ app_header.count-1 ].start, app_header.sectors[ app_header.count-1 ].count); */
sflash_write( &sflash_handle, app_header_location->detail.external_fixed.location, &app_header, sizeof(app_header_t) );
memset(&app_header,0xFFFFFFFF, sizeof(app_header_t));//clear buffer
sflash_read( &sflash_handle, app_header_location->detail.external_fixed.location, &app_header, sizeof(app_header_t) );
/* printf("sectory count %d %d %d\n", app_header.count, app_header.sectors[ app_header.count-1 ].start, app_header.sectors[ app_header.count-1 ].count); */
deinit_sflash( &sflash_handle);
return WICED_SUCCESS;
}
Show LessIn wwd_assert.c there is a bug the will cause the system to fail to build if the DEBUG and WPRINT_ENABLE_ERROR is enabled.
There are missing braces around the WPRINT_MACRO - current source is:
#define wiced_minor_assert( error_string, assertion ) do { if ( !(assertion) ) WPRINT_MACRO( error_string ); } while(0)
corrected source is:
#define wiced_minor_assert( error_string, assertion ) do { if ( !(assertion) ) WPRINT_MACRO( ( error_string ) ); } while(0)
This is on line 56 - Please correct for next release.
Show LessHi there,
I would like to get a firmware reset app running. This should be accessible by holding a specific button for more than X ms at the system startup.
If I try to build the program by the makefile call "apps.FirmwareReset-BCM943907_QUADRO-ThreadX download download_apps run" (like suggested within snip.ota_fr) I can not access the factory reset program. What can I do to make that working?
I made some changes within platform.c and platform.h
// ... platform.h
/* Bootloader OTA and OTA2 factory reset during settings */
#define PLATFORM_FACTORY_RESET_BUTTON_INDEX ( PLATFORM_BUTTON_1 )
#define PLATFORM_FACTORY_RESET_TIMEOUT ( 10000 )
// ... platform.c
const gpio_button_t platform_gpio_buttons[] =
{
[PLATFORM_BUTTON_1] =
{
.polarity = WICED_ACTIVE_LOW,
.gpio = PIN_PWM_0,
.trigger = IRQ_TRIGGER_FALLING_EDGE,
},
[PLATFORM_BUTTON_2] =
{
.polarity = WICED_ACTIVE_LOW,
.gpio = PIN_PWM_1,
.trigger = IRQ_TRIGGER_FALLING_EDGE,
}
};
uint32_t platform_get_button_press_time ( int button_index, uint32_t max_time )
{
int button_gpio;
uint32_t button_press_timer = 0;
/* Initialize input */
button_gpio = platform_gpio_buttons[button_index].gpio;
platform_gpio_init( &platform_gpio_pins[ button_gpio ], INPUT_PULL_UP );
while ( (PLATFORM_BUTTON_PRESSED_STATE == platform_gpio_input_get(&platform_gpio_pins[ button_gpio ])) )
{
/* wait a bit */
host_rtos_delay_milliseconds( PLATFORM_BUTTON_PRESS_CHECK_PERIOD );
/* keep track of time */
button_press_timer += PLATFORM_BUTTON_PRESS_CHECK_PERIOD;
if ((max_time > 0) && (button_press_timer >= max_time))
{
break;
}
}
return button_press_timer;
}
uint32_t platform_get_factory_reset_button_time ( uint32_t max_time )
{
return platform_get_button_press_time ( PLATFORM_FACTORY_RESET_BUTTON_INDEX, max_time );
}
The main application looks like this:
Show Lessvoid application_start( )
{
wiced_config_soft_ap_t* soft_ap;
wiced_result_t result;
wiced_init( );
char ssid_name[63];
char ssid_pass[63];
/* Get the SoftAP name and output to console */
result = wiced_dct_read_lock( (void**) &soft_ap, WICED_FALSE, DCT_WIFI_CONFIG_SECTION, OFFSETOF(platform_dct_wifi_config_t, soft_ap_settings), sizeof(wiced_config_soft_ap_t) );
if ( result == WICED_SUCCESS )
{
if(strcmp(ssid_name, (char*)soft_ap->SSID.value[0]) != 0)
{
WPRINT_APP_INFO( ( "\r\nUpdating the SSID Name\n\r") );
memcpy(soft_ap->SSID.value, ssid_name,9);
soft_ap->SSID.length = 9;
soft_ap->security = WICED_SECURITY_OPEN;
}
wiced_dct_write(soft_ap, DCT_WIFI_CONFIG_SECTION, OFFSETOF(platform_dct_wifi_config_t, soft_ap_settings), sizeof(wiced_config_soft_ap_t));
wiced_dct_read_unlock( soft_ap, WICED_FALSE );
}
result = wiced_dct_read_lock( (void**) &soft_ap, WICED_FALSE, DCT_WIFI_CONFIG_SECTION, OFFSETOF(platform_dct_wifi_config_t, soft_ap_settings), sizeof(wiced_config_soft_ap_t) );
if ( result == WICED_SUCCESS )
{
WPRINT_APP_INFO( ( "\r\n\r\nSoftAP start, AP name: %s\r\n", soft_ap->SSID.value));
WPRINT_APP_INFO( ( "\tPassword: %s\r\n\r\n", soft_ap->security_key));
}
wiced_rtos_delay_milliseconds(200);
/* Bringup the network interface */
wiced_network_up( WICED_AP_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, &device_init_ip_settings );
wiced_ota_server_start( WICED_AP_INTERFACE );
while ( 1 )
{
wiced_rtos_delay_milliseconds( 100 );
}
}
To help you learn about the new features added, new platforms supported and key bug fixes in a WICED Studio releases, Cypress now provides comprehensive release notes with every WICED Studio release. To learn more, refer to WICED Studio 5.2 release notes available at following link:
Release Notes: WICED Studio 5.2.0
Enjoy building IoT with WICED!
Show Less