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

Mesh SDK with flash storage

I have a few nRF52840 DK to evaluate a Bluetooth mesh application. The light switch example is ideal for our initial tests. The only thing I would like to do is to write some of the log to the flash storage on the board and read the file later via USB MSC. I don't always have access to the boards. I managed to modify the client example to switch the lights automatically and would now like to store the log to monitor if the messages arrived on the server. 

I found the usbd_msc example in the main SDK which I could use as a guide. How do I integrate the examples from the main SDK into the mesh SDK? Could someone please provide me with detailed instructions? I'm using CMake on Linux.

Thanks!

Parents Reply Children
  • Thanks a lot for your help!

    I managed to get the USBD UART example to work. I tried to integrate it into the light switch client example but they don't run both at once. The application crashes when app_usbd_init() is called. I'm starting the mesh first and if I comment this line out the mesh starts up as it should.

    The integration guide mentions potential issues with memory and flash storage and lists optional changes. Could this be the problem? Can you give me any hint where to start?

    Thanks!

  • I think you need to debug app_usbd_init() to find what is causing the fault. You should check that you have added SOFTDEVICE_PRESENT to the preprocessor symbols.

  • For the time being I gave up on the USB problem and focused to get some storage into the light switch example. The fatfs example looks quite straight forward. When I compile the code I get the following error:

    nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_spi.h:120:37: error: 'NRF_DRV_SPI_INSTANCE_0' undeclared here (not in a function); did you mean 'NRF_DRV_SPI_INSTANCE_'?
      120 | #define NRF_DRV_SPI_INSTANCE_(id)   NRF_DRV_SPI_INSTANCE_ ## id
          |                                     ^~~~~~~~~~~~~~~~~~~~~
    ../../nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_spi.h:119:37: note: in expansion of macro 'NRF_DRV_SPI_INSTANCE_'
      119 | #define NRF_DRV_SPI_INSTANCE(id)    NRF_DRV_SPI_INSTANCE_(id)
          |                                     ^~~~~~~~~~~~~~~~~~~~~
    /media/storage/Nordic SDK/nRF5_SDK_16.0.0_98a08e2/components/libraries/sdcard/app_sdcard.c:148:36: note: in expansion of macro 'NRF_DRV_SPI_INSTANCE'
      148 | static const nrf_drv_spi_t m_spi = NRF_DRV_SPI_INSTANCE(APP_SDCARD_SPI_INSTANCE);  /**< SPI instance. */

    I understand that the APP_SDCARD_SPI_INSTANCE is defined in sdk_config.h and I could overwrite the default in app_config.h. I'm not sure what the issue in nrf_drv_spi.h is.

    Thanks!

  • I think you should find some threads here in devzone if you search for that error. I believe you should check that you have included nrfx_glue.h and apply_old_config.h.

Related