Hello! I am trying to do an example project for I2C Master output and found the I2c_IP_LPI2C Transfer_S32K344 project to fit my needs.
I got pretty far but I'm met with a compilation error where the I2c_Lpi2cMasterChannel0_VS_0 and I2c_Lpi2cSlaveChannel1_VS_0 is not found.
A little more digging and these are suppose to be the initialization structures for the I2C Init functions. These are defined already in my configuration.mex file but I'm not sure how to generate it using the ConfigTools.
When checking the generated files from the ConfigTools, Lpi2c_Ip_VS_0_PBcfg.h is empty and it looks like Siul2_Port_Ip_Defines.h is not generated. The Siul2_Port_Ip_Defines.h looks to be a very standard file that is easily copied and pasted from the source but the Lpi2c_Ip_VS_0_PBcfg.h looks to be the file that would hold the structs I'm interested in. Though, I'm not too sure about this and would like to check.
For reference, I can manually make the two structs but I believe this will improve the SDK and prevent frustration for future users.
Thank you in advance!
已解决! 转到解答。
Hi,
Unfortunately RTD is not supported (tested) on Linux host OS - that's why you can't select it from Package Manager.
Anyway - I spoke with the dev team and the issue is caused by case sensitive OS. The issue can be fixed by renaming these files:
<DS_install_path>\eclipse\mcu_data\components\PlatformSDK_S32K3_2021_10\Lpi2c
-rename Lpi2c_Ip_PBCfg.c to Lpi2c_Ip_PBcfg.c
-rename Lpi2c_Ip_PBCfg.h to Lpi2c_Ip_PBcfg.h
and by modifying .component file:
<DS_install_path>\eclipse\mcu_data\components\PlatformSDK_S32K3_2021_10\Siul2_Port\Siul2_Port.component
-on line 26: replace <variable value="`../siul2_port/siul2_port_codegenerator.js`" id="codegen_file"></variable>
with <variable value="`../Siul2_Port/siul2_port_codegenerator.js`" id="codegen_file"></variable>
Hope it helps.
Jiri
Hi,
Unfortunately RTD is not supported (tested) on Linux host OS - that's why you can't select it from Package Manager.
Anyway - I spoke with the dev team and the issue is caused by case sensitive OS. The issue can be fixed by renaming these files:
<DS_install_path>\eclipse\mcu_data\components\PlatformSDK_S32K3_2021_10\Lpi2c
-rename Lpi2c_Ip_PBCfg.c to Lpi2c_Ip_PBcfg.c
-rename Lpi2c_Ip_PBCfg.h to Lpi2c_Ip_PBcfg.h
and by modifying .component file:
<DS_install_path>\eclipse\mcu_data\components\PlatformSDK_S32K3_2021_10\Siul2_Port\Siul2_Port.component
-on line 26: replace <variable value="`../siul2_port/siul2_port_codegenerator.js`" id="codegen_file"></variable>
with <variable value="`../Siul2_Port/siul2_port_codegenerator.js`" id="codegen_file"></variable>
Hope it helps.
Jiri
Hello @nwKodiak,
Which RTD version do you use?
I have tried with:
* Autosar Version : 4.4.0
* Autosar Revision : ASR_REL_4_4_REV_0000
* Autosar Conf.Variant :
* SW Version : 1.0.0
* Build Version : S32K3_RTD_1_0_0_P02_D2111_ASR_REL_4_4_REV_0000_20211115
And all the files are generated and I can compile it without any issues.
Do you see any error when you update the code:
You can preview the files:
Regards,
Daniel
Hello @danielmartynek,
I'm using the extension I downloaded from the site:
SW32K3_RTD_4.4_1.0.0_DS_updatesite_D2110.zip
I think this would indicate that my RTD version = 4.4.
I'm not sure about Autosar version. Is there anymore information you might need to help me out?
Hi @danielmartynek,
Is there a specific date or any plans to support Ubuntu LTS 20.04?
I'm not too sure if I would want to switch over and if the date is close I can wait with the current solution that I developed.
Hello @danielmartynek,
Thanks for the investigation! I was already able to solve my problem through finding the struct and filling out the information for the struct.
I'll add my code for reference:
//current state of the i2c master channel status
Lpi2c_Ip_MasterStateType i2c0_dev_curr_state;
Lpi2c_Ip_BaudRateType i2c0_init_baudrate = {
//set baudrate struct (heavily affects frequency)
// currently set to ~400kHz
.Prescaler = LPI2C_MASTER_PRESC_DIV_8, // <-- changes SCL
.ClkHI = 4, // <-- changes SCL
.ClkLO = 4, // <-- changes SCL
.SetHold = 1, // check if changes SCL (data dependent so probably changes SDA)
.DataValid = 2,// check if changes SCL (data dependent so probably changes SDA)
//high speed is not used. Check configuration.mex file.
.ClkHIHS = 1,
.ClkLOHS = 3,
.SetHoldHS = 2,
.DataValidHS = 1
};
Lpi2c_Ip_MasterConfigType i2c0_master_config = {
//set master config
// .SlaveAddress = 0x68, //set in runtime
.Is10bitAddr = 0,
.OperatingMode = LPI2C_STANDARD_MODE,
.BaudrateParams = i2c0_init_baudrate,
.PinLowTimeout = 0,
.BusIdleTimeout = 0,
.GlitchFilterSDA = 1,
.GlitchFilterSCL = 1,
.MasterCode = 0,
.TransferType = LPI2C_USING_INTERRUPTS,
// .DmaTxChannel = NULL, //not using
// .DmaRxChannel = NULL, //not using
.MasterCallback = NULL,
.CallbackParam = 1,
.MasterState = &i2c0_dev_curr_state,
};
Hello @nwKodiak,
It seems like this is not an issue of the IDE but the RTD drivers that are nor supported on Linux at all.
So I would recommend using Windows if possible.
Regards,
Daniel
Hi there, @danielmartynek,
We are having the same problem, Siul2_Port_Ip_Defines.h is not generated in Ubuntu 18.04. I have reinstalled everything, followed S32 installation guide for S32G platform, the M7 core example for LED blinking a few times. No luck.
The problem seems to be with RTD not generating Siul2_Port_Ip_Defines.h after clicking Update Code button.
Any anything on this topic?
Thanks,
Kawin