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

Problems porting application from NRF52DK board to custom board

I am trying to port an application that works on the NRF52 DK board to a custom board containing a 52832 QFAA chipset. The MCU is connected via SPI to an IMU BMI160 and a SD card slot. In debug mode, the program downloaded successfully to the custom board through the SWD interface. However, stepping through the code, it hangs on the following line.

int8_t ret = nrf_drv_spi_transfer(&spi_BMI160, m_buf, 1, read_temp, payload_size+1);

I have not defined a custom_board header as I am not changing the pin configuration. I defined custom GPIO pins as the SPI interface, as follows.

#define IS_CS_PIN 23
#define IS_MISO_PIN 24
#define IS_MOSI_PIN 17
#define IS_SCK_PIN 13

May I know what I might have missed during the porting process, generating such an error?

Parents
  • Hi Ed

    The SPI may "hang" when stepping through it, as it has a few time-sensitive functions, that depend on the events from the other side not being missed and so on. So what likely is happening, is that your function is stuck in some while loop within one of your functions waiting for an SPI/SPIM event that it missed because stepping through the code is "too slow". Where exactly it is stuck however is hard to say based on what information I have. One example is that it's stuck in nrfx_spim.c where the if (!p_cb->handler) calls a check for NRF_SPIM_EVENT_END, which could have been missed when stepping through the code.

    What you'll have to do, is to see what's going on in the nrf_drv_spi_transfer() function, and see where exactly it hangs within that function.

    Best of luck and regards,

    Simon

Reply Children
No Data
Related