3 Replies Latest reply on Jun 13, 2014 1:40 AM by GregG_16

    How to change Memory map for no use of SPI flash ?

      How to change flash memory map to remove SPI flash?

      Main purpose is that we would like to put OTA application (no need factory reset APP)  in MUC in Flash area like "0x080c 0000"

      for no used external SPI flash.

       

      Current SDK does operation with external SPI flash for OTA and Factory Reset App...

      but we are making way for no use of external SPI flash .

       

      ex>

      In booting time, if flash is cheked as broken in any issues, loader  jump to MCU Flash addrss 0x080c-0000 ( OTA application Area)

      if there is script for this , it will be very helpful to us or if this option is applied to build target then it is very convient.

      //--------------------------------------------------------------------------------------------------------------------------------------------

      we are evaluating WiCED SDK  2.4  WCD4  EVB.  It seems to be flash mapped as belows

      1.) Flash

      0x0800 0000        0x0800 3FFF   (4K) BootLoader

      0x0800 4000        0x0800 BFFF  (32K)  OTA and User Parameter

      0x0800 C000       0x080E FFFF   User Application

       

      2. RAM

      0x2000 0000  for the Ram addressing.

       

      3. SPI Flash

        OTA + Factory Reset APP + Factory Reset DCT

       

      //--------------------------------------------------------------------------------------------------------------------------------------------

      - Our target Flash memory Map

      0x0800 0000        0x0800 3FFF   (4K) BootLoader

      0x0800 4000        0x0800 BFFF  (32K)  OTA and User Parameter

      0x0800 C000       0x080B FFFF   User Application

      0x080C 0000       0x080E FFFF   OTA application.

       

      Any comment will be very appreciated

        • 1. Re: How to change Memory map for no use of SPI flash ?

          Under each chip architecture directory (Wiced/Platform/ARM_Cortex_xx/<specific chip type>) there is a directory called bootloader_ota which contains all the platform specific bootloader and OTA upgrade functionality. The specific file of interest is called platform_bootloader.c and it contains the functions that:

          1. Restore factory reset application (platform_restore_factory_app())
          2. Load the OTA app (platform_load_ota_app())
          3. Start the main application (platform_start_app())

           

          You are free to modify those functions to implement the functionality you require however it is recommended that you make copy of the chip architecture you are changing and give it a custom name.

          Some things to note when creating a new/modified chip architecture:

          1. You will need to rename the makefile so that it matches the name of the directory.
            e.g Wiced/Platform/ARM_Cortex_M3/my_STM32F2xx/my_STM32F2xx.mk
          2. In your platform makefile change the declaration of $(NAME)_COMPONENTS to the address of your new chip
            e.g. $(NAME)_COMPONENTS := common/ARM_Cortex_M3/my_STM32F2xx

           

          We recommend creating a duplicate chip architecture to ensure you always have a copy of the original reference code that will assist you in finding any bugs that might occur while you are doing your changes. Having your own chip architecture can also make it easier to migrate to new SDK revisions as it will permit you to copy and paste your directory into the new SDK and then compare the old and new revisions to see if there are any changes you may need to port to your modified chip architecture.

          • 2. Re: How to change Memory map for no use of SPI flash ?

            Thanks for your information!

            we need link script how to link as one image and

             

            As recommended by you for the platforms and target changed. and we know that we have to change

            following function .

            1. Restore factory reset application (platform_restore_factory_app())  // will be removed
            2. Load the OTA app (platform_load_ota_app())   // serial flash access codes  will be removed,

                                                                       //we will put codes to access 0x080C 0000    0x080E FFFF   OTA application.

             

              3. Start the main application (platform_start_app())  // ok

             

            Main Question  is that.

              How to link ( link script in make file ) application and OTA application  waf_ota_upgrade-xxxx as one image.

              and  Our Application and OTA application is going to be mapped in MCU Flash as below

             

               Our  Application begins at  : 0x0800 C000    0x080B FFFF  //   ( damo_s2w-APP1BCM94362WCD4.bin )

               OTA application begins at : 0x080C 0000  0x080E FFFF     //   ( waf_ota_upgrade-APP1BCM94362WCD4.bin )

             

            How to make two file as one image with above address mapping ?

             

            Additional information:

            -  Some application will use Serial Flash but most of application will not use Serial Flash

            - if flash(in MCU) is broken in case of upgrade or other issues, 

               if boot-loader check that flash(in MCU)  is broken, then it will jump to 0x080c 0000 ( OTA ) upgrade

                we are not sure that OTA App can work in flash or it needed copy to RAM to run .

                ( for this case, address mapping may be different )

             

             

            Thanks

            • 3. Re: How to change Memory map for no use of SPI flash ?
              GregG_16

              Please start a new discussion if this is still an issue.