We are using an IMX8M, we want the M4 to be an I2C slave to another device, but whenever Linux boots up the communication stops. If we don't boot up the Linux core, the I2C communication works perfectly. We have turned off the specific I2C bus in the device tree, but the communication still stops when Linux boot up. Any idea what may be the cause of this?
解決済! 解決策の投稿を見る。
Thank you for the help. We found that moving back to an older kernel version fixed the problem. We were on kernel 4.14, but by moving back to 4.9 it worked.
Hello,
This is because of the i.MX was programmed to be a master device, it cannot be set as a slave device manually. We do have a patch that will configure the i.MX8M as a slave device. However, this patch was created for the Linux version L4.9.51. I cannot guarantee if this will work for newer Linux versions. In any case, you can use the code and port it to the newer versions.
Hope this information could help you.
Best regards,
Diego.
Hi @diegoadrian ,
Could you tell me what on which linux kernel this patch was created for? I tried applying this patch on 3 different repos (freescale / nxp and mainline kernels) on the kernel v4.9.51 and all failed (there were some conflicts or didn't apply at all):
- https://source.codeaurora.org/external/imx/linux-imx/tag/?h=v4.9.51
- https://github.com/Freescale/linux-fslc/releases/tag/v4.9.51
We are not trying to use Linux for the I2C communication. We are trying to use the M4 core with an RTOS on it for the I2C communication, which is able to be used as a slave. How is the Linux A53 core overriding the M4 core?
Hello,
How the A53 core is the principal core, the A53 is the one that is going to use. Probably the problem could be because you have a multi-master conflict between your A53 core and the other device that you have. Try applying the patch and see if that solves the problem.
Furthermore, can you please pass me your modified device tree. Because disabling the I2C bus could be another solution, but apparently is not being done in your case.
Best regards,
Diego.
Hello,
Just another thing.
Are you testing the I2C slave mode with our SDK?
Best regards,
Diego.
Yes, I am using the NXP SDK and using the slave portion of the I2C RTOS example.
Hello,
Another question, are you disabling the I2C bus 2 for the cortex M4 dtb?
Furthermore, I recommend you to disable every driver that makes use of the I2C bus 2 since how the cortex A53 has priority over the cortex M4 even if is disabled in the device tree, the kernel will try to use the drivers. The other solution is to apply the patch that I provided you previously.
Best regards,
Diego.
Thank you for the help. We found that moving back to an older kernel version fixed the problem. We were on kernel 4.14, but by moving back to 4.9 it worked.