Dear NXP Experts:
My current project requires I2C and using DMA. However, I refernced this article and tried to copy the configuration to RTD 5.0.0 HF01 and it didn't work out.
Hardware setting:
MCU: S32K312-Q172 EVB
External I2C master: FT4222(I2C master, 900KHz)
Pull-up resistor: 4.7 KOhm
Software setting:
SDK: RTD 5.0.0 HF01
Configuration:
Clock: FIRC 48 MHz
Objective Target:
(1) One FlexIO I2C master(using DMA) baudrate: 400 KHz
(2) One LPI2C master(using DMA) baudrate: 400 KHz
(3) One LPI2C slave in fast mode(cater to 900Khz)
1. I config DMA module in S32DS IDE, but some files, such as Dma_Ip_Types.h is not generated and some file content doesn't match my setting.(See below figure)
2. I copy the missing file from the example code and compile my project, nevertheless, my logic analyzer shows that no I2C signal was sent, despite `I2c_GetStatus` returns SUCCESS_STATUS`.
3. Is there any recommend setting about I2c_RequestType when doing a sending or receiving tasks?
My configuration is attached, please take a look and give me some guidance.
Hi @acnhyxgxl1
First, it is important to mention that we do not recommend combining IP drivers with MCAL drivers, as IP drivers are not AUTOSAR-compliant. If you are using IP drivers, MCAL drivers should only be used for specific dependencies, such as DMA configurations.
Also, please note that modifying the RTDs falls outside our support scope. Instead of copying and editing the source code directly, we kindly ask you to share the steps you followed and include screenshots or images showing the situation before the issue occurred. This will help us better analyze the cause of the missing components.
Lastly, we recommend referring to the I2C example codes included with the RTDs. You can find them under the following names:
Additionally, I recommend reviewing the S32K3_S32M27x I2C Driver Integration Manual and the User Manual included with the RTDs. These documents provide detailed information about the driver, including its limitations, hardware and software requirements, usage instructions, and configuration guidelines.
You can typically find these documents at the following location: C:\NXP\S32DS.3.6.2\S32DS\software\PlatformSDK_S32K3\RTD\I2c_TS_T40D34M60I0R0\doc
BR, VaneB
Thanks for the instant reply @VaneB !
I modified my code and use MCAL driver for clear presentation(except UART_Ip for console debugging)
Before switch to DMA, I've verified my pin config and setting work normally in I2C interrupt mode.
Hardware:
MCU: S32K312EVB-Q172
Pull-up resistor: 4.7 KOhm
Software setting:
SDK: RTD 5.0.0 HF01
Configuration:
Clock: FIRC 48 MHz
I2C Objective Goal: (Simplified this time)
1. Channel 0: LPI2C slave using DMA
2. Channel 1: I2C master using DMA with baudrate: 200 KHz
I think RTD 5.0.0 might has some code generating issues, here's my step-by-step setting
Step0: Here's my original Peripheral config.(Only timer, interrupt, port, i2c and UART for debugging). This part works fine before switching to DMA mode. I didn't change I2C Asynchronous Method to USING_DMA just to verify my config has no other issue.
Step1: Add DMA and RM modules.
Step2: Setup DMA module by enable DMA support
Step3: Add 4 DMA logic channels(as this article, using HW CH0, 1 and CH 6, 7)
Step4: Add IRQ to platform module
Step5: Enable dma mux in RM module(resource manager CDD)
Step6: Add 4 Dma_Mux_Module_Config(as RTD 3.0.0 example code)
Step7: GUI shows no error in Step1~6
Step8: Code generation and code compile. Sadly error orruces
Here's the side-by-side comparison between the generated code of RTD 3.0 and 5.0
In Dma_Ip_Cfg.h
In Dma_Ip_Cfg.c
Please kindly point out the mistake in my configuration. Generated code is attached.
Allow me to correct myself.
I forgot to setup the Mcl module, missing config shows up after proper configuration.
Missing Step: Enable DMA support and config dma logic channel in Mcl module.
However, issue still occure. I2C clock and data pulled low after transmit 2 bytes.
1. Set Lpi2c slave using DMA(as Manipulated Variable), Flexio I2c master still using interrupt(as Control Variable).
2. Send 8 bytes of data{0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00}
3. LA shows only write frame and 1st byte of data send, then both SDA & SCL pulled low.
Fixed code and LA file are attached. Please give me some direction about how to fix this.
BR
Hi @acnhyxgxl1
I have reviewed your current configurations and would like to share a few observations: