1 2 Previous Next 17 Replies Latest reply on Jun 12, 2015 2:07 PM by userc_7973

    Can't boot from OTA

      Hi

       

      We have written  FR_APP, DCT_IMAGE, OTA_APP, APP0 and APP1 to the external flash using make Target "snip.ourapp-ISM43362_M3G_L44 download download_apps run" in SDK 3.1.2

       

      But when ourapp starts up and try to set the boot from the OTA app using following code, the FR_APP starts instead of the OTA app.

       

      void application_start( )

      {

        /* Initialize Wiced system */

          wiced_init();

      .....

        wiced_framework_set_boot( DCT_OTA_APP_INDEX, PLATFORM_DEFAULT_LOAD );

        WPRINT_APP_INFO(("Restarting...\r\n"));

        wiced_framework_reboot( );

      .....

       

       

      }

       

       

      We are stuck in this issue and need urgent help.

       

      Thanks

        • 1. Re: Can't boot from OTA
          JaeyoungY_71

          Hi Tiger,

           

          Was the wiced_waf_app_set_boot() able to get the app header location of OTA_APP and update the dct? Please look into which part it fails inside the function to get more information. The function is located in

               /SDK/WICED/platform/MCU/wiced_waf_common.c

           

          Thanks,

          Jaeyoung

          • 2. Re: Can't boot from OTA

            Hi,

             

            The wiced_waf_app_set_boot() returns WICED_SUCCESS. But after reboot, FR_APP or APP0 or the app in internal flash(those three apps are identical) starts in stead of the OTA app

            Thanks

            • 3. Re: Can't boot from OTA

              Hi,

              As your platform is not an officially supported platform in WICED, I'll be a bit in the dark here. So initially OTA needs a bit of support in the platform, few questions

               

              does the normal snip ota_fr works out of the box?

              what is the size of the external flash and size of your applications stored in flash?

              can you print the log messages while doing make?

              finally, if you tried rebooting from another application like APP0 or FR does it work?

               

              Regards,

              Bassem

              • 4. Re: Can't boot from OTA

                Hi Bassem,

                 

                Please see my inline answers below

                 

                1. does the normal snip ota_fr works out of the box?

                We use snip.tftp as the OTA. Yes it works out of the box.


                2. what is the size of the external flash and size of your applications stored in flash?

                We use SFLASH_ID_MX25L1606E. the size of the external flash is 2Mbyte. size of your applications stored in flash is 515659 bytes.


                3. finally, if you tried rebooting from another application like APP0 or FR does it work?

                Yes. It can reboot from APP0 when I tried rebooting from APP0.


                4. can you print the log messages while doing make?

                 

                My make target is "demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run"

                //make file

                #Set factory reset application to be this same application.

                FR_APP    := $(OUTPUT_DIR)/binary/$(CLEANED_BUILD_STRING).stripped.elf

                DCT_IMAGE := $(OUTPUT_DIR)/DCT.stripped.elf

                OTA_APP   := silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf

                APP0      := silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf

                APP1      := silabs_image/dsp_image_4.0.10.bin //DSP image

                 

                Below is the log messages while doing make

                 

                **** Build of configuration Default for project Wiced-SDK ****

                 

                 

                C:\Users\feng\WICED-SDK-3.1.2\Wiced-SDK\make.exe demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run

                Making config file for first time

                +-----------------------------------------------------------------------------------------------------+

                | IMPORTANT NOTES                                                                                     |

                +-----------------------------------------------------------------------------------------------------+

                | Wi-Fi MAC Address                                                                                   |

                |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                |    Ensure each target device has a unique address.                                                  |

                +-----------------------------------------------------------------------------------------------------+

                | MCU & Wi-Fi Power Save                                                                              |

                |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                |    Application Note located in the documentation directory if you plan to use powersave features.   |

                +-----------------------------------------------------------------------------------------------------+

                Making .gdbinit

                Building Bootloader

                Building Serial Flash Loader App

                Making config file for first time

                +-----------------------------------------------------------------------------------------------------+

                | IMPORTANT NOTES                                                                                     |

                +-----------------------------------------------------------------------------------------------------+

                | Wi-Fi MAC Address                                                                                   |

                |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                |    Ensure each target device has a unique address.                                                  |

                +-----------------------------------------------------------------------------------------------------+

                | MCU & Wi-Fi Power Save                                                                              |

                |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                |    Application Note located in the documentation directory if you plan to use powersave features.   |

                +-----------------------------------------------------------------------------------------------------+

                Processing resources

                Compiling App_SFlash_write

                Compiling Platform_ISM43362_M3G_L44

                Compiling WWD_NoOS_Interface

                Compiling WWD_NoNS_Interface

                Compiling Lib_SPI_Flash_Library_ISM43362_M3G_L44

                Compiling WWD_for_SDIO_NoOS

                Compiling Lib_Wiced_RO_FS

                Compiling STM32F2xx

                Compiling common_GCC

                Compiling STM32F2xx_Peripheral_Drivers

                Compiling Lib_Ring_Buffer

                Compiling STM32F2xx_Peripheral_Libraries

                Finished Building Bootloader

                 

                 

                Processing resources

                Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.elf

                 

                 

                waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO

                ----------------------------------|---------|---------|

                                                  |         |  Static |

                              Module              |  Flash  |   RAM   |

                ----------------------------------+---------+---------|

                App                               |       0 |   22332 |

                Host MCU-family library           |       0 |    7874 |

                Interrupt Vectors                 |       0 |     424 |

                libc                              |       0 |   29410 |

                platform                          |       0 |    1004 |

                Ring_Buffer                       |       0 |      92 |

                SPI_Flash_Library_ISM43362_M3G_L44|       0 |     748 |

                Startup Stack & Link Script fill  |       0 |     486 |

                WWD                               |       0 |     142 |

                ----------------------------------+---------+---------|

                TOTAL (bytes)                     |       0 |   62512 |

                ----------------------------------|---------|---------|

                 

                 

                Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.bin

                Build complete

                Finished Building Serial Flash Loader App

                 

                 

                Creating security credentials

                Making DCT image

                Compiling App_hdradio_UDP_streaming

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c: In function 'ota_thread_main':

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:543:17: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int' [-Wformat=]

                                 WPRINT_APP_INFO(("result=wiced_framework_set_boot() %ld \r\n", result));

                                 ^

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:543:17: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int' [-Wformat=]

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:534:17: warning: unused variable 'num_of_reboot' [-Wunused-variable]

                         uint8_t num_of_reboot =0;

                                 ^

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c: In function 'udp_server_thread_main':

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:598:14: warning: unused variable 'start_time' [-Wunused-variable]

                     uint32_t start_time = 0;

                              ^

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:597:14: warning: unused variable 'transfer_time' [-Wunused-variable]

                     uint32_t transfer_time = 0;

                              ^

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c: In function 'load_Si4680_firmware':

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:134:7: warning: passing argument 3 of 'wiced_framework_app_read_chunk' discards 'const' qualifier from pointer target type

                  if ( wiced_framework_app_read_chunk( &app, flash_addr/*offset*/, pAddr/*data*/, FLASH_HEADER_SZ ) != WICED_SUCCESS )

                       ^

                In file included from ./include/wiced.h:18:0,

                                 from apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:7:

                ./include/wiced_framework.h:487:31: note: expected 'uint8_t *' but argument is of type 'const UINT8 *'

                static inline wiced_result_t  wiced_framework_app_read_chunk( wiced_app_t* app, uint32_t offset, uint8_t* data, uint32_t size )

                                               ^

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:154:10: warning: passing argument 3 of 'wiced_framework_app_read_chunk' discards 'const' qualifier from pointer target type

                     if ( wiced_framework_app_read_chunk( &app, flash_addr/*offset*/, pAddr/*data*/, FLASH_BIN_LEN_SZ ) != WICED_SUCCESS )

                          ^

                In file included from ./include/wiced.h:18:0,

                                 from apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:7:

                ./include/wiced_framework.h:487:31: note: expected 'uint8_t *' but argument is of type 'const UINT8 *'

                static inline wiced_result_t  wiced_framework_app_read_chunk( wiced_app_t* app, uint32_t offset, uint8_t* data, uint32_t size )

                                               ^

                apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:199:12: warning: passing argument 3 of 'wiced_framework_app_read_chunk' discards 'const' qualifier from pointer target type

                   result = wiced_framework_app_read_chunk( &app, flash_addr/*offset*/, pAddr/*data*/, xfer_len );

                            ^

                In file included from ./include/wiced.h:18:0,

                                 from apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:7:

                ./include/wiced_framework.h:487:31: note: expected 'uint8_t *' but argument is of type 'const UINT8 *'

                static inline wiced_result_t  wiced_framework_app_read_chunk( wiced_app_t* app, uint32_t offset, uint8_t* data, uint32_t size )

                                               ^

                Compiling Platform_ISM43362_M3G_L44

                Compiling NetX_Duo

                Compiling WICED

                Compiling Lib_SPI_Flash_Library_ISM43362_M3G_L44

                Compiling WWD_ThreadX_Interface

                Compiling WICED_ThreadX_Interface

                Compiling WWD_NetX_Duo_Interface

                Compiling WICED_NetX_Duo_Interface

                Compiling Supplicant_BESL

                Compiling Lib_HTTP_Server

                Compiling Lib_DNS_Redirect_Daemon

                Compiling Lib_DNS

                Compiling WWD_for_SDIO_ThreadX

                Compiling Lib_Wiced_RO_FS

                Compiling STM32F2xx

                Compiling Lib_DHCP_Server

                Compiling Lib_base64

                Compiling common_GCC

                Compiling STM32F2xx_Peripheral_Drivers

                Compiling Lib_Ring_Buffer

                Compiling STM32F2xx_Peripheral_Libraries

                Making demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44.elf

                 

                 

                Making demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44.bin

                demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44

                ----------------------------------|---------|---------|

                                                  |         |  Static |

                              Module              |  Flash  |   RAM   |

                ----------------------------------+---------+---------|

                App                               |   15083 |   16880 |

                base64                            |     520 |       0 |

                DHCP_Server                       |    1550 |     132 |

                DNS                               |      92 |      44 |

                Host MCU-family library           |   16067 |    5624 |

                Interrupt Vectors                 |     424 |       0 |

                libc                              |   29864 |    3136 |

                Networking                        |    3349 |   17106 |

                NetX                              |   54658 |     536 |

                NetX-Duo - Interfaces & Stacks    |       0 |      12 |

                Packet Buffers                    |       0 |   23142 |

                platform                          |    1252 |     176 |

                RAM Initialisation                |    2520 |       0 |

                resources                         |      16 |       0 |

                Ring_Buffer                       |      92 |       0 |

                SPI_Flash_Library_ISM43362_M3G_L44|     480 |       0 |

                Startup Stack & Link Script fill  |      27 |      20 |

                Supplicant - BESL                 |  127512 |    6204 |

                ThreadX                           |    9176 |     396 |

                Wi-Fi Firmware                    |  213268 |       0 |

                WICED                             |    2482 |     820 |

                WWD                               |   14820 |    1124 |

                ----------------------------------+---------+---------|

                TOTAL (bytes)                     |  490732 |   75352 |

                ----------------------------------|---------|---------|

                 

                 

                Downloading Bootloader ...

                Building apps lookup table

                No changes detected

                 

                 

                Downloading DCT ...

                No changes detected

                 

                 

                Downloading Application ...

                Download complete

                 

                 

                Downloading FR_APP (build/demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44/binary/demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44.stripped.elf) at sector 1...

                Downloading DCT_IMAGE (build/demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44/DCT.stripped.elf) at sector 130...

                Downloading OTA_APP (silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf) at sector 136...

                Downloading APP0 (silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf) at sector 225...

                Downloading APP1 (silabs_image/fmhd_radio_4.0.10.bin) at sector 298...

                Downloading apps lookup table at 0x0000...

                Resetting target

                Target running

                Build complete

                 

                Thanks


                • 5. Re: Can't boot from OTA

                  Hi Bassem,

                   

                  One more addition besides the 4 questions above, when I try to set the boot from the OTA app, it will boot from the myapp in  internal flash, not from FR_APP or APP0.

                  • 6. Re: Can't boot from OTA

                    Hi Bassem,

                     

                    Any updates? Our project and customers are stuck for the issue. We really need urgent help.

                     

                    Thanks

                    • 7. Re: Can't boot from OTA

                      Hi Bassem,

                       

                      I made a change to the  make file below and tried to put the OTA app to app1 and our dsp image to app2. I got error below after I issue make target "demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run"

                      //make file

                      #Set factory reset application to be this same application.

                      FR_APP    := $(OUTPUT_DIR)/binary/$(CLEANED_BUILD_STRING).stripped.elf

                      DCT_IMAGE := $(OUTPUT_DIR)/DCT.stripped.elf

                      #OTA_APP   := silabs_image/snip_hello_feng-ISM43362_M3G_L44.stripped.elf

                      APP0      := silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf

                      APP1  := silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf

                      APP2      := silabs_image/fmhd_radio_4.0.10.bin

                       

                      Below is the log messages while doing make


                      **** Build of configuration Default for project Wiced-SDK ****

                       

                       

                      C:\Users\feng\WICED-SDK-3.1.2\Wiced-SDK\make.exe demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run

                      Making config file for first time

                      +-----------------------------------------------------------------------------------------------------+

                      | IMPORTANT NOTES                                                                                     |

                      +-----------------------------------------------------------------------------------------------------+

                      | Wi-Fi MAC Address                                                                                   |

                      |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                      |    Ensure each target device has a unique address.                                                  |

                      +-----------------------------------------------------------------------------------------------------+

                      | MCU & Wi-Fi Power Save                                                                              |

                      |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                      |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                      |    Application Note located in the documentation directory if you plan to use powersave features.   |

                      +-----------------------------------------------------------------------------------------------------+

                      Making .gdbinit

                      tools/makefiles/wiced_apps.mk:131: warning: overriding recipe for target 'APP0_DOWNLOAD'

                      tools/makefiles/wiced_apps.mk:119: warning: ignoring old recipe for target 'APP0_DOWNLOAD'

                      Building Bootloader

                      make.exe[1]: Circular APP0_DOWNLOAD <- APP0_DOWNLOAD dependency dropped.

                      make.exe[1]: Circular APP1_DOWNLOAD <- APP0_DOWNLOAD dependency dropped.

                      make.exe[1]: *** No rule to make target 'APP2_DOWNLOAD', needed by 'APPS_LUT_DOWNLOAD'.  Stop.

                      make.exe[1]: *** Waiting for unfinished jobs....

                      Building Serial Flash Loader App

                      Making config file for first time

                      +-----------------------------------------------------------------------------------------------------+

                      | IMPORTANT NOTES                                                                                     |

                      +-----------------------------------------------------------------------------------------------------+

                      | Wi-Fi MAC Address                                                                                   |

                      |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                      |    Ensure each target device has a unique address.                                                  |

                      +-----------------------------------------------------------------------------------------------------+

                      | MCU & Wi-Fi Power Save                                                                              |

                      |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                      |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                      |    Application Note located in the documentation directory if you plan to use powersave features.   |

                      +-----------------------------------------------------------------------------------------------------+

                      Processing resources

                      Compiling App_SFlash_write

                      Compiling Platform_ISM43362_M3G_L44

                      Compiling WWD_NoOS_Interface

                      Compiling WWD_NoNS_Interface

                      Compiling Lib_SPI_Flash_Library_ISM43362_M3G_L44

                      Compiling WWD_for_SDIO_NoOS

                      Compiling Lib_Wiced_RO_FS

                      Compiling STM32F2xx

                      Compiling common_GCC

                      Compiling STM32F2xx_Peripheral_Drivers

                      Compiling Lib_Ring_Buffer

                      Compiling STM32F2xx_Peripheral_Libraries

                      Finished Building Bootloader

                       

                       

                      Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.elf

                       

                       

                      Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.bin

                      waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO

                      ----------------------------------|---------|---------|

                                                        |         |  Static |

                                    Module              |  Flash  |   RAM   |

                      ----------------------------------+---------+---------|

                      App                               |       0 |   22332 |

                      Host MCU-family library           |       0 |    7874 |

                      Interrupt Vectors                 |       0 |     424 |

                      libc                              |       0 |   29410 |

                      platform                          |       0 |    1004 |

                      Ring_Buffer                       |       0 |      92 |

                      SPI_Flash_Library_ISM43362_M3G_L44|       0 |     748 |

                      Startup Stack & Link Script fill  |       0 |     486 |

                      WWD                               |       0 |     142 |

                      ----------------------------------+---------+---------|

                      TOTAL (bytes)                     |       0 |   62512 |

                      ----------------------------------|---------|---------|

                       

                       

                      Build complete

                      Finished Building Serial Flash Loader App

                       

                       

                      Makefile:185: recipe for target 'main_app' failed

                      make: *** [main_app] Error 2

                      • 8. Re: Can't boot from OTA

                        I can see a circular dependency in the log messages, usually you shouldn't get that. did you change any of make files (other than the application Makefile)

                        if possible can you send me a zip file that regenerates your problem, cause I can't seem to be able to regenerate it here?

                         

                        Regards,

                        Bassem

                         

                        PS: sorry for late reply, this doesn't work like facebook . I don't get notifications if my name is mentioned.

                        • 9. Re: Can't boot from OTA

                          Hi Bassem,

                           

                          I never change any of the makefiles other than my application Makefile. My emails above provide the details about the two issues below.

                           

                          1. Can't boot from OTA app.

                          Each image of the FR_APP/DCT_IMAGE/OTA_APP/APP0/APP1 can be written to external flash using make target "demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run"

                          below is my make file

                          #Set factory reset application to be this same application.

                          FR_APP    := $(OUTPUT_DIR)/binary/$(CLEANED_BUILD_STRING).stripped.elf

                          DCT_IMAGE := $(OUTPUT_DIR)/DCT.stripped.elf

                          OTA_APP   := silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf

                          APP0      := silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf

                          APP1      := silabs_image/fmhd_radio_4.0.10.bin   //DSP image

                           

                          My app include following code to set the boot from the OTA app. But after reboot my app(not app0 or app1) starts again instead of the OTA app.

                          void application_start( )

                          {

                            /* Initialize Wiced system */

                              wiced_init();

                          .....

                            wiced_framework_set_boot( DCT_OTA_APP_INDEX, PLATFORM_DEFAULT_LOAD );

                            WPRINT_APP_INFO(("Restarting...\r\n"));

                            wiced_framework_reboot( );

                          .....

                            }

                          Below is the log messages while doing make

                           

                          **** Build of configuration Default for project Wiced-SDK ****

                           

                           

                          C:\Users\feng\WICED-SDK-3.1.2\Wiced-SDK\make.exe demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run

                          Making config file for first time

                          +-----------------------------------------------------------------------------------------------------+

                          | IMPORTANT NOTES                                                                                     |

                          +-----------------------------------------------------------------------------------------------------+

                          | Wi-Fi MAC Address                                                                                   |

                          |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                          |    Ensure each target device has a unique address.                                                  |

                          +-----------------------------------------------------------------------------------------------------+

                          | MCU & Wi-Fi Power Save                                                                              |

                          |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                          |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                          |    Application Note located in the documentation directory if you plan to use powersave features.   |

                          +-----------------------------------------------------------------------------------------------------+

                          Making .gdbinit

                          Building Bootloader

                          Building Serial Flash Loader App

                          Making config file for first time

                          +-----------------------------------------------------------------------------------------------------+

                          | IMPORTANT NOTES                                                                                     |

                          +-----------------------------------------------------------------------------------------------------+

                          | Wi-Fi MAC Address                                                                                   |

                          |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                          |    Ensure each target device has a unique address.                                                  |

                          +-----------------------------------------------------------------------------------------------------+

                          | MCU & Wi-Fi Power Save                                                                              |

                          |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                          |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                          |    Application Note located in the documentation directory if you plan to use powersave features.   |

                          +-----------------------------------------------------------------------------------------------------+

                          Processing resources

                          Compiling App_SFlash_write

                          Compiling Platform_ISM43362_M3G_L44

                          Compiling WWD_NoOS_Interface

                          Compiling WWD_NoNS_Interface

                          Compiling Lib_SPI_Flash_Library_ISM43362_M3G_L44

                          Compiling WWD_for_SDIO_NoOS

                          Compiling Lib_Wiced_RO_FS

                          Compiling STM32F2xx

                          Compiling common_GCC

                          Compiling STM32F2xx_Peripheral_Drivers

                          Compiling Lib_Ring_Buffer

                          Compiling STM32F2xx_Peripheral_Libraries

                          Finished Building Bootloader

                           

                           

                          Processing resources

                          Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.elf

                           

                           

                          waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO

                          ----------------------------------|---------|---------|

                                                            |         |  Static |

                                        Module              |  Flash  |   RAM   |

                          ----------------------------------+---------+---------|

                          App                               |       0 |   22332 |

                          Host MCU-family library           |       0 |    7874 |

                          Interrupt Vectors                 |       0 |     424 |

                          libc                              |       0 |   29410 |

                          platform                          |       0 |    1004 |

                          Ring_Buffer                       |       0 |      92 |

                          SPI_Flash_Library_ISM43362_M3G_L44|       0 |     748 |

                          Startup Stack & Link Script fill  |       0 |     486 |

                          WWD                               |       0 |     142 |

                          ----------------------------------+---------+---------|

                          TOTAL (bytes)                     |       0 |   62512 |

                          ----------------------------------|---------|---------|

                           

                           

                          Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.bin

                          Build complete

                          Finished Building Serial Flash Loader App

                           

                           

                          Creating security credentials

                          Making DCT image

                          Compiling App_hdradio_UDP_streaming

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c: In function 'ota_thread_main':

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:543:17: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int' [-Wformat=]

                                           WPRINT_APP_INFO(("result=wiced_framework_set_boot() %ld \r\n", result));

                                           ^

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:543:17: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int' [-Wformat=]

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:534:17: warning: unused variable 'num_of_reboot' [-Wunused-variable]

                                   uint8_t num_of_reboot =0;

                                           ^

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c: In function 'udp_server_thread_main':

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:598:14: warning: unused variable 'start_time' [-Wunused-variable]

                               uint32_t start_time = 0;

                                        ^

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming/hdradio_udp_streaming.c:597:14: warning: unused variable 'transfer_time' [-Wunused-variable]

                               uint32_t transfer_time = 0;

                                        ^

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c: In function 'load_Si4680_firmware':

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:134:7: warning: passing argument 3 of 'wiced_framework_app_read_chunk' discards 'const' qualifier from pointer target type

                            if ( wiced_framework_app_read_chunk( &app, flash_addr/*offset*/, pAddr/*data*/, FLASH_HEADER_SZ ) != WICED_SUCCESS )

                                 ^

                          In file included from ./include/wiced.h:18:0,

                                           from apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:7:

                          ./include/wiced_framework.h:487:31: note: expected 'uint8_t *' but argument is of type 'const UINT8 *'

                          static inline wiced_result_t  wiced_framework_app_read_chunk( wiced_app_t* app, uint32_t offset, uint8_t* data, uint32_t size )

                                                         ^

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:154:10: warning: passing argument 3 of 'wiced_framework_app_read_chunk' discards 'const' qualifier from pointer target type

                               if ( wiced_framework_app_read_chunk( &app, flash_addr/*offset*/, pAddr/*data*/, FLASH_BIN_LEN_SZ ) != WICED_SUCCESS )

                                    ^

                          In file included from ./include/wiced.h:18:0,

                                           from apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:7:

                          ./include/wiced_framework.h:487:31: note: expected 'uint8_t *' but argument is of type 'const UINT8 *'

                          static inline wiced_result_t  wiced_framework_app_read_chunk( wiced_app_t* app, uint32_t offset, uint8_t* data, uint32_t size )

                                                         ^

                          apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:199:12: warning: passing argument 3 of 'wiced_framework_app_read_chunk' discards 'const' qualifier from pointer target type

                             result = wiced_framework_app_read_chunk( &app, flash_addr/*offset*/, pAddr/*data*/, xfer_len );

                                      ^

                          In file included from ./include/wiced.h:18:0,

                                           from apps/demo/hdradio_wifidirect_OTA_UDP_streaming//HdRcvr/HdRadioLinkMonitor.c:7:

                          ./include/wiced_framework.h:487:31: note: expected 'uint8_t *' but argument is of type 'const UINT8 *'

                          static inline wiced_result_t  wiced_framework_app_read_chunk( wiced_app_t* app, uint32_t offset, uint8_t* data, uint32_t size )

                                                         ^

                          Compiling Platform_ISM43362_M3G_L44

                          Compiling NetX_Duo

                          Compiling WICED

                          Compiling Lib_SPI_Flash_Library_ISM43362_M3G_L44

                          Compiling WWD_ThreadX_Interface

                          Compiling WICED_ThreadX_Interface

                          Compiling WWD_NetX_Duo_Interface

                          Compiling WICED_NetX_Duo_Interface

                          Compiling Supplicant_BESL

                          Compiling Lib_HTTP_Server

                          Compiling Lib_DNS_Redirect_Daemon

                          Compiling Lib_DNS

                          Compiling WWD_for_SDIO_ThreadX

                          Compiling Lib_Wiced_RO_FS

                          Compiling STM32F2xx

                          Compiling Lib_DHCP_Server

                          Compiling Lib_base64

                          Compiling common_GCC

                          Compiling STM32F2xx_Peripheral_Drivers

                          Compiling Lib_Ring_Buffer

                          Compiling STM32F2xx_Peripheral_Libraries

                          Making demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44.elf

                           

                           

                          Making demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44.bin

                          demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44

                          ----------------------------------|---------|---------|

                                                            |         |  Static |

                                        Module              |  Flash  |   RAM   |

                          ----------------------------------+---------+---------|

                          App                               |   15083 |   16880 |

                          base64                            |     520 |       0 |

                          DHCP_Server                       |    1550 |     132 |

                          DNS                               |      92 |      44 |

                          Host MCU-family library           |   16067 |    5624 |

                          Interrupt Vectors                 |     424 |       0 |

                          libc                              |   29864 |    3136 |

                          Networking                        |    3349 |   17106 |

                          NetX                              |   54658 |     536 |

                          NetX-Duo - Interfaces & Stacks    |       0 |      12 |

                          Packet Buffers                    |       0 |   23142 |

                          platform                          |    1252 |     176 |

                          RAM Initialisation                |    2520 |       0 |

                          resources                         |      16 |       0 |

                          Ring_Buffer                       |      92 |       0 |

                          SPI_Flash_Library_ISM43362_M3G_L44|     480 |       0 |

                          Startup Stack & Link Script fill  |      27 |      20 |

                          Supplicant - BESL                 |  127512 |    6204 |

                          ThreadX                           |    9176 |     396 |

                          Wi-Fi Firmware                    |  213268 |       0 |

                          WICED                             |    2482 |     820 |

                          WWD                               |   14820 |    1124 |

                          ----------------------------------+---------+---------|

                          TOTAL (bytes)                     |  490732 |   75352 |

                          ----------------------------------|---------|---------|

                           

                           

                          Downloading Bootloader ...

                          Building apps lookup table

                          No changes detected

                           

                           

                          Downloading DCT ...

                          No changes detected

                           

                           

                          Downloading Application ...

                          Download complete

                           

                           

                          Downloading FR_APP (build/demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44/binary/demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44.stripped.elf) at sector 1...

                          Downloading DCT_IMAGE (build/demo_hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44/DCT.stripped.elf) at sector 130...

                          Downloading OTA_APP (silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf) at sector 136...

                          Downloading APP0 (silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf) at sector 225...

                          Downloading APP1 (silabs_image/fmhd_radio_4.0.10.bin) at sector 298...

                          Downloading apps lookup table at 0x0000...

                          Resetting target

                          Target running

                          Build complete

                           

                           

                           

                           

                          2. Can't write any image to external flash when adding APP2 in makefile

                          I made a change to the  make file below and tried to put the OTA app to app1 and our dsp image to app2. I got error below after I issue make target "demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run". It can't write any image of FR_APP/DCT_IMAGE/APP0/APP1/App2 to external flash

                           

                          //make file

                          #Set factory reset application to be this same application.

                          FR_APP    := $(OUTPUT_DIR)/binary/$(CLEANED_BUILD_STRING).stripped.elf

                          DCT_IMAGE := $(OUTPUT_DIR)/DCT.stripped.elf

                          #OTA_APP   := silabs_image/snip_hello_feng-ISM43362_M3G_L44.stripped.elf

                          APP0      := silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf

                          APP1  := silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf

                          APP2      := silabs_image/fmhd_radio_4.0.10.bin

                           

                          Below is the log messages while doing make


                          **** Build of configuration Default for project Wiced-SDK ****

                           

                           

                          C:\Users\feng\WICED-SDK-3.1.2\Wiced-SDK\make.exe demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run

                          Making config file for first time

                          +-----------------------------------------------------------------------------------------------------+

                          | IMPORTANT NOTES                                                                                     |

                          +-----------------------------------------------------------------------------------------------------+

                          | Wi-Fi MAC Address                                                                                   |

                          |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                          |    Ensure each target device has a unique address.                                                  |

                          +-----------------------------------------------------------------------------------------------------+

                          | MCU & Wi-Fi Power Save                                                                              |

                          |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                          |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                          |    Application Note located in the documentation directory if you plan to use powersave features.   |

                          +-----------------------------------------------------------------------------------------------------+

                          Making .gdbinit

                          tools/makefiles/wiced_apps.mk:131: warning: overriding recipe for target 'APP0_DOWNLOAD'

                          tools/makefiles/wiced_apps.mk:119: warning: ignoring old recipe for target 'APP0_DOWNLOAD'

                          Building Bootloader

                          make.exe[1]: Circular APP0_DOWNLOAD <- APP0_DOWNLOAD dependency dropped.

                          make.exe[1]: Circular APP1_DOWNLOAD <- APP0_DOWNLOAD dependency dropped.

                          make.exe[1]: *** No rule to make target 'APP2_DOWNLOAD', needed by 'APPS_LUT_DOWNLOAD'.  Stop.

                          make.exe[1]: *** Waiting for unfinished jobs....

                          Building Serial Flash Loader App

                          Making config file for first time

                          +-----------------------------------------------------------------------------------------------------+

                          | IMPORTANT NOTES                                                                                     |

                          +-----------------------------------------------------------------------------------------------------+

                          | Wi-Fi MAC Address                                                                                   |

                          |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                          |    Ensure each target device has a unique address.                                                  |

                          +-----------------------------------------------------------------------------------------------------+

                          | MCU & Wi-Fi Power Save                                                                              |

                          |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                          |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                          |    Application Note located in the documentation directory if you plan to use powersave features.   |

                          +-----------------------------------------------------------------------------------------------------+

                          Processing resources

                          Compiling App_SFlash_write

                          Compiling Platform_ISM43362_M3G_L44

                          Compiling WWD_NoOS_Interface

                          Compiling WWD_NoNS_Interface

                          Compiling Lib_SPI_Flash_Library_ISM43362_M3G_L44

                          Compiling WWD_for_SDIO_NoOS

                          Compiling Lib_Wiced_RO_FS

                          Compiling STM32F2xx

                          Compiling common_GCC

                          Compiling STM32F2xx_Peripheral_Drivers

                          Compiling Lib_Ring_Buffer

                          Compiling STM32F2xx_Peripheral_Libraries

                          Finished Building Bootloader

                           

                           

                          Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.elf

                           

                           

                          Making waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO.bin

                          waf_sflash_write-NoOS-NoNS-ISM43362_M3G_L44-SDIO

                          ----------------------------------|---------|---------|

                                                            |         |  Static |

                                        Module              |  Flash  |   RAM   |

                          ----------------------------------+---------+---------|

                          App                               |       0 |   22332 |

                          Host MCU-family library           |       0 |    7874 |

                          Interrupt Vectors                 |       0 |     424 |

                          libc                              |       0 |   29410 |

                          platform                          |       0 |    1004 |

                          Ring_Buffer                       |       0 |      92 |

                          SPI_Flash_Library_ISM43362_M3G_L44|       0 |     748 |

                          Startup Stack & Link Script fill  |       0 |     486 |

                          WWD                               |       0 |     142 |

                          ----------------------------------+---------+---------|

                          TOTAL (bytes)                     |       0 |   62512 |

                          ----------------------------------|---------|---------|

                           

                           

                          Build complete

                          Finished Building Serial Flash Loader App

                           

                           

                          Makefile:185: recipe for target 'main_app' failed

                          make: *** [main_app] Error 2

                           

                          Thanks

                          • 10. Re: Can't boot from OTA

                            Hi Bassem,

                             

                            Updates for the second issue 2 "Can't write any image to external flash when adding APP2 in makefile". I fixed a bug in wiced_apps.mk and made a change below

                             

                            #APP0_DOWNLOAD:  $(APP2_DOWNLOAD_DEPEDENCY)

                            APP2_DOWNLOAD:  $(APP2_DOWNLOAD_DEPEDENCY)

                             

                            Now I issue make target "demo.hdradio_wifidirect_OTA_UDP_streaming-ISM43362_M3G_L44 download download_apps run". Any image of FR_APP/DCT_IMAGE/APP0/APP1/App2 can be written to  external flash. Then my main application  run and set the boot to APP1, the app1(my ota app) can run. Below is terminal output

                            Hi, I'm the OTA application.

                            Time for an upgrade. OTA upgrade starting ...

                            Setting IPv6 link-local address

                            IPv4 network ready IP: 192.168.10.1.

                             

                            But there is no active "WICED Soft AP" interface from the wifi menu on my tablet. My tftp program on the tablet cannot connect to the WICED device. I suspect the problem may be caused by the DCT.  The app1 has different DCT image from my main application. After reboot, the APP1 start up and use the existing DCT(my main application) in internal flash. How can we fix this problem?

                             

                            //main application make file

                            #Set factory reset application to be this same application.

                            FR_APP    := $(OUTPUT_DIR)/binary/$(CLEANED_BUILD_STRING).stripped.elf

                            DCT_IMAGE := $(OUTPUT_DIR)/DCT.stripped.elf

                            #OTA_APP   := silabs_image/snip_hello_feng-ISM43362_M3G_L44.stripped.elf

                            APP0      := silabs_image/snip_scan-ISM43362_M3G_L44.stripped.elf

                            APP1  := silabs_image/snip_tftp_feng-ISM43362_M3G_L44.stripped.elf  //our ota app

                            APP2      := silabs_image/fmhd_radio_4.0.10.bin //for our dsp image

                             

                             

                            Thanks

                            • 11. Re: Can't boot from OTA

                              Hi Tiger,

                              Great progress!!. I noted the change you did in wiced_apps.mk and it sounds correct. As for your APP1. so just to confirm, if you run APP1 but itself right from start, downloading it to internal flash, does it work correctly?

                               

                              We don't have a user API to replace the DCT. There is an internal function that replaces only parts of the DCT during factory reset. (have a look at: WICED/platform/MCU/wiced_dct_internal_common.c : wiced_dct_restore_factory_reset). However I don't actually recommend doing this. First replacing DCT is risky and if it corrupts the file locations there is no going back. Also I feel this would add more complexity to your application.

                               

                              Try to think of more simple solutions. your DCT can include an application specific data at the end, try to write in it whatever each of your applications need.

                               

                              Regards,

                              Bassem

                              • 12. Re: Can't boot from OTA

                                Hi Bassem,

                                Current OTA mechanism seems assumes the default DCT settings never change.

                                However, a new version of firmware is likely to add new settings in DCT for

                                supporting new features. How to handle such case?

                                • 13. Re: Can't boot from OTA

                                  DCT usually carries current configurations (and user options), accumulated when running the application multiple times. updating the application, usually doesn't mean over writing all previous configurations or user options. A newer application version should mostly be backward compatible with DCT and may manually update a piece or two in the DCT (at the first run), this can be done using DCT read and write functions.

                                   

                                  Over writing the full DCT is still possible by calling wiced_waf_app_load passing an index of a DCT file, but again I find this dangerous.

                                   

                                  Hope this answers your question.

                                   

                                  Regards,

                                  Bassem

                                  • 14. Re: Can't boot from OTA

                                    Hi Tiger,

                                    try replacing WICED/platform/MCU/wiced_apps_lut.c with the attached file and see if this fixes your OTA app file problem.

                                     

                                    Regards,

                                    Bassem

                                    1 2 Previous Next