Skip navigation
Home > All Places > WICED Studio Wi-Fi/Combo > WICED Studio Wi-Fi/Combo Forums > Blog > Authors ZhengbaoZ_96

Summary:

   We already provided a good document for how to use DCT functions, this topic here is just to have a simple implement.

    My test and description are based on 43907 board.

 

  • What is DCT

The content was described in the document, just copy it here. The DCT stores System and Application data persistently so that the device can use the information between power cycles. The layout of the data is extremely important,and may change between SDKs.

  • DCT Layout

     Normal DCT area

     # DCT1

     NORMAL_IMAGE_DCT_1_AREA_BASE   := 0x00008000   #  16k  (0x00004000)    

     # DCT2

     NORMAL_IMAGE_DCT_2_AREA_BASE   := 0x0000C000   #  16k  (0x00004000)

 

     OTA2 DCT area

     OTA2_IMAGE_APP_DCT_SAVE_AREA_BASE    := 0x00208000  # 16k  0x00004000

     OTA2_IMAGE_CURR_DCT_1_AREA_BASE      := 0x0020d000        #  16k  0x00004000

     OTA2_IMAGE_CURR_DCT_2_AREA_BASE      := 0x00211000        #  16k  0x00004000

 

 

Talking to two DCT area:

There are two DCT areas defined in the FLASH, designated as DCT1 and DCT2. When there are changes to the DCT, we use these in a flip-flop arrangement, copying the “current” DCT to the opposite area with the changes requested, then indicating that the “new” area is the “current” area. Then we mark the “old” area as not in use. This ensures that if power is lost in any part of the update procedure, there is a viable DCT area upon power up.

 

Description in the function API:

*  Validate and return the current DCT address

* - determine the SDK version of the DCT

* - determine which DCT is valid and most recent

* - update the DCT to DCT_BOOTLOADER_SDK_CURRENT if needed

* - return section to the current DCT address

* - if both DCTs invalid, create a valid DCT to use

 

Because every time we flashed the image into DCT1 area, and maybe the new image will have different sdk_ver,

so we need a check and compare flow, the logics are:

  1. Presume use_dct1=WICED_TRUE, then check if dct1 and dct2 area has valid sdk version.
  2. If two areas have same SDK version, check initial write flag.
  3. If dct1_sdk_version < dct2_sdk_version, make use_dct2 TRUE.
  4. Below code is to backup DCT info to the other area before modification.

 

 

  • DCT structure

 

If you read our DCT document in detail, you will find below structure is implemented and modified along with the SDK release.  DCT structure will be divided into three areas:

  1. From dct_header to dct_version, DO NOT MOVE.
  2. From the end of dct_version to the end of platform_dct_data_t, it is for handling additional requests. 
  3. The area after the end of platform_dct_data_t, it should be

DCT_APP_SECTION that is used often in different applications.

 

 

wiced_result_t wiced_dct_write( const void* data, dct_section_t section, uint32_t offset, uint32_t data_length )

    /*

     * There are 3 parts to updating the data (other than platform_dct_header_t and platform_dct_version_t which

     * are handled in the function wiced_dct_finish_new_dct() above)

     * 1) Data before the (section_start + offset) of the new data

*      A) Some new data is between dct_header and dct_version

*      B) Some new data is between dct_version and the end of platform_dct_data_t

*      C) Some new data is after platform_dct_data_t

     * 2) the new data (section_start + offset) size: data_length

     *      A) Some new data is between dct_header and dct_version

     *      B) Some new data is between dct_version and the end of platform_dct_data_t

     *      C) Some new data is after platform_dct_data_t

     * 3) Data after the (section_start + offset+ data_length) of the new data, up to the end of PLATFORM_DCT_COPY1_SIZE

     *      A) Some new data is between dct_header and dct_version

     *      B) Some new data is between dct_version and the end of platform_dct_data_t

     *      C) Some new data is after platform_dct_data_t

     *

     * The code here is generic enough to handle all three cases without having to be maintained  B^)

     *

     */

