SUOTA APP - DA14531 ota development

Hi ,

  DA14531 SDK VERSION  :6.0.16.1144

  In my application i trying to do BLE ota using SUOTA APP Renesas and trying on the example and the i defualt example i haven't changed anything other than advertisement packets.

what are the steps to be followed to do the ota with the updated bin  file.

Thanks ,

Sowmiya




[locked by: Jef (SWF) at 10:33 (GMT 0) on 14 Mar 2024]
[unlocked by: Jef (SWF) at 10:33 (GMT 0) on 14 Mar 2024]
Parents Reply Children
  • Hi,

    I found the issue that after merging the file once SPI flash is writes and read the data , the product header gets NULL , so device restarts continuously.

    i am using int8_t retb = spi_flash_block_erase(PC_FLASH_ADR, SPI_FLASH_OP_SE); function before write into the  PC_FLASH_ADR  address.

    its erase product header also 0x0001f0000 

    how to erase only the  PC_FLASH_ADR  assingned memory only.

    uint32_t PC_FLASH_ADR = 0x1F040;

    static void load_config_value_inmem(void)
    {
    uint32_t actual_size;
    uint32_t i;
    
    arch_printf("\r\n\r\n\r\nload mem ...");
    
    arch_printf("\r\n\r\nPerforming Sector Erase...");
    int8_t retb = spi_flash_block_erase(PC_FLASH_ADR, SPI_FLASH_OP_SE);
    arch_printf("Sector erased %d\r\n",retb);
    
    // Write data example (512 bytes)
    arch_printf("\r\n\r\nPerforming byte write...");
    // spi_flash_write_data(wr_data, 0, 512, &actual_size);
    int8_t ret = spi_flash_write_data(wr_data, PC_FLASH_ADR, SPI_READ, &actual_size);
    arch_printf("write ret %d\r\n",ret);
    
    // Read SPI Flash first 512 bytes
    arch_printf("\r\n\r\nReading SPI Flash first after write...");
    int8_t ret1 = spi_flash_read_data(rd_data, PC_FLASH_ADR, SPI_READ, &actual_size);
    arch_printf("read ret %d\r\n",ret1);
    // Display Results
    for (i = 0; i < SPI_READ; i++)
    {
    arch_printf("%02x",rd_data[i]);
    arch_printf(" ");
    }
    //arch_printf("\r\nactual_size: %d",actual_size);
    
    instance_data.device_serial_num = (uint32_t)rd_data[0] << 24 | (rd_data[1] & 0xff) << 16 | (rd_data[2] & 0xff) << 8 | (rd_data[3] & 0xff);
    arch_printf("\r\nACTUAL SERIAL : %d",instance_data.device_serial_num);
    
    instance_data.system_off = (uint32_t)rd_data[4] << 24 | (rd_data[5] & 0xff) << 16 | (rd_data[6] & 0xff) << 8 | (rd_data[7] & 0xff);
    // instance_data.system_off = rd_data[4];
    arch_printf("\r\nACTUAL SSYS OFF : %d ",instance_data.system_off);
    
    instance_data.adv_interval = (uint32_t)rd_data[8] << 24 | (rd_data[9] & 0xff) << 16 | (rd_data[10] & 0xff) << 8 | (rd_data[11] & 0xff);
    // instance_data.adv_interval = rd_data[5];
    arch_printf("\r\nACTUAL ADV INT : %d ",instance_data.adv_interval);
    
    instance_data.action_timer = (uint32_t)rd_data[12] << 24 | (rd_data[13] & 0xff) << 16 | (rd_data[14] & 0xff) << 8 | (rd_data[15] & 0xff);
    
    instance_data.trigger_timer = (uint32_t)rd_data[16] << 24 | (rd_data[17] & 0xff) << 16 | (rd_data[18] & 0xff) << 8 | (rd_data[19] & 0xff);
    
    instance_data.device_type = rd_data[20];
    instance_data.accel_sensiivity = rd_data[21];
    instance_data.move_thrshold = rd_data[22];
    instance_data.ff_thrshold = rd_data[23];
    
    instance_data.dbm_set = rd_data[24];
    
    spi_flash_power_down();
    
    GPIO_Enable_HW_Reset();
    
    
    }

    Thanks,

    Sowmiya

  • Hi , 

    for storing user config , 

       int8_t retb = spi_flash_block_erase(PC_FLASH_ADR, SPI_FLASH_OP_SE);
    arch_printf("Sector erased %d\r\n",retb);

    Instead of spi_flash_block_erase  , now i used page erase then its working.

    Thanks,

    Sowmiya