This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5729: I2C Programming developing a PRU driver

Part Number: AM5729
Other Parts Discussed in Thread: PRU-CGT

Hi All, 

I am trying to develop a PRU driver for I2C on the AM5729. I have some questions about the setup procedure using Interrupt and polling (I am not using DMA). I am not quite sure about the differences between the setup described between section 24.1.5.1.1.1.1 and 24.1.5.1.1.1.2) and the figure (24.19). 

1- What value should be used to configure the I2C_IRQENABLE_SET? I have tried with 0x1f (enable XRDY, RRDY, ARDY, NACK, and AL as they are used later). However, I receive a Kernel Oops when I try to run my code " [Feb26 14:54] Unable to handle kernel NULL pointer dereference at virtual address 00000000 

[ +0.003725] Internal error: Oops: 5 [#1] PREEMPT SMP ARM

genirq: exiting task "irq/114-4807a00" (110) is an active IRQ thread (irq 114)" 

2- I have tried to write in the I2C_DATA register but reading the register after always gives 0xD. I have checked the value of I2C_IRQSTATUS_RAW, and it always read 0x10 (XRDY). Am I missing something to write the data? 

If you want to have a look at my code, it is under this repository https://github.com/PierrickRauby/BBAI-PRU-I2C/blob/main/am572x_pru_i2c_driver.pru1_1.c

Thanks for any help you can provide! 

Pierrick