If you have interests, please add more logs and test if the logic can match all your requests, and check if there exist bugs, thanks.

 

  • Two ways to be familiar with DCT usages.

          One is command_console:    

          Add below define into the makefile of the application like apsta.mk;

Add include in the file command_console_commands.h:

Add to COMMAND table:

After compiling and download we can get the results:

 

The other is DCT_read_write APP:

snip.dct_read_write-CYW943907AEVAL1F-debug download download_apps

we have very detailed instructions in the released sdk also, the name is

/43xxx_Wi-Fi/doc/WICED-DCT.pdf

SUMMARY:

  We have some snip ,test codes in SDK release, this blog is showing how to use snip.dct_read_write, snip.apsta, snip.GPIO to finish one application. And the function is to join different AP by pressing user button. It will help you to understand how to join AP , how to read/write DCT area, be familiar with rule of GPIO operation. Test is based on Wiced 6.2.1.2 release on CYW954907AEVAL1F EVB.

 

MAIN WORK:

  1. STA join one AP, and ping , this is the APSTA from snip .
  2. Because CYW54907 has big internal flash and ram, so apsta includes COMMAN_CONSOLE function,

       you can type <status> to check the interface like below:

3. If you want to use command console ,really need big memory (2MB and above), and you need to enable it in makefile:

GLOBAL_DEFINES += INCLUDE_COMMAND_CONSOLE

If you want to use the DCT mac address, you need to enable it in makefile:

GLOBAL_DEFINES +=MAC_ADDRESS_SET_BY_HOST

Some other useful commands are showed here.

4. ADD user_1, user_2 GPIO test code into APSTA.

to find platform_gpio_buttons define in platform.c and platform.h

Below are some structure relationships in the code.

You will see real user_1, user_2 connections in the pdf circuit.

 

About user_1 and user_2 button initialization, these two pins are already set to INPUT_PULL_UP by default in the boot stage of the board,so you don’t need to initialize them again as a GPIO.

5.     Add DCT read code into APSTA.

  • Show notes about DCT usage
  • With the DCT in external FLASH, the second argument is ignored. For clarity, always use WICED_TRUE ---- This is for 54907 because DCT is in external flash.

      

  • wiced_dct_read_lock() and wiced_dct_read_unlock() need to be used with a couple.  But you do not need to call wiced_dct_read_lock() in order to write date to DCT.

    

  • DCT structure will be used by bootloader also , the sub-structure platform_dct_header_t, which is always at the start of the DCT area of the FLASH.
  • From SDK-3.7.0, it is possible to upgrade the DCT layout when doing SDK upgrading .
  • There are two DCT areas defined in the FLASH, designated as DCT1 and DCT2. we use this in a flip-flop arrangement. When need to update DCT area, we copy the “current” DCT to the opposite area , then indicate that “new” area is the “current” area. The “old ” area is viable DCT area.

 

    Below is the wifi config section printed:

 

6. Adding code to switch AP

  • IOCTL command description.
    • If you want to input “wl down” when DUT is in STA mode, call this function.

         

    • If you want to input “wl disassoc”, call this function

         

    • If you want to input an IOCTL command with value or not, please use below interface:

                 And it is better to add some wwd_wlan_status judge before jumping into  calling.

           

7. add all functions into apsta code:

    The steps are:

  1. to check the Button pressed status.
  2. to disassociate the AP.
  3. Network down.
  4. to write DCT to update the AP ssid which will be joined.
  5. to print the DCT updated.
  6. Network up, join the AP.

 

Reference:

Snip.apsta

Snip.GPIO

Snip.dct_read_write

WICED Device Configuration Table (DCT) Users Guide

