Hey, can I flip it around? Becuase I have a question for *you.*

Have you managed to get this working on a normal BBB? I'm also trying to 
develop an i2c driver for the PRU. It almost looks like we started with the 
same codebase (https://github.com/LinuxDroneLab/pru-i2c-lib), but you have 
obviously modified yours a lot more than I have mine to get it working with 
the 527.

There is definitely some piece missing here. Mine gets to the point of 
setting the I2C_CON register, but then XRDY never comes, and if I read back 
the I2C_CON register, it has lost its master bit. If you look at the TRM, 
it says that the bit is automatically cleared "at the end of a transfer on 
a dedicated stop condition, in case of arbitration lost or when the module 
is configured as a master but addressed as a slave by an external master." 
When I read back the IRQSTATUS register, it just gives back 0.

I've tried trawling through e2e support threads, but the most promising 
ones always link to the TI Processors wiki, which TI decided wasn't worth 
maintaining and shut down about 2 months ago :( 

I made another thread begging people for their stash of these old articles (
https://groups.google.com/u/0/g/beagleboard/c/w6Nd1WmPoSU), so that may be 
of interest to you as well.

I'm sorry if it feels like I'm hijacking your thread, but maybe we can help 
each other out here?

Thanks,
Fred





On Tuesday, 2 March 2021 at 14:58:18 UTC-5 pierric...@gadz.org wrote:

> Hi All,
>
> I am trying to develop a PRU driver for I2C on the Beaglebone AI 
> (Ti-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) of the TRM 
> <https://www.ti.com/lit/ug/spruhz6l/spruhz6l.pdf?ts=1614612229214&ref_url=https%253A%252F%252Fwww.ti.com%252Fsitesearch%252Fdocs%252Funiversalsearch.tsp%253FsearchTerm%253Dspruhz6l>
> . 
>
> 1- I am not sure about the value to put for I2C_IRQENABLE_SET (referenced 
> in figure 24.19) 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)" 
>
>  What value should be used to configure the I2C_IRQENABLE_SET?
>
> 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 
>
>
> PS: I have posted this same question on the Ti e2e forum a few days ago 
> but I have not solved my issue yet. 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/65d1a4f9-2b90-43a7-a0e5-d7753c8d2c2bn%40googlegroups.com.

Reply via email to