2018-11-12 09:31 AM
I am trying to send a uint8 through the "Input Data" port on the I2C_Write block. According to the I2C polling example the block expects a uint8. However, when I build the C code and look at it in Keil I get an error in the "User's Data declarations for I2C_Write" saying
"Error: Cannot take the address of an rvalue of type 'uint8_T' (aka 'unsigned char')
I have provided screen shots of my project
Solved! Go to Solution.
2018-11-12 12:19 PM
Looks like things are a bit broken. My guess would be that the address isn't being handled properly. Looking at the tlc file for the block which should be in the install directory I see the following.
STM32\blks\mex\tlc_c\I2C_Write.tlc on line 230
%else
%if !%<LibIsEmpty(Target_Register)>
%assign Data_str = LibBlockInputSignal(0, "", "", 0)
uint8_t* %<block_name>_aTxBuffer = &%<Data_str>;
%endif
%endif
I think this is not suppose to be done this way:
I would look into the function LibBlockInputSignaladdr instead.
2018-11-12 12:19 PM
Looks like things are a bit broken. My guess would be that the address isn't being handled properly. Looking at the tlc file for the block which should be in the install directory I see the following.
STM32\blks\mex\tlc_c\I2C_Write.tlc on line 230
%else
%if !%<LibIsEmpty(Target_Register)>
%assign Data_str = LibBlockInputSignal(0, "", "", 0)
uint8_t* %<block_name>_aTxBuffer = &%<Data_str>;
%endif
%endif
I think this is not suppose to be done this way:
I would look into the function LibBlockInputSignaladdr instead.
2018-11-14 07:58 AM
Wow, thanks Taylor! Changing removing the LibBLockInputSignal and adding the LibBlockInputSignaladdr function in STM32\blks\mex\tlc_c\I2C_Write.tlc worked!
You should get a job at ST!