cyw954907aeval1f.pdf

  • SUMMARY:

  We divide the SDK code into different module or library for specific function, and Hierarchical software design also is useful for the code maintenance. This blog is to show the log setting for different module.  Please see below architecture from SDK release document. Our aim is to print useful logs when issue happens,  upload one module picture from SDK release .

 

  • HOW TO Print LOGS
  1. To use “printf” directly, this is very convenient for the debug, but not easy to make a good management for the logs added. Some basic knowledge of print is in this link

https://fresh2refresh.com/c-programming/c-printf-and-scanf/

 

     #include <stdio.h>

     int main()

     {

        char ch = 'A';

        char str[20] = "fresh2refresh.com";

        float flt = 10.234;

        int no = 150;

        double dbl = 20.123456;                         

        printf("Character is %c \n", ch);

        printf("String is %s \n" , str);

        printf("Float value is %f \n", flt);

        printf("Integer value is %d\n" , no);

        printf("Double value is %lf \n", dbl);

        printf("Octal value is %o \n", no);

        printf("Hexadecimal value is %x \n", no);

        return 0;

     }

 

·    %d got replaced by value of an integer variable  (no),

·       %c got replaced by value of a character variable  (ch),

·       %f got replaced by value of a float variable  (flt),

·       %lf got replaced by value of a double variable  (dbl),

·       %s got replaced by value of a string variable  (str),

·       %o got replaced by a octal value corresponding to integer variable  (no),

·       %x got replaced by a hexadecimal value corresponding to integer variable

·       \n got replaced by a newline.

 

2.     In wwd_debug.h, wwd_debug.c , wiced_defaults.h

We defined Macros to control the log output for different MODULE.

Modules are Application, library, Webserver , Network, RTOS,

Security , WPS, Supplicant, Wiced , WWD(Wiced wi-fi Driver) .

 

We have good instructions and warnings for the log setting:

* ** WARNING for PRINTING **

*  If printing is enabled, the stack of each thread that uses printing

* must be increased to at least 4 kBytes since the printf function uses

a lot of memory (including dynamic memory)

/* Select which group of functions are allowed to print */

/* WPRINT_ENABLE_<MODULE>_ERROR - Enable print messages in the respective <MODULE> that are present

* as WPRINT_<MODULE>_ERROR.

* For instance, if WPRINT_ENABLE_WWD_ERROR is enabled, then trace messages that are under

* WPRINT_WWD_ERROR will be printed. This directive shall also result in an ASSERT if the target is built in DEBUG                                 mode.

* WPRINT_ENABLE_<MODULE>_DEBUG - Enable print messages in the respective module that are present as

* WPRINT_<MODULE>_DEBUG.

* For instance, if WPRINT_ENABLE_WWD_DEBUG is enabled, then trace messages that are under

* WPRINT_WWD_DEBUG will be printed.

 

* WPRINT_ENABLE_<MODULE>_INFO - Enable print messages in the respective module that are present as

* WPRINT_<MODULE>_INFO.

* For instance, if WPRINT_ENABLE_WWD_INFO is enabled, then trace messages that are under

* WPRINT_WWD_INFO will be printed.

 

If you disable all the logs, there will have a compiled error, so please keep this one at least:

#define WPRINT_ENABLE_APP_INFO           /* Application prints */

 

 

So general debug sequence for log enable:

    • Enable WPRINT_ENABLE_MODULE_INFO to track the process.
    • If found an error was printed out, check which module , then enable DEBUG and ERROR mode also. Be noted, Debug compile will go to an assert if enable ERROR layer .
    • Find the bug position , add more debug info by using the same level log print.

I think if you want to manage the log clearly , you can define one MACRO to just add your debug info ,like           #define WPRINT_ENABLE_BUG_DEBUG_INFO , after issue is fixed you can disable it .Another log print mode :

 

3.     Wiced_log_setting, it is often used on application area.

If you want to close the log , please change the log to WICED_LOG_OFF, the logs added in      the application will be disabled. And strongly suggest to use this debug info in application debug stage.

