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

PDM & TWI aren't working together well (SDK 15.3.0)

Hi,

I have similar problem to what is described here.

My situation:
1. I connect 2 PDM mics to the board (CLK is pin 27, Din is pin 26).
2. I connect a couple of TWI (I2C) sensors to the board (SCL is ARDUINO_13_PIN, SDA is ARDUINO_12_PIN, NRF_DRV_TWI_FREQ_400K, APP_IRQ_PRIORITY_HIGH)
3. I connect *same model of sensors* sensors (MAX3010) to the board (SCL is ARDUINO_11_PIN, SDA is ARDUINO_10_PIN, NRF_DRV_TWI_FREQ_400K, APP_IRQ_PRIORITY_HIGH)

When I enable 1 alone (only audio) all is fine.
When I enable 2 & 3 (all I2C sensors) all is fine.

When I enable 1 & 2 & 3 I start seeing problems:
1. I seem to miss some of the timer cycles of the I2C sensors (100Hz timer) and some of the PDM callbacks too.
2. every few times of running the firmware it crashes with "<error> app: ERROR 17 [NRF_ERROR_BUSY] at /home/oberon/opt/nRF5_SDK_15.3.0/components/libraries/log/src/nrf_log_backend_uart.c:83".
This happens in SEGGER IDE. the backtrace doesnt show where this originated so I cant debug this.

I'm using nRF52840-DK and SDK 15.3.0.

Is this a known issue ? was this solved since the original post was posted ? didnt see a solution there.

Parents
  • Hi,

    It seems that there at least is a problem with the logging, hence the log backend uart error.
    I have asked our engineer who handled the case you refer to, hopefully he can give us some more insight into what they figured out back then. 

    I am wondering if you are trying to log too much over the UART peripheral.
    Could you try to reduce your amount of printing, but still use all three sensors?
    You could try to increase the UART baud rate The default baud rate is 115200, but could be higher.

    If reduced debug logs is not an option, or increasing the baud rate did not help I will suggest you to change logging backend to RTT.
    This is easily done in the sdk_config.h, selecting default logging backend to RTT instead of using UART. 
    You need RTT viewer in order to read the RTT logs. 

  • I commented out all the NRF_LOG_*() calls, now it doesnt crash, but the lagging issue isnt solved.

Reply Children
No Data
Related