STM32 I2C master BUG

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Oscar_T
Posts: 89
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

STM32 I2C master BUG

Post 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

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: STM32 I2C master BUG

Post 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.
Martin

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: STM32 I2C master BUG

Post 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

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: STM32 I2C master BUG

Post by medelec35 »

Hi, yes the macros do look a bit different:
Component differences.png
Component differences.png (87.47 KiB) Viewed 3698 times
The addressH and L has been changed to use one input which will cause an issue if not changed.
Hope this helps?
Martin

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: STM32 I2C master BUG

Post 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

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: STM32 I2C master BUG

Post 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
Martin

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: STM32 I2C master BUG

Post 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.

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: STM32 I2C master BUG

Post by Oscar_T »

Hi ben & medelec

Thanks for your explanations. Now everything works!

Kind regards

Post Reply