Log initialize at application_start and enum structure.

         wiced_log_init(WICED_LOG_INFO, render_log_output, wiced_time_get_time);

         wiced_log_msg(WLF_DEF, WICED_LOG_NOTICE, "wiced logging system is initialized\n");

 

typedef enum

{

    WICED_LOG_OFF = 0,

    WICED_LOG_ERR,

    WICED_LOG_WARNING,

    WICED_LOG_NOTICE,

    WICED_LOG_INFO,

    WICED_LOG_DEBUG0,

    WICED_LOG_DEBUG1,

    WICED_LOG_DEBUG2,

    WICED_LOG_DEBUG3,

    WICED_LOG_DEBUG4,

 

    WICED_LOG_PRINTF, /* Identifies log messages generated by wiced_log_printf calls */

 

    WICED_LOG_MAX

} WICED_LOG_LEVEL_T;

 

b: How to write to STDOUT .

use this function:

Enable time output with log together.

    SUMMARY:

    We shared four ways to set wifi mac address,  this blog is to show the process .

    Test is based on CYW954907AEVAL1F .

 

  • DCT  mode:
  1. Add define in app.mk: GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. 43xxx_Wi-Fi\generated_mac_address.txt

     Modify the address in the directory , it works.

     #define NVRAM_GENERATED_MAC_ADDRESS "macaddr=00:A0:50:38:f6:35"

     #define DCT_GENERATED_MAC_ADDRESS "\x00\xA0\x50\xe8\xf3\x48"

     #define DCT_GENERATED_ETHERNET_MAC_ADDRESS "\x00\xA0\x50\xe5\xf3\x47"

 

  • OTP mode
  1. Disable //GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. Need to clean the building, then make again.

 

    Starting WICED vWiced_006.002.001.0002

    Platform CYW954907AEVAL1F initialised

    Started ThreadX v5.8

    Initialising NetX_Duo v5.10_sp3

    Creating Packet pools

     WLAN MAC Address : B8:D7:AF:4D:1D:D6

     WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905

     WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15

 

  1. Let us to go to MFG mode to check the OTP area.

        Have a test with mfg mode:

       test.mfg_test-CYW954907AEVAL1F download download_apps run

  • Modify it in NVRAM:
  • 43xxx_Wi-Fi\platforms\CYW954907AEVAL1F\board_revision\P101

     static const char wifi_nvram_image[] =

      "sromrev=11" "\x00"

      "vendid=0x14e4"                                                      "\x00"

      "devid=0x43d0" "\x00"

      "macaddr=00:A0:50:38:f6:35" "\x00"

 

  1. Disable //GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. Do nothing, clean and build again.
  3. The mac address still is WLAN MAC Address : B8:D7:AF:4D:1D:D6

I do not find anywhere to fix the MAC address into nvram setting, so I presume OTP priority is higher than NVRAM,  if OTP existed the NVRAM mac address will be ignored .

 

 

  • CUSTOM MODE:
  1. Enable the define in app makefile: GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. Modify the code, add simple test:
  3. 43xxx_Wi-Fi\WICED\platform\MCU\BCM4390x\

    4. bcm4390x_platform.c

wwd_result_t host_platform_get_mac_address( wiced_mac_t* mac )

{

#ifndef WICED_DISABLE_BOOTLOADER

    wiced_mac_t* temp_mac;

    wiced_result_t result;

    result = wiced_dct_read_lock( (void**)&temp_mac, WICED_FALSE, DCT_WIFI_CONFIG_SECTION, OFFSETOF(platform_dct_wifi_config_t, mac_address), sizeof(mac->octet) );

    if ( result != WICED_SUCCESS )

    {

        return (wwd_result_t) result;

    }

    memcpy( mac->octet, temp_mac, sizeof(mac->octet) );

       mac->octet[0]= 0x00;

       mac->octet[1]= 0x11;

       mac->octet[2]= 0x22;

       mac->octet[3]= 0x33;

       mac->octet[4]= 0x44;

       mac->octet[5]= 0x55;

    wiced_dct_read_unlock( temp_mac, WICED_FALSE );

#else

UNUSED_PARAMETER( mac );

#endif

    return WWD_SUCCESS;

}

 

