LPI2C6 can't send 0 bit? Hello, I am trying to implement controls on a device connected to T5 and R5 on my MIMXRT1170 SoC. Initially, I tried to set it up like so: lpi2c_master_config_t cfg; LPI2C_MasterGetDefaultConfig(&cfg); LPI2C_MasterInit(I2C_BASE, &cfg, srcClockHz); status_t start_status = LPI2C_MasterStart(I2C_BASE, 0x15, kLPI2C_Write); And I saw that it does not seem to work as expected on the scope. What I saw was the start sequence, followed by a 0, and then nothing. So I tried to replace the start command by directly writing into MTDR something like: I2C_BASE->MTDR = 0x4FA; This address has a bunch of ones, followed by alternating ones and zeroes. What I see on the scope is that after the first zero, the module gives up and does not transmit the remaining bits. Why would that happen? For your convenience, I'll attach the schematic: and I'll also add that we added a couple of 2.2k pullups. Re: LPI2C6 can't send 0 bit? Hi @alex0 ,
Thank you so much for your interest in our products and for using our community.
regarding your question, for the LPI2C6 communication issue on pins T5 and R5, please check the below:
1: Pin configuration: Configure both SCL and SDA with SION enabled and open drain enabled . Confirm that T5/GPIO_LPSR_11 is muxed to LPI2C6_SCL and R5/GPIO_LPSR_10 to LPI2C6_SDA. Also verify that the SCL and SDA input DAISY selections point to these pads, and check the pull-ups.
2: Debug interface: Confirm whether you are using SWD or JTAG. These pins(T5 and R5) also have JTAG functions. if JTAG is in use, please check for a pin-mux or board-level connection conflict.
3: Clock configuration: Confirm that the LPI2C6 functional clock is enabled and that the srcClockHz value passed to LPI2C_MasterInit() matches its configured frequency. LPI2C timing depends on that functional clock.
Please retry the transfer after these checks. If it still stops during the address byte, please share the SCL/SDA waveforms and the LPI2C6 MSR value captured after the failure.
Wish it helps you
Best Regards
May Liu Re: LPI2C6 can't send 0 bit? Minor correction, we are actually using JTAG, not SWD. With JTAG disconnected and the configuration suggested by you (fast slew rate, normal drive strength, keeper select), we now get no clock. Re: LPI2C6 can't send 0 bit? Hello May, thank you for your quick response! 1. Regarding the pin configuration, I noticed that it differs slightly from what we had, but SION and open drain were enabled. Regardless, we tried to modify it to match the screenshot exactly - and it still did not work. 2. Regarding JTAG - we are aware of this. We are using SWD, but it seems that the default configuration works as is with no pin configurations. 3. Clock works as expected. The I2C is configured to run at 100khz and it runs at exactly that. Below is how we configure the pads: IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_10_LPI2C6_SDA,1U);
IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_11_LPI2C6_SCL, 1U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_10_LPI2C6_SDA, 0x21U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_11_LPI2C6_SCL, 0x21U); It is my understanding that IOMUXC_SetPinMux handles the input DAISY selections. #define IOMUXC_GPIO_LPSR_10_LPI2C6_SDA 0x40C08028U, 0x2U, 0x40C08090U, 0x1U, 0x40C08068U
#define IOMUXC_GPIO_LPSR_11_LPI2C6_SCL 0x40C0802CU, 0x2U, 0x40C0808CU, 0x1U, 0x40C0806CU This seems correct: The MSR value we get after this is: 0x02000801 Re: LPI2C6 can't send 0 bit? Hi @alex0 ,
Thanks for your updated information.
I recommend switching to SWD for a comparison test and confirming that both the debugger and the RT1170 target board are connected and configured for SWD. Simply unplugging the JTAG probe may not isolate resistors or other circuitry that remain connected to the SDA/SCL nets on the board.
I could not identify pull-up resistors on the SDA and SCL nets in the schematic you shared. Since you mentioned adding two 2.2 kΩ pull-ups, could you please confirm that one is connected to SDA and the other to SCL, and that both are pulled up to the appropriate I/O supply?
Best regards, May Re: LPI2C6 can't send 0 bit? Hi Mary, I'm not sure I understand what you mean by "Simply unplugging the JTAG probe may not isolate resistors or other circuitry that remain connected to the SDA/SCL nets on the board." We flash the image, disconnect the JTAG probe from the board itself, and perform power on reset. Is there some additional configuration that is necessary on the software side to disable JTAG, or is this a hardware issue? The two resistors I mentioned are indeed connected as you described. They are not on the schematic, but are present on the I2C slave side. Re: LPI2C6 can't send 0 bit? Hi May, I'm happy to share the issue has been resolved. The issue stemmed from overlapping pin configurations. The pin mux was defined in the setup for the CM7, and was overwritten by the CM4. We can mark it as solved. Thank you for your time! Re: LPI2C6 can't send 0 bit? Hi @alex0 ,
1: Sorry, my earlier wording was unclear. I did not mean that you need an additional software step to disable JTAG after disconnecting the probe and performing a power-on reset. My concern is whether any subsequent pin configuration might overwrite the LPI2C6 settings for GPIO_LPSR_10/11. Could you please read back the pin-mux, input-selection, and pad-control registers immediately before the transfer to confirm that the LPI2C6 configuration is still in effect?
2: Are the I²C master and slave on the same board? If not, please confirm that they share a common ground.
3: With the probe disconnected, please confirm via UART or GPIO that the application reaches the transfer, and record the transfer return status and LPI2C6 MSR immediately before and after it. If available, SWD debugging could help inspect the registers when the transfer stops.
Best Regards, May
記事全体を表示