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

nrf52 PAN #46: SPIM,TWIM: EasyDMA list not functional

Hi. I want to attach a sensor with SPI slave interface to the nRF52 Preview DK (PCA10036) using the SPIM1 with EasyDMA. Below I have two related questions:

  1. In PAN #46 it is stated that EasyDMA list are not functional however to use the EasyDMA for SPIM in nRF52832_OPS_v0.6 page 273 the usage of ArrayLists as buffer is described. Honestly I do not understand what that PAN mean? Can I use th EasyDMA for SPIM1 at all ar do I have to write my own DMA function to directly access the RXD-1/TXD-1 register of SPI1?

  2. Currently I have programmed some functions to initialise SPIM1 with EasyDMA and trigger a transaction to read 64 bytes. The code triggers the START task but the STARTED event is never triggered by the SPIM1 hence the while loop waitin for it is never left (see attached code SPIM1_init_trigger.txt). What could be the reason that the STARTED event is not triggered?

Thanks and best regards

  • Sorry for my previous comments,

    1. You can use EasyDMA, Its the EasyDMA list (new feature) that is not functional.

    2. I have to make a lot of guesses with the code you gave as not all values are available.

      OMD_SPI_INSTANCE->TASKS_STOP = 1; You are not waiting for the EVENTS_STOPPED to happen


    OMD_CHIP_SELECT_DISABLE();
    OMD_CLOCK_SET_IDLE();
    OMD_MOSI_SET_IDLE();
    

    I do not understand what these are doing


    why don't you use the tested nrf_drv_spi.c for these functionality? isn't it exactly the same thing you are trying to accomplish which is already tested in this driver?

  • Thank you for having a look on it. So far I tried the SPIM example too and indeed the SPIM with EasyDMA seems to work. However the example is somehow too abstract for me and contains a lot of code I do not use at all; therefore I wanted to write my own simple SPI driver.

    I have tried to wait for EVENTS_STOPPED to happen after triggering the TASKS_STOP with the same result: The event never happend and my code stuck in the while loop! Also I removed all unused code from the project to focus on SPIM1 and added printf() support to print the register values before jump into the infinite while-loop waiting for EVENTS_STARTED but I could not find the cause.

    You are right, important information are missing in the uploaded file as it only contains some of the involved functions. Here I added the complete project as a zip file.

    Hope you can have a look at this.

  • Ah, I am sorry, I lost track of this thread, unfortunately i got busy with something else. Haven't you got any progress after that?

  • I spent two days with debugging, printing register values and variables, going through the code again and again and reading several times the data sheet and OPS and the relevant entries at devzone but I could not get it to work. The EasyDMA just do not start because of any unknown reason. As a workarround to test the sensor I implemented the SPI master without using the EasyDMA i.e. writing a software DMA application; it works. However the CPU is now bussy handling the SPI interrupt for every single byte. As the application is an ultra low power remote sensor node I would like the CPU to sleep/stand-by instead of handling lots of unnecessary interrupts. Therefore I am still interested to get the EasyDMA to work!

Related