7 posts / 0 new
Last post
roinovi
Offline
Last seen:3 years 7 months ago
加入:2015-11-04 18:11
sps buffer size

hello
i am transfering data from my device via uart to the DA14580 and via ble to the dsps iphone app using the sps_device demo
but i dont want to send it continuously, i want to recieve ~5kB via uart to the DK and then send it via ble to the iphone app
so basicly i want to send batches of ~ 5kB at a time
what/where should i make the changes

tnx
roi

Keywords:
Device:
MT_dialog
Offline
Last seen:1 week 5 days ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

50kB is a large amount of data, i dont think that you can increase the buffer that much. Although you can try to remove the iteration check that we have in the app_ble_pull() so no data to be send due to time elapse, and transmit only when and if the limit you want is reached (read amount), Increase the size of your buffer to the size you want RX_BUFFER_ITEM_COUNT, also you should be carefull to set the sending limit under the RX_BUFFER_HW limit inorder not to lose dataand increase the HW. I suppose this could work.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 7 months ago
加入:2015-11-04 18:11
my data size is 5kB not 50kB

my data size is 5kB not 50kB, this is more reasonable?
i have changed these in "app_sps_scheduler.h"
#define RX_BUFFER_ITEM_COUNT (int) 4940

#define RX_BUFFER_HWM (int) 3458 //70%
#define RX_BUFFER_LWM (int) 1482 //30%
and in "app_ble_pull"
if((read_amount = app_item_count(&uarttoble_buffer)) ==4940 )
{
// if (read_amount >= TX_WAIT_LEVEL || (rounds_waiting++) >= TX_WAIT_ROUNDS)
// {
// rounds_waiting = 0;
app_init_ble_tx();
// }
}

but in the iphone app it doesnt recognize the DK
however when i change the buffer size to 2000 it works, the app recognizes the DK and i see the transfer of the data in batches (of 2000 chars i presume)
2000 buffer size is the largest that works, above that the app doesnt recognizes the DK
what is the reason?
is there another parameter that needs to be change?
why is the buffer size limited?
cant i store the data in the flash memory?

roi

MT_dialog
Offline
Last seen:1 week 5 days ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

Sorry about the 50kB, its a typo, 5k its still is a large amount of data for the buffer to hold. This configuration isn't tested and i could only provide you an advice on how to do that.

There isn't something else i can think of that you should change, i guess that this is the limit of the current memory map and thats why you cant see any functionality from the application. Storing data in the flash is something that you might want to try out, since when the external device is sending you will have to store data in the flash, i cant know for sure if you are going to be able to keep up.

Thanks MT_dialog

YuanhangWu
Offline
Last seen:4 years 9 months ago
Expert
加入:2015-03-25 08:19
Hi,roinovi

Hi,roinovi

#define RX_BUFFER_ITEM_COUNT (int) 4940
#define RX_BUFFER_HWM (int) 3458 //70%
#define RX_BUFFER_LWM (int) 1482 //30%

is it can increase rate of SPS kB per second?

roinovi
Offline
Last seen:3 years 7 months ago
加入:2015-11-04 18:11
what do you mean "is it can

what do you mean "is it can increase rate of SPS kB per second?"

how do i write and read data to\from flash memmory?
please reference to an example or a manual
tnx

MT_dialog
Offline
Last seen:1 week 5 days ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

请看看perip SDKheral_examples projects there is an example of how to use the SPI flash, also some reference designs like the beacon and the Smart Tag are using the SPI flash.

Thanks MT_dialog