I2C in DSP IMX8MP #72299
-
Hi, Hope you are all well. I would like to access i2c peripheral with DSP core. At first I tried to do so by memory mapping but the DSP stops working with the following error:
Then I tried to access I2C registers in Linux as well and I receive "Bus error". https://community.nxp.com/t5/i-MX-Processors/I2C-issue-IMX8MP/m-p/1856895#M223125 I have check RDC and Clock and test different cases to be able to access I2C registers either Linux or DSP but I couldn't. I have test GPIO and ECSPI2 by memory mapping and they works well. Does any one have any specific idea how I am able to access i2c for DSP? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
@mbahmani90 let us get back to you on 8th of May once everyone gets back from Easter holiday! |
Beta Was this translation helpful? Give feedback.
-
Can you share some code snippets? Let's first make sure we can access I2C registers from Linux. So let's watch out for clocks, pinctrl, and power domain. Can you please use NXP memtool instead of devmem? If you have NXP Yocto release there should be a /unit_tests/memtool binary that can access hardware memory. Then once we can access the memory from Linux we can then try to acess it from the DSP. @mbahmani90 can you share with us your scenario you want to use the DSP for? |
Beta Was this translation helpful? Give feedback.
-
If any more explanation is required please let me know. |
Beta Was this translation helpful? Give feedback.
-
Hi @mbahmani90, What Linux tree are you using? I've tested on linux-imx (I recommend you to use this one) and, as you can see here for i2c3 you need to enable IMX8MP_CLK_I2C3_ROOT clock. I've added a hack to have the clock always enabled (made it critical):
And, with this change, I can read using
Be aware that I2C Address Register (I2C3_IADR) is 16bits width (see i.MX8MP RM) and only bits 1-7 are used, the others are Reserved:
|
Beta Was this translation helpful? Give feedback.
-
I have tested I2C by DSP and it works well.
I am still beginner in Zephyr but it would be possible to modify the code and add it in DSP SDK. Thanks |
Beta Was this translation helpful? Give feedback.
-
@mbahmani90 what is your usecase application? What do you want to achieve. We cannot just add random code to zephyr :) There are several options:
|
Beta Was this translation helpful? Give feedback.
Hi @mbahmani90,
What Linux tree are you using?
I've tested on linux-imx (I recommend you to use this one) and, as you can see here for i2c3 you need to enable IMX8MP_CLK_I2C3_ROOT clock.
I've added a hack to have the clock always enabled (made it critical):