This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to send data from flash memory to ble?

Hello, I am using PCA10028 and sdk 12.2.0. Now I have interfaced temperature sensor and I am storing 4000 readings from sample to flash. Once all the 4000 samples are stored I want to send this data to my nrf app using ble. How can I do that?

I am attaching my code here. Please give me suggestions.

Also when I enable memory storage functions my PCA10028 does not advertise.

main.c New Text Document (2).txt

Thanks, Shailav

Parents
  • FormerMember
    0 FormerMember

    The example ble_app_hrs-fds-test-github.zip in this answer shows how to use FDS when the softdevice is enabled, I would recommend you to take a look at it. It shows how to write and read data from flash.

  • Hello Kristin, In the previous case you helped me out to use FDS and I was able to write and read the data.

    This function writes 4k samples in memory.

    	while(count!=4000)
    {
    	tmp = 280;
    read_sensor_data(0x02, 0,(uint8_t*)&tmp, sizeof(tmp));
    tmp = (tmp/10);
    err_code =fds_test_write(tmp);
    	APP_ERROR_CHECK(err_code);
    	nrf_delay_ms(2000);
    

    count++; }

    My below function reads samples

    //wait until the write is finished. while (write_flag==0); err_code = fds_read(); APP_ERROR_CHECK(err_code);

    Now after the above function I am adding

    advertising_start(); But this time my pca10028 doesnt advertise.

    Also I am looking for suggestions on how to send 4000 samples to nrf app using ble.

    I have attached my code. It would be great if you could test at your end suggest me changes in the same.

    Thanks, Shailav

Reply
  • Hello Kristin, In the previous case you helped me out to use FDS and I was able to write and read the data.

    This function writes 4k samples in memory.

    	while(count!=4000)
    {
    	tmp = 280;
    read_sensor_data(0x02, 0,(uint8_t*)&tmp, sizeof(tmp));
    tmp = (tmp/10);
    err_code =fds_test_write(tmp);
    	APP_ERROR_CHECK(err_code);
    	nrf_delay_ms(2000);
    

    count++; }

    My below function reads samples

    //wait until the write is finished. while (write_flag==0); err_code = fds_read(); APP_ERROR_CHECK(err_code);

    Now after the above function I am adding

    advertising_start(); But this time my pca10028 doesnt advertise.

    Also I am looking for suggestions on how to send 4000 samples to nrf app using ble.

    I have attached my code. It would be great if you could test at your end suggest me changes in the same.

    Thanks, Shailav

Children
No Data
Related