Problems with self written I2C binding driver for NXP MIMX8MM #76736
Replies: 1 comment
-
|
solved it by myself. I forgot to add |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am currently trying to write an I2C driver for the i.MX 8M Mini, but unfortunately no I2C package is sent. I am using the M4 Core and Zephyr 3.7.0. In the first instance it is only about I2C3.
In the devicetree zephyr/dts/arm/nxp/nxp_imx8m_m4.dtsi I have added the following:
The Compatible file is kept simple and looks like this:
My Overlay file looks like this:
I wasn't sure if I had to set the property pinmux as above or to:
pinmux = <&iomuxc_i2c3_scl_i2c_scl_i2c3_scl>, <&iomuxc_i2c3_sda_i2c_sda_i2c3_sda>;I tested both and got the same result.
I also had to edit the clock driver zephyr/drivers/clock_control/clock_control_mcux_ccm.c and its header. I added the following to the header file:
and the respective C-File I added the following to the function
mcux_ccm_on:and in the function
mcux_ccm_get_subsys_rateI added this:This results in a value of 40,000 for I2C3.
And last but not least, the binding driver. This is strongly based on zephyr/drivers/i2c/i2c_mcux_imx.c but I've changed clock settings. The print statements are for debug reasons:
The code fails in i2c_mcux_transfer function at
k_sem_take(&data->device_sync_sem, K_FOREVER);because the callback function gets never called.I also added a new KConfig param to activate I2C in the clock driver.
Sorry for the long post but I thought it's better to show you the whole adjustments I did. I think my main.c is not that important because it's held pretty simple.
I would be very grateful for any help!
Beta Was this translation helpful? Give feedback.
All reactions