Starting WICED vWiced_006.002.001.0002

Platform CYW954907AEVAL1F initialised

Started ThreadX v5.8

Initialising NetX_Duo v5.10_sp3

Creating Packet pools

WLAN MAC Address : 00:11:22:33:44:55

WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905

WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15

Console app

   We have different options in the command input line for setting a global define. Below topic is a simple explanation for these inputs.

Actually you can also get most of them from the  makefile.  We also provide examples after wiced studio installed.

 

  • snip.scan-BCM943362WCD4

        Build for release

 

  • snip.apsta-BCM943362WCD4-debug

       Keyword:debug,

       It means if you want to use Jtag or Jlink to have a debug, you need to add this option to get a debug image.

 

  • snip.apsta-BCM943340WCD1-FreeRTOS-LwIP download run

       Keyword : FreeRTOS-LwIP download run

It means use FreeRTOS system, LwIP network protocol and use the default USB-JTAG programming interface.

 

  • demo.aws_iot.shadow-BCM94343W_AVN download_apps download run

       Keyworddownload_apps

If you want to download app into external flash by using SFLASH_WRITER_APP, you need to enable this option.

 

  • snip.scan-BCM943362WCD4-FreeRTOS-LwIP-SDIO download run

        Keyword:  FreeRTOS-LwIP-SDIO

It means using FreeRTOS system, LwIP network protocol, SDIO interface for communication.

 

  • snip.scan-BCM943362WCD4-ThreadX-NetX_Duo-SDIO download run

        Keyword:  ThreadX-NetX_Duo-SDIO

It means using Threadx OS system, Netx network protocol, SDIO interface communication.

 

  • snip.scan-BCM943362WCD4-ThreadX-NetX-SPI download run

       Keyword:  ThreadX-NetX-SPI

It means using Threadx OS system, Netx network protocol, SPI communication interface.

 

  • test.wifi_join-CYW954907AEVAL1F VERBOSE=1 download run

       Keyword: VERBOSE=1

It means compile and download log will output with a more detailed logs.

 

we also have some other options like  [JTAG=xxx]  [no_dct] [JOBS=x] ,  below comments are important for input compile options:

  Notes

    * Component names are case sensitive

    * 'WICED', 'SDIO', 'SPI' and 'debug' are reserved component names

    * Component names MUST NOT include space or '-' characters

    * Building for release is assumed unless '-debug' is appended to the target

    * Some platforms may only support a single interface bus option

 

Below are instructions for OTA2, please refer to the document carefully .

 

Key words are:

//Build an OTA2 Update Image suitable for upgrade server:

ota2_image

ota2_download

 

//Build an OTA2 Factory Reset Image suitable for manufacturing FLASHing of the device:

ota2_factory_image

ota2_factory_download

 

//It includes waf/ota2_bootloader, OTA2_factory_reset_image.bin, waf/ota2_failsafe, DCT, Application LUT, ota2_extract, and the application

ota2_manuf_image

ota2_manuf_download

 

// Below is for secure flash and version management.

APP_VERSION_FOR_OTA2_MAJOR=1

APP_VERSION_FOR_OTA2_MINOR=3

SECURE_SFLASH=1

keys=<keys_dir>

 

//show update from version of the SDK.

UPDATE_FROM_SDK=<bootloader_sdk>

 

//There were optional structures in the System DCT that are now always included. They are the Bluetooth (BT), Peer to Peer (P2P) and Over The Air 2 (OTA2) sub-structures. This information must also be designated so that the code knows which (if any) of the optional structures were used in the original application build DCT.

