cybt343026-01 flash ss部分的了解

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YaTr_3516311
Level 5
Level 5
25 sign-ins First solution authored 100 replies posted

Hi,

根据cybt343026模块的flash部分的分布,我很想知道ss部分的意思,因为我们有一块蓝牙设备没法正常工作,dump出来后,只有ss部分不一样,其他部分都是一样的。见如下截图

YaTr_3516311_1-1669703961959.png

1. 请问ss块的意思是怎么样的

2. 有没有什么方法可以调查出无法正常工作的那个模块是不是因为固件损坏导致的?

 

 

 

0 点赞
1 解答
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

带OTA的应用,flash分为4块:

/******************************************************
* Variables Definitions
******************************************************/
/********************************************************************************************************
* Recommended firmware upgrade 4 MBit Serila flash offsets
* -------------------------------------------------------------------------------------------------------------------
* | SS1 (4K @ 0) | Fail safe area(4K @ 0x1000) | VS1 (4K @ 0x2000) | VS2 (4K @ 0x3000) | DS1 (248K @ 0x4000) | DS2 (248K @ 0x42000)
* -------------------------------------------------------------------------------------------------------------------
*******************************************************************************************************/

 

DS的地址信息是写在Fail safe area的末尾处,通过下面的语句执行的:

if (p_gdata->active_ds_location == p_active_nv->ds1_loc)
{
// Then update the DS with the upgrade DS.
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN] = (p_gdata->upgrade_ds_location & 0xFF);
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN+1] = (p_gdata->upgrade_ds_location & 0xFF00) >> 8;
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN+2] = (p_gdata->upgrade_ds_location & 0xFF0000) >> 16;
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN+3] = (p_gdata->upgrade_ds_location & 0xFF000000) >> 24;

// Write this to the upgrade SS.
if (sfi_write(magic_num_loc , DS2_MAGIC_NUMBER_BUFFER_LEN + 4, magic_num_ds2) != (DS2_MAGIC_NUMBER_BUFFER_LEN + 4))
{
WICED_BT_TRACE("Could not update the 2nd SS block w/ magic number and DS location!\n");
return 0;
}

在原帖中查看解决方案

0 点赞
5 回复数
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

ss部分存的是系统配置的参数,如果烧写的是同一个固件,这一部分的内容都是一样,而且不会改动。看起来像是flash里的内容被错误改写了导致无法启动。

0 点赞

这个板子是有OTA的功能的。OTA主要的流程就是调用的fw_upgrade_lib里的fw_upgrade.c的库函数。

用到的函数有。请问下面哪一个函数里有可能会涉及到写ss区域?

wiced_ota_fw_upgrade_init

wiced_firmware_upgrade_init_nv_locations

wiced_firmware_upgrade_store_to_nv

hci_ota_fw_upgrade_verify

wiced_firmware_upgrade_finish

0 点赞
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

ss区域存的是一些FW内部使用的东西,烧录完成之后就不会再改动了,你提到的这些API都不回对这一部分的数据进行操作。

0 点赞

那OTA开始的时候读取是哪块DS active和OTA结束的时候fw_upgrade_switch_active_ds写入接下来应该是哪块DS应该active,这些值是写在哪一块里的(SS,VS1,VS2,DS1和DS2???)

YaTr_3516311_0-1669973395311.png

YaTr_3516311_1-1669973665928.png

 

 

0 点赞
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

带OTA的应用,flash分为4块:

/******************************************************
* Variables Definitions
******************************************************/
/********************************************************************************************************
* Recommended firmware upgrade 4 MBit Serila flash offsets
* -------------------------------------------------------------------------------------------------------------------
* | SS1 (4K @ 0) | Fail safe area(4K @ 0x1000) | VS1 (4K @ 0x2000) | VS2 (4K @ 0x3000) | DS1 (248K @ 0x4000) | DS2 (248K @ 0x42000)
* -------------------------------------------------------------------------------------------------------------------
*******************************************************************************************************/

 

DS的地址信息是写在Fail safe area的末尾处,通过下面的语句执行的:

if (p_gdata->active_ds_location == p_active_nv->ds1_loc)
{
// Then update the DS with the upgrade DS.
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN] = (p_gdata->upgrade_ds_location & 0xFF);
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN+1] = (p_gdata->upgrade_ds_location & 0xFF00) >> 8;
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN+2] = (p_gdata->upgrade_ds_location & 0xFF0000) >> 16;
magic_num_ds2[DS2_MAGIC_NUMBER_BUFFER_LEN+3] = (p_gdata->upgrade_ds_location & 0xFF000000) >> 24;

// Write this to the upgrade SS.
if (sfi_write(magic_num_loc , DS2_MAGIC_NUMBER_BUFFER_LEN + 4, magic_num_ds2) != (DS2_MAGIC_NUMBER_BUFFER_LEN + 4))
{
WICED_BT_TRACE("Could not update the 2nd SS block w/ magic number and DS location!\n");
return 0;
}

0 点赞