How to create configuration of the SUOTA

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
Ryon
Offline
Last seen: 2 years 2 months ago
Joined: 2019-06-26 08:04
How to create configuration of the SUOTA

 

hello,

i dont know how to create configuration of the SUOTA in project of ble_peripheral.

as far as i understand, the project of pxp_reporter has function of SUOTA.but i dont know how to configure in project of ble_peripheral.

i had read the PDF of um-b-056-da1468x_software_developers_guide_6v0,but it only introduces how to make .img file.

and  i dont know which items or configuration should be added in project of ble_peripheral.

Please suggest what should I do to let my project has function of SUOTA.

Thanks.

Device: 
PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi Ryon,

Hi Ryon,

Yes, the pxp_reporter example of the SDK includes SUOTA functionality and you can take it as a reference. Let me share some hints for adding SUOTA in the ble_peripheral example.

  1. Add the custom_config_qspi.h header file from pxp_reporter to ble_peripheral under config folder. The following two macro definitions is for SUOTA support.  When building the project in SUOTA build configuration, the custom_config_qspi_suota.h is included and the custom_config_qspi.h is excluded automatically. To do so, there is no need to include custom_config_qspi_suota.h in your source file.
#define dg_configIMAGE_FLASH_OFFSET(0x20000)

#define dg_configSUOTA_SUPPORT(1)

 

  1. Follow the dg_configSUOTA_SUPPORT macro in pxp_reporter_task.c and you should do the same modifications in ble_peripheral_task.c.
    1. Include the dlg_suota.h and sw_version.h header files
    2. Add INITIALISED_PRIVILEGED_DATA static bool suota_ongoing = false;
    3. Modify BLE peripheral advertising data. For example:
static const uint8_t adv_data[] = {

0x03,

GAP_DATA_TYPE_UUID16_LIST_INC,

0xF5, 0xFE,

0x06, GAP_DATA_TYPE_LOCAL_NAME,

'S', 'U', 'O', 'T', 'A'

};
  1. Add the appropriate callback functions like in pxp_reporter_task.c.
  1. Then, you should create a new partition table. The SUOTA partition table is not include in the ble_peripehral project so you should create your own partition table.  I would suggest you to read section 3. Non-Volatile Memory Storage in Flash Adapter Concept tutorial which demostrates how to create a new partition entry. You can use the following 1M SUOTA partition table.
  2. PARTITION2( 0x000000 , 0x01E000 , NVMS_FIRMWARE_PART        , 0 )
    PARTITION2( 0x01E000 , 0x001000 , NVMS_PRODUCT_HEADER_PART  , 0 )
    PARTITION2( 0x01F000 , 0x001000 , NVMS_IMAGE_HEADER_PART    , 0 )
    PARTITION2( 0x020000 , 0x050000 , NVMS_FW_EXEC_PART         , 0 )
    PARTITION2( 0x070000 , 0x00D000 , NVMS_LOG_PART             , 0 )
    PARTITION2( 0x07D000 , 0x002000 , NVMS_PLATFORM_PARAMS_PART , PARTITION_FLAG_READ_ONLY )
    PARTITION2( 0x07F000 , 0x001000 , NVMS_PARTITION_TABLE      , PARTITION_FLAG_READ_ONLY )
    PARTITION2( 0x080000 , 0x010000 , NVMS_PARAM_PART           , 0 )
    PARTITION2( 0x090000 , 0x051000 , NVMS_FW_UPDATE_PART       , 0 )
    PARTITION2( 0x0E1000 , 0x01F000 , NVMS_GENERIC_PART         , PARTITION_FLAG_VES )

     

  3. The same partition should be included in the ble_suota_loader.

Please follow the steps above and let me know if you have any follow up questions.

Thanks, PM_Dialog

Ryon
Offline
Last seen: 2 years 2 months ago
Joined: 2019-06-26 08:04
 

 

hello,

thank you for your reply.

i have followed the above steps,but i can not find the the source code project in the following configuration:

DA14683-00-Release_QSPI_SUOTA

And I don't find any related manual about how to include a new build configuration.so can i import it from  pxp_reporter?

it happen many error when i import the configuration from the pxp_reporte?

so i want to know how to build configuration of DA14683-00-Release_QSPI_SUOTA.

PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi Ryon,

Hi Ryon,

  1. Import both ble_peripheral and pxp_reporter projects in the “Project Explorer” of SmartSnippets Studio.
  2. Right click into ble_peripheral, and select “Properties”
  3. In the pop-up window, navigate to “C/C++ Build” from the left menu.
  4. In the right corner, you will see the “Manage Configurations…”, so hit her in order to adds build configurations for SUOTA.
  5. Select “New…”
  6. Type a “Name” and a “Description” in the appropriate fields. You can give this name “DA14683-00-Release_QSPI_SUOTA”
  7. Select “Import from projects” and select pxpx_reporter > DA14683-00-Release_QSPI_SUOTA and hit “OK”.

Thanks, PM_Dialog

Ryon
Offline
Last seen: 2 years 2 months ago
Joined: 2019-06-26 08:04
hello,

hello,

I have configured the project following the steps you described above.

and it have the function of OTA.But after 8 senconds,the application can not work,because it can not broadcast,the APP of SUOTA can not scan it .

it will work good when i reduce the code size. Isn't memory set correctly? if not ,what should i do 

thanks

 

 

PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi Ryon,

Hi Ryon,

Can you please clarify the following question?

“it will work good when i reduce the code size. Isn't memory set correctly? if not ,what should i do”

Have you done all the appropriate modifications in ble_peripheral_task.c? Can you please check that you are using the correct partition table? If you follow the pxp_reporter project and the hints I have provided you, you should be able to add SUOTA feature.

Thanks, PM_Dialog

Ryon
Offline
Last seen: 2 years 2 months ago
Joined: 2019-06-26 08:04
 

 

hello,

yes,I have done all appropriate modifications in ble_peripheral_task.c,and I used the partition table of pxp_reporter project(1M)

but i have added some function on my custom project,so it did not work,and it will work when I comment out my code.

the memory specific config as follows:
 
#define dg_configQSPI_CACHED_OPTIMAL_RETRAM_0_SIZE_AE   ( 64 * 1024)
#define dg_configQSPI_CACHED_RAM_SIZE_AE                ( 32 * 1024)
#define dg_configQSPI_CACHED_RETRAM_0_SIZE_AE           ( 96 * 1024)

is the memory specific config correct?

 

 

 

PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi Ryon,

Hi Ryon,

Can you please indicate the size of your firmware? I assume that your custom code was fully functional without SUOTA feature. Where does the code stuck? Can you please debug it?

Thanks, PM_Dialog