Hi, I want to control a g-sensor by nRF52832 via i2c.
I am using an example( nRF5_SDK_12.2.0\examples\ble_peripheral\ble_app_uart\pca10040\s132\arm4) and I add the app_twi into the project.
In the sdk_config.h, I set TWI0_ENABLED and TWI0_USE_EASY_DMA as 1. There are no any error after compiling, but I always got NRF_ERROR_INVALID_ADDR on run-time. However, If I set the TWI0_USE_EASY_DMA as 0, It works. I take a look at my settings of Keil, In the Target label, the IRAM1 starts from 0x20002128 and the size is 0xDED8 bytes.
Could you please kindly give me some advices?
- Why can't app_twi use easy DMA?
- Is the Easy DMA using the address 0x20000000 in RAM? The example is using the RAM from 0x20002128, so it doesn't work?
- I refer to the twi_sensor_pca10040 example, it uses nrf_drv_twi_tx to implement. What the pros and cons between nrf_drv_twi and app_twi? Which methods should I use?
Thank you so much!!