APP_USED_BT=1

APP_USED_P2P=1

APP_USED_OTA2=1

 

reference:

WICED Over The Air (OTA) v2 Firmware update Users Guide

Summary:

     The difference between Signal mode and Direct mode is: we only need to connect the EVB with the test AP created by AP, then AP will have a menu to test TX and RX related. Its aim is to figure out if the actual running power is matching what you want, RX path has no RF de-sense in a normal running mode.   If signal mode passed all the RF standard, we can have a confidence that current RF path include TX and RX, current RF configuration like NVRAM have no critical issues.  We can move the product into next long-run function tests.

 

  • Which EVB is for the tests?

I choose 43340 because it has 2.4G and 5G together.

  • How to set 8860C before test.

       1. Set the static IP address

   

    2.  configuration .

 

Which means creating a AP at 153 channel with 6M rate and power is -15dbm.

After AP created we use command to join the AP, then we can do the test .

 

 

  • Which application is needed for the tests?

I used the command console for the test because we can use a lot of embedded commands to join a specific AP and do some command input. 

And we are using the normal firmware for the test, please see the command output.

         test.console-BCM943340WCD1 download run

 

  • Which commands are needed before the tests?

After connection established “scan_suppress 1” , “roam_disable ” are preferred .

PM = 0 is good to be set also.

In command console:

Usage: scan_disable <1 = disable scan|0 = enable scan>

> scan_disable 1

If you didn’t have this command, please add it according another blog.

 

  • How to change country for a test ?

Please input “set country ”, then get channel , choose one channel to do connection with the AP created by instrument.

     > get_country

         Country is US (US/0)

     > set_country CN/0

     > get_country

         Country is CN (CN/0)

     > get_channels

          1  2  3 4  5  6  7  8 9  10  11 12  13  149 153  157  161 165  >

  • TX test results

 

Summary:

The Tx power test determines if transmitter path can work normally with a specific power like 18dbm at 11b 11M rate.  The RX sensitivity test determines if the receiver path can receive a relatively weak signal such as -85 db at 11b 11M rate.

 

We usually recommend that the customer use a certified partner module since the module partner themselves have already performed all the testing before releasing into the broad market. This Help Article was created to show a basic test procedure which allows the customer to determine if the issue encountered is on the RF hardware or software side.

 

 

Test machine Instructions :

MT8860C : 802.11b/g/a, 2.4G, 5G

MT8862A : IEEE802.11a/b/g/n/ac , 2.4G and 5G

IQ2010 :  802.11 a/b/g/n , 2.4G, 5G

IQxel :  802.11 a/b/g/n/ac ,  11AC HT80 and HT160

I will use MT8860C with CYW43340WCD1-EVB to show the test process.

 

Test Prepare:

please also read the application notes from WICED studio in detail.

  1. Read the doc from SDK release, WICED Manufacturing Test User Guide
  2. Wl tool, \43xxx_Wi-Fi\libraries\test\wl_tool\wl43340B0.exe
  3. Firmware, \43xxx_Wi-Fi\resources\firmware\43340\43340B0-mfgtest.bin
  4. NVRAM, \43xxx_Wi-Fi\platforms\BCM943340WCD1\wifi_nvram_image.h
  5. Script , \43xxx_Wi-Fi\libraries\test\wl_tool\scripts

Sometimes you need to update mfgtest.bin or modify NVRAM for the test, please find them in above place. Test scripts already integrate some test command lists, you can take them as a reference , sometimes we need to change some items for a test like rate, channel .

 

Test steps:

  1. test.mfg_test-BCM943340WCD1 download run
  2. After application is download and run, please use below command to make sure wl tool and serial port run well.

If you meet this issue, it means serial port is occupied. Please disable the log UART com and input the command again.

 

Make sure you will see a WLTEST string in the output.

