This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Suggestions for datalogging to flash application flow?

Hi,

I'm working on a datalogger application with a couple of sensors with sample rates of 32 Hz, 25 Hz and 0.1 Hz on the nRF52840. The goal is to sample these sensors and send the data over BLE to a mobile app. However, in case BLE connection is not available (phone not around) the device should keep logging measurements to QSPI flash (same as nRF52840 DK) for atleast 24 hours. On connection, it should unload the measurements from flash.

I have the sensor drivers more or less working (I2C, SPI) but wanted to ask for advice how to structure the application in terms of accomplishing this saving to flash and unloading measurements while taking new samples. Tasking is not my strongest area, so if anyone would have suggestions on how to achieve these goals, I'd be grateful. So far I've been scraping by with BLE NUS and App Scheduler but have yet to integrate QSPI.

So far I have been developing on nRF5 SDK v17.0.2, s140,  nRF52840 DK.
I also did a short spike on Zephyr on NCS v.1.4.99 with some of the sensors working and basic BLE. 

Would there be any libraries in nRF5 SDK or nRF Connect SDK/Zephyr that could help me prototype this quickly?

Thanks,
Harri

Parents
  • Hi,

    I tried the qspi example. Seems to be a blocking driver, which is worrying, since the measurement activity should go on while saving or retrieving data from memory.

    I didn't quite get the point of the USB mass storage and its options since it didn't let me debug through USB and didn't have other means in my home office. 

    Any experience in using the App Scheduler for this sort of application? 
    And another question: Does the QSPI peripheral have dedicated SPI lines since I am already using I2C0 and SPI2 for other purposes?

    Thanks,
    Harri

  • Hi,

    I am sorry I didn't get back to you. Are you still struggling with this?

    HarriR said:
    Seems to be a blocking driver, which is worrying, since the measurement activity should go on while saving or retrieving data from memory

    The example does it in a blocking fashion, but you don't have to use WAIT_FOR_PERIPH(). You can do something else in the code while waiting for the QSPI operation to complete, when the operation completes the qspi_handler() will be called.

    HarriR said:
    And another question: Does the QSPI peripheral have dedicated SPI lines since I am already using I2C0 and SPI2 for other purposes?

    Yes it has a  dedicated interface.

    Best regards,

    Marjeris

Reply
  • Hi,

    I am sorry I didn't get back to you. Are you still struggling with this?

    HarriR said:
    Seems to be a blocking driver, which is worrying, since the measurement activity should go on while saving or retrieving data from memory

    The example does it in a blocking fashion, but you don't have to use WAIT_FOR_PERIPH(). You can do something else in the code while waiting for the QSPI operation to complete, when the operation completes the qspi_handler() will be called.

    HarriR said:
    And another question: Does the QSPI peripheral have dedicated SPI lines since I am already using I2C0 and SPI2 for other purposes?

    Yes it has a  dedicated interface.

    Best regards,

    Marjeris

Children
No Data
Related