I2C Communication Configuration Failed in MBDT 1.4.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C Communication Configuration Failed in MBDT 1.4.0

1,542 Views
SuperBeginner
Contributor III

Dear NXP,

I try to setup I2C on S32CT, but it gets error.

I provide my steps to let you understand the situation. The step is:

1.  Choose Hardware: S32K312EVB-Q172

1.PNG

2. SET I2C PINS: LPI2C1 SCL, SDA

2.PNG

3. Make sure LPI2C1 Clock Reference: AIPS_SLOW_CLK

3.PNG

4. Add I2C tab

4.PNG

5. Mcu tab: LPI2C 1 Clock Setting & Enablement

5.PNG

6.PNG

9.PNG

10.PNG

6. LPI2C1 Setting: Standard Mode, 100kb/s, Slave address: 10bits, using Interrupt

7_I2C_config_1.PNG

8_I2C_config_2.PNG

7. LPI2C1 Interrupt Configuartion in Platform Tab

11.PNG

12.PNG

8. Code Generation

13.PNG

9. Add I2C component in the Board initialization

14_BoardInitialization.PNG

10. Simulink Model - Build, Deploy & Start 

15.PNG

When I try to building the program, it gets an error message.

The reason I found the error was because it didn't find "Dem.h".

16_errorMessage.PNG

Therefore, I would like to ask you where the error occurred in my construction steps, which caused this problem.

Could you help me, please?

(BTW. The Environment is MBDT 1.4.0, Matlab 2021a, S32K312EVB-Q172)

 

Thanks in advance

 

0 Kudos
Reply
6 Replies

1,510 Views
CristinaB
NXP Employee
NXP Employee

Hello @SuperBeginner,

Thank you for your interest in Model-Based Design Toolbox for S32K3.

The encountered error occurred because the Dem component is not configured in the S32CT project, and the Dem source and header files are not copied to the Config folder next to the model at build time. This error can also be bypassed by checking the I2c Disable Production Error Reporting option in the I2c component. When this option is checked, the Dem.h file is no longer included in the CDD_I2c.h file.

I2c ConfigurationI2c Configuration

However, I would recommend you to install MBDT for S32K3 1.5.0 as it contains support for the I2c component, i.e. configurations in the S32CT/EB Tresos projects, blocks that implement each function and ready-to-use examples for several boards, including for the S32K312EVB-Q172 board.

Hope this helps,
Cristina

0 Kudos
Reply

1,493 Views
SuperBeginner
Contributor III

Dear @CristinaB ,

Thanks for the suggestion, but due to some personal reasons I am currently unable to install MBDT 1.5.0.

Back to the topic, I followed your suggestion and solved the problem of program errors caused by ""Dem.h": No such file or directory".

i2c_config_dem.PNG

 

However, another error message is currently generated, namely "xx_Config/RTD/src/I2c_Ipw.c:221: undefined reference to 'MBDT_I2c_Callback'".

i2c_err.PNG

I check "xx_Config\src\mbdt_board_init.c" and find that the program lacks the declaration of the I2C Callback function, that is, "__attribute__((weak))void MBDT_I2c_Callback(uint8 Event, uint8 Channel) {}"

I guess that's why the error occurs.

Could you help me to solve this problem?

I upload my file to let you understand the situation.

 

Thanks in advance

0 Kudos
Reply

1,470 Views
SuperBeginner
Contributor III

Dear @CristinaB ,

Do you have any suggestions for solutions regarding I2C configuration?

Could you help me, please?

Thanks

0 Kudos
Reply

1,450 Views
CristinaB
NXP Employee
NXP Employee

Hello @SuperBeginner,

We can help you resolve the error you encountered, but other errors will appear later because adding support for a peripheral is a more complex process.
Do you have certain requirements that compel you to use MBDT 1.4.0 or do you have any errors when installing MBDT 1.5.0?
We recommend that you install the latest version because it contains full support for I2C, if you have any errors we can help you solve them.

Best regards,
Cristina

0 Kudos
Reply

1,433 Views
SuperBeginner
Contributor III

Dear @CristinaB ,

As for why I currently need to use MBDT 1.4.0, I can simply explain to you why.

I have previously published several articles on the forum about issues related to the use of MBDT 1.5.0.

After the engineer's suggestion, I found that my matlab version is not supported, it is matlab R2020b. I always thought my MATLAB version was R2021a

We believe that there should be too many versions of MATLAB installed on the computer, which always complicates the situation when using the toolbox.

Therefore, I recently changed another computer and there is only one version of MATLAB, R2021a.

Its MBDT version is 1.4.0 as it was installed on 2024/04.

However, due to internal company regulations, I am currently unable to install any programs

To sum up, this is why I can't use MBDT 1.5.0 but can use MBDT 1.4.0.

So I still need to trouble you to explain why I get such an error in the I2C configuration and how to solve it?

I think this helps me a lot because I still have some features to develop that you don't support yet, like RTOS and WDG.

Therefore, I think it is a necessary challenge and task to be familiar with the program that calls from S32CT.

Thank you for your reply.

0 Kudos
Reply

1,383 Views
SuperBeginner
Contributor III

Dear @CristinaB ,

Could you help me to solve this problem?

Thanks in advance

0 Kudos
Reply