3. connect the board to MT8860C by RF cable .

4.  Connect to MT8860C ,After scan complete, click Connect

 

5. Configure MT8860C into direct mode and the channel , rate needed.

The picture means 802.11g , channel 1 /2.4G, rate 54M, Direct mode

 

6. Set MT8860C attenuation.

Change the channel , and add the Path loss you assumed.  We often set to 1db or 1.5db with RF cable connected.

 

7. Change the script to be compliant with MT8860C setting, please see the compare.

Please see the script, we often change comport,  target WL tool,  band , channel info,  rate info.

if you meet test command problems , please raise case to us.

 

8.  If we set the power into 14dbm, please see the results.

 

9.  EVM results spec table.

You can get more from spec or Module maker, thanks.

802.11b /11Mbps : 16 dBm ± 1.5 dB @ EVM -9dB

802.11g /54Mbps : 15 dBm ± 1.5 dB @ EVM -25dB

802.11n /65Mbps : 14 dBm ± 1.5 dB @ EVM -28dB

 

10. RX sensitivity record

11b,  11Mbps PER @ -85 dBm,

11b,  1Mbps PER @ -90 dBm,

 

11g,  54Mbps PER @ -72 dBm,

11g,  6Mbps PER @ -86 dBm,

 

11n,  MCS=7 PER @ -69 dBm,

11n,  MCS=0 PER @ -85 dBm,

Target:  generate a script which can work on windows PC, and can download different build output without using eclipse to compile again.

 

1.  Add VERBOSE=1 in the Make Target area, for 43907 you can get below input:

          snip.apsta-CYW943907AEVAL1F VERBOSE=1 download download_apps run

          snip.softap_issue-CYW94343WWCD1_EVB download download_apps run

          Create two for final download switch test.

          Then you can get the detailed compile information in the Console:

 

"./tools/ARM_GNU/Win32/bin/arm-none-eabi-gcc.exe" -isystem

./tools/ARM_GNU/Win32/bin/../../include -isystem ./tools/ARM_GNU/Win32/bin/../../lib/include -isystem ./tools/ARM_GNU/Win32/bin/../../lib/include-fixed @build/snip.apsta-CYW943907AEVAL1F/libraries/WWD_for_SoC.43909_ThreadX.c_opts -o build/snip.apsta-CYW943907AEVAL1F/Modules/./WICED/WWD/internal/wwd_internal.o WICED/WWD/internal/wwd_internal.c

"./tools/ARM_GNU/Win32/bin/arm-none-eabi-gcc.exe" -isystem

./tools/ARM_GNU/Win32/bin/../../include -isystem

./tools/ARM_GNU/Win32/bin/../../lib/include -isystem ./tools/ARM_GNU/Win32/bin/../../lib/include-fixed @build/snip.apsta-CYW943907AEVAL1F/libraries/WWD_for_SoC.43909_ThreadX.c_opts -o build/snip.apsta-CYW943907AEVAL1F/Modules/./WICED/WWD/internal/wwd_management.o WICED/WWD/internal/wwd_management.c

"./tools/ARM_GNU/Win32/bin/arm-none-eabi-strip.exe" -o build/waf.sflash_write-NoOS-CYW943907AEVAL1F-P103-SoC.43909/binary/waf.sflash_write-NoOS-CYW943907AEVAL1F-P103-SoC.43909.stripped.elf  build/waf.sflash_write-NoOS-CYW943907AEVAL1F-P103-SoC.43909/binary/waf.sflash_write-NoOS-CYW943907AEVAL1F-P103-SoC.43909.elf

 

2. Filter the key string “.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe” , you can get all the download output command:

 

.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file build/snip.apsta-CYW943907AEVAL1F/DCT.bin 0x00008000 CYW943907AEVAL1F-P103-SoC.43909 0 43909" -c shutdown >> build/openocd_log.txt 2>&1

 

