Compile Error in MCUXpresso SDK v2.13.0, v2.14.0 and v2.15.0 fsl_flexio_i2c_master.c

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

Compile Error in MCUXpresso SDK v2.13.0, v2.14.0 and v2.15.0 fsl_flexio_i2c_master.c

1,647 Views
sachin_patel
Contributor III

EDIT 17/01/2024: Adding that v2.15.0 still fails compilation. Bug was reported shortly after the v2.14.0 release.

 

Hi,

I am compiling all device driver files into a static library, but one file is failing compilation "fsl_flexio_i2c_master.c"

The following functions are broken if "I2C_RETRY_TIMES" is defined. We define this to prevent getting stuck in an infinite loop.

 

 

 

static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base,
                                                             flexio_i2c_master_handle_t *handle,
                                                             uint32_t statusFlags)

static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base,
                                                          flexio_i2c_master_handle_t *handle,
                                                          uint32_t statusFlags)

static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base,
                                                                  flexio_i2c_master_handle_t *handle,
                                                                  uint32_t statusFlags)

static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base,
                                                                 flexio_i2c_master_handle_t *handle,
                                                                 uint32_t statusFlags)

 

 

To fix, within each block, please initialise the `waitTimes` variable as follows:

 

 

#if I2C_RETRY_TIMES
                uint32_t waitTimes = I2C_RETRY_TIMES;
                ...

 

 

Labels (1)
7 Replies

686 Views
sachin_patel
Contributor III

Hi,

Can someone from NXP please report this bug so it can be triaged as it has been in the SDK for 3 releases now and is blocking us from upgrading to the latest SDK releases.

Thanks,

Sachin Patel

0 Kudos

1,513 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @sachin_patel,

Thanks for sharing your workaround. You might also fix this using waitTimes as a global variable instead of writing it as local to each one of the functions:

#if I2C_RETRY_TIMES
    uint32_t waitTimes = I2C_RETRY_TIMES;
#endif

We are letting the team in charge to know about this. Just for double check, could you please tell us which MCU's SDK are you using? We found this issue in K32L2A41xxxxA's SDK v2.14.0 and v2.13.0, did you find this issue in another SDK?

Best regards, Raul.

756 Views
sachin_patel
Contributor III

Hi @RaRo ,

This bug was not fixed in the v2.15.0 release of the SDK that was shipped a few days ago. Do you have a timeline on when this bug will get resolved?

Thanks,

Sachin Patel

0 Kudos

1,456 Views
sachin_patel
Contributor III

Hi @RaRo,

Thank you for the quick response.

I am using the K32L2A31xxxxA SDK which might be the same as the K32L2A41xxxxA SDK. I was upgrading from v2.12.0 to v2.14.0 (we skipped v2.13.0) so I was unaware it was in the previous release.

By the way, I think defining waitTimes as a global variable will be problematic as it should be reset at the beginning of each function. Please use the fix as I provided below.

Thanks,

Sachin Patel

0 Kudos

1,415 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @sachin_patel,

Thanks for your response. We are reporting this situation to the team in charge with your workaround.

Once again, thanks for sharing your feedback.

Best regards, Raul.

0 Kudos

1,620 Views
jst28
Contributor I

I am also facing the same issue compiling the latest SDK 2.14.0

1,604 Views
sachin_patel
Contributor III

That's interesting, was this on the same file?

Which MCU are you using?