2022-03-28 10:26 PM
@TDK
I am getting error in below line in my code
*((uint8_t*)(CB[arr_index].baseaddress + (CB[arr_index].position*sizeof(uint8_t)))) = *((uint8_t*)data);
This error is not occuring when i am using STMCube IDE but when i am imported my project to IAR embedded workbench this line getting error
can anyone please how to resolve this problem and why it is occuring?
2022-03-28 11:44 PM
The opposite of a complete type is an incomplete type. Like in this line, when a definition of my_unknown_struct is neither given nor included.
struct my_unknown_struct *p;
This is a valid definition of two pointer variables. In the sequel
int i = sizeof(p);
p = NULL;
p = q;
*p = 42;
The first three lines are also valid. The compiler knows everything it must know to generate code, e.g. sizeof(p) is 4.
But, the last line triggers an error, for gcc: error: invalid use of undefined type 'struct my_unknown_struct' comparable to yours.
So, the cause is probably that a complete definition of CB is not visible in IAR but in STM32CubeIDE.
hth
KnarfB