.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file build/waf.bootloader-NoOS-NoNS-CYW943907AEVAL1F-P103-SoC.43909/binary/waf.bootloader-NoOS-NoNS-CYW943907AEVAL1F-P103-SoC.43909.trx.bin  0x00000000 CYW943907AEVAL1F-P103-SoC.43909 1 43909" -c shutdown >> build/openocd_log.txt 2>&1

 

.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file build/snip.apsta-CYW943907AEVAL1F/filesystem.bin 69632 CYW943907AEVAL1F-P103-SoC.43909 0 43909" -c shutdown >> build/openocd_log.txt 2>&1

 

.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file build/snip.apsta-CYW943907AEVAL1F/binary/snip.apsta-CYW943907AEVAL1F.stripped.elf 598016 CYW943907AEVAL1F-P103-SoC.43909 0 43909" -c shutdown >> build/openocd_log.txt 2>&1

 

.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file build/snip.apsta-CYW943907AEVAL1F/APPS.bin 0x00010000 CYW943907AEVAL1F-P103-SoC.43909 0 43909" -c shutdown >> build/openocd_log.txt 2>&1

 

.\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg  -f ./tools/OpenOCD/BCM4390x_gdb_jtag.cfg -c "resume" -c shutdown >> build/openocd_log.txt 2>&1 && echo Target running

 

3. Create a Windows “.bat” file, copy above output into the .bat file, and add prefix in each string line,  you can change the echo string to describe the download info with more detail.

@echo First Step: Downloading DCT ... build/snip.apsta-CYW943907AEVAL1F/DCT.bin @ SFLASH_DCT_LOC=0x00008000   

@call .\tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s .\tools\OpenOCD\scripts -f ./tools/OpenOCD/CYW9WCD1EVAL1.cfg -f ./tools/OpenOCD/BCM4390x.cfg -f apps/waf/sflash_write/sflash_write.tcl -c "sflash_write_file build/snip.apsta-CYW943907AEVAL1F/DCT.bin 0x00008000 CYW943907AEVAL1F-P103-SoC.43909 0 43909" -c shutdown >> build/openocd_log.txt 2>&1

 

 

4. you need to copy the tool environment and the binary that will be downloaded into the .bat directory, I didn’t filter the only necessary tools , just copy them all with below picture:

 

   tools\OpenOCD\scripts\

  Tools\OpenOCD\Win32\

  Tools\OpenOCD\

   apps\waf\sfalsh_write\sflash_write.tcl

  All build results.   I will attach the results in this blog .

 

5.  go to the download test, and have a switch to verify the results.

 

     We already have a lot of commands listed in the command_console_wifi.h ,  but actually we need more to check the info from firmware when doing test ,

I add two commands when I am doing debug or doing basic RF test needed.

 

One is to disable roam function on RF tests.

The other is to get the supported lists for different country code and revisions.

Below is modifications,I will attached the code revised also in this blog.

 

File : command_console_wifi.h // commands added in the lists.

pastedImage_1.png

File:  command_console_wifi.c  // add callback functions.

搜狗截图20180530155422.png

File: wwd_wlioctl.h  //  to enlarge the array to get more channel results.

pastedImage_3.png

 

Now below is the test results from test.console

I have a test on: test.console-BCM943340WCD1 download run

 

> set_country US/0

wwd_sdpcm_send_iovar country results are   0

> get_channels

wwd_wifi_get_channels : 35

1  2  3 4  5  6  7  8 9  10  11 36  40  44 48  52  56 60  64  100 104  108  112 116  120  124 128  132  136 140  149  153 157  161  165 165

> set_country CN/0

wwd_sdpcm_send_iovar country results are   0

> get_channels

wwd_wifi_get_channels : 18

1  2  3 4  5  6  7  8 9  10  11 12  13  149 153  157  161 165  >

> roam_disable 1

  roam_disable = 1

Filter Blog

By date:
By tag: