Page 1 of 1

STM32 I2C master BUG

Posted: Thu Jul 15, 2021 11:49 am
by Oscar_T
Hello


With i2c master version 5 I can't compile my program

The compiler reports this message to me

"Errors when generating C source code:
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 1 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Mainboard_013.c : 4359 : error : Unknown or missing component: I2C_Master1::SendByteTransaction
Autoclose turned off

If I use version 4 everything is ok

Kind regards

Kind Regards

Re: STM32 I2C master BUG

Posted: Thu Jul 15, 2021 12:25 pm
by medelec35
Hi, Oscar.
It looks the component has had the name of function SendByteTransaction changed to GenericWriteRegister.
If you would like to post your flowchart, or pm if you want to keep it private, I can sort it out for you.
If you want to manually change it yourself, then I can help you with that.

Re: STM32 I2C master BUG

Posted: Thu Jul 15, 2021 4:06 pm
by Oscar_T
Hi Medelec

Thanks for the advice

I changed all SendByteTransaction with GenericWriteRegister. It compiles correctly but it doesn't work ...

Has something else changed or is it just a rename?

Kind regards

EDIT: Macros appear to be slightly different

Re: STM32 I2C master BUG

Posted: Thu Jul 15, 2021 5:07 pm
by medelec35
Hi, yes the macros do look a bit different:
Component differences.png
Component differences.png (87.47 KiB) Viewed 3738 times
The addressH and L has been changed to use one input which will cause an issue if not changed.
Hope this helps?

Re: STM32 I2C master BUG

Posted: Fri Jul 16, 2021 10:48 am
by Oscar_T
Hello

How can I set the new address in the new macro? it consists of two parts (H and L)

For example 0x38, 0x40, 0x0E, 0x10

maybe 0x38, 78, 0x10, 2 ?

Kind regards

Re: STM32 I2C master BUG

Posted: Fri Jul 16, 2021 12:22 pm
by medelec35
As you already have the AddressHighByte & AddressLowByte
In the Address just enter the HighByte then lowByte straight after.
Eg using your example.
Since 0x38 is H and 0x40 is L.
For UInt address enter 0x3840

Re: STM32 I2C master BUG

Posted: Mon Jul 19, 2021 2:57 pm
by BenR
Hi Oscar,

Sorry for the inconvenience, hopefully the modification allows a bit more flexibility in future allowing for device support with 1 or 2 internal address bytes.

How about this.

0x38, 0x400E, 0x10, 0x02

The device address is as was, the Address high and low bytes have been combined together into a 16-bit value, the Data parameter is as was and the Address Byte count is how many bytes in the internal address: 1 or 2.

Re: STM32 I2C master BUG

Posted: Mon Jul 19, 2021 8:23 pm
by Oscar_T
Hi ben & medelec

Thanks for your explanations. Now everything works!

Kind regards