Regarding a size of "audio_codec_buffer_size" when FOTA application is combined in audo_headset app

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

cross mob
bemale
Level 3
Level 3
100 sign-ins 50 sign-ins 25 sign-ins

Dear Cy,

I've combined FOTA application in Audio_Headset application and it's working as expected.

However, I need to reduce buffer size of ".audio_codec_buffer_size" in wiced_app_cfg.c to 0x2000 from 0x5000 to avoid reset during boot up. Otherwise, reset happened continuously.

I'm guessing this buffer could corrupt other RAM region and it caused reset problem. But, I think I need to keep the original size of 0x5000 for working of audio profiles like A2DP and HFP as you commented in "wiced_bt_audio.h"

So, How can I resolve this situation? I should reduce the buffer size if I combine FOTA functionality, on the other hand, I should keep the original buffer size for operation of audio profiles.

Could you please help here to solve this problem?

Thanks.

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

Is it the same reset problem mentioned in the below post? If yes, then could you please share your application and steps to reproduce with us. Let us have a look.

https://community.cypress.com/t5/Wireless/making-FOTA-enabled-version-of-audio-headset-example/td-p/... 

It is better to keep the audio buffer configurations as default. If you reduce it, it may affect the audio transmission. Could you please check the available memory left in your device after combining the application? And the buffer usages too? Please sue APIs in wiced_memory.h

 

Thanks,

-Dheeraj

View solution in original post

0 Likes
4 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

Is it the same reset problem mentioned in the below post? If yes, then could you please share your application and steps to reproduce with us. Let us have a look.

https://community.cypress.com/t5/Wireless/making-FOTA-enabled-version-of-audio-headset-example/td-p/... 

It is better to keep the audio buffer configurations as default. If you reduce it, it may affect the audio transmission. Could you please check the available memory left in your device after combining the application? And the buffer usages too? Please sue APIs in wiced_memory.h

 

Thanks,

-Dheeraj

0 Likes
bemale
Level 3
Level 3
100 sign-ins 50 sign-ins 25 sign-ins

Hi Dheeraj,

Yes, it's a same reset problem with previous topic. my approach is very simple.

I set a flag for fota into sflash area and reset target .

after this reset cycle, check the sflash area to device operation mode which normal or fota enabled?

If checked fota enabled, then call functions in "ota_firmware_upgrade.c", so I used functions related to fota in "ota_firmware_upgrade.c" without change.  please refer to below code.

APPLICATION_START( )
{
if(app_check_fota_flag()==0x01) // FOTA_enabled
{
// Reset "fota_ena" flag to "0"
app_sflash_erase();
app_sflash_write(0);
fota_ena = 1;
fota_init();
}
else
{
hci_control_init();

#if (WICED_APP_LE_INCLUDED == TRUE)
hci_control_le_init();
#endif

WICED_BT_TRACE( "Wiced Headset Application Started...\n" );
}

 

Additionally, the result about buffer usage is shown as below,

>> Checking Buffer Usage !!
Buffer usage statistics:   ----> It's from "wiced_bt_get_number_of_buffer_pools()" 
pool_id:0 size:64 curr_cnt:4 max_cnt:14 total:16
pool_id:1 size:272 curr_cnt:0 max_cnt:2 total:6
pool_id:2 size:1056 curr_cnt:0 max_cnt:0 total:9
pool_id:3 size:1056 curr_cnt:0 max_cnt:0 total:0
pool_id:4 size:728 curr_cnt:0 max_cnt:0 total:4
pool_id:5 size:148 curr_cnt:0 max_cnt:0 total:8
>> Memory free bytes : 0xad8 !! ------> It's from "wiced_memory_get_free_bytes()"

0 Likes
bemale
Level 3
Level 3
100 sign-ins 50 sign-ins 25 sign-ins

Please notify that the number of free bytes : 0xad8 as commented previous post is a number when I reduced "audio_codec_buffer_size" to 0x2000 to prevent continuous reset. It means that there is no enough room in memory if I set "audio_codec_buffer_size" to 0x5000 original size.

So, reset happened whenever "wiced_audio_buffer_initialize (wiced_bt_audio_buf_config)" is called.

I don't know which value is returned by "wiced_memory_get_free_bytes()" because it's an API function.

I just can see memory information through "Handsfree.report.txt" file as below and seems that there is enough memory region.

Patch code starts at 0x0D0200 (RAM address)
Patch code ends at 0x0DE958 (RAM address)
Patch ram starts at 0x216AD0 (RAM address)
Patch ram ends at 0x217A38 (RAM address)

Application memory usage:
.text SRAM start 0x217A38, end 0x225100, size 54984
.rodata SRAM start 0x225100, end 0x229779, size 18041
.data SRAM start 0x229780, end 0x229B60, size 992
config_var SRAM start 0x229B60, end 0x229B61, size 1
.bss SRAM start 0x229B64, end 0x22B45C, size 6392
.setup SRAM start 0x22B45C, end 0x22B5A4, size 328
ram (SRAM): used 0x217A38 - 0x22B5A4 size (80748)
Total application footprint 80748 (0x13B6C)

DS available 253952 (0x03E000) at 0x004000

BR,

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

Are you still facing the issue. If you can share the code and steps to reproduce we will try reproducing the issue at our side and get back to you. 

Thanks,

-Dheeraj.P.K

0 Likes