Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Strange compiler error/warning flagging [SOLVED]

I encountered two issues regarding compiler error/warning flagging

Issue 1 (fake error flagging)

errors are flagged, but the project is build ok. Yes, I have cleared the error protocol, cleaned the project and rebuilt. The errors randomly occur when referencing fields of a structure, although the structure/variabole definition is accepted and the struct shows up hitting ctrl-space. The fields not’t, however.

TIM_TimeBaseInitTypeDef TIMBaseInitStruct; // ok
TIMBaseInitStruct.TIM_Prescaler = 1; //TIM_Prescaler causes error
TIMBaseInitStruct.TIM_Period = 24000; //TIM_Period causes error
TIM_TimeBaseInit(TIM1, &TIMBaseInitStruct);
TIM_Cmd(TIM1, ENABLE);

there is no include/include path issue, or else everything would be rejected.
Anyways code is happily built.

Issue 2 (fake warnings)

what the heck causes the compiler to flag the example below as syntax error WARNING(!).
All of it. All 3 lines get yellow wiggly lines.

No symbol resolution issues here.

void CPAL_I2C_BERR_UserCallback(CPAL_DevTypeDef pDevInstance) {
NVIC_SystemReset();
}

Just out of interest, I deleted the project, generated a new one, added in my files and *TATA* problem gone. Only to reappear and stick around after some edit/compile cycles in random files.
well, not exactly random. Seems to affect only std_peripheral_lib structures.

The issues are not really destrous (or are they? hell knows what is built in the end).
Anyways they are extremly annoying.

KR Martin.

Problem solved courtsey user ‘mazensaad’.

Project >> C/C++ Index >> Freshen all files

Maybe some day I’ll come to understand the (il)logics of Eclipse.


I have almost the same issue yet mine flags an error and will not build. I tried the solution above but it did not fix the issue.

typedef struct cli_cmd_struct
{
int num;
uint8_t *str;
uint8_t rw;
uint8_t *optMAX_CLI_CMD_OPTS;
uint8_t *valMAX_CLI_CMD_VALS;
} cli_cmd;

cli_cmd CliCmd;
CliCmd.num = 0; //This causes a build error

France

Hi,

If your code is as you show, the error is normal: the last line ( CliCmd.num = 0; ) is an assignment; it can’t be placed at global file level, but must be inside some function.

If you want to statically initialize CliCmd by just setting num to 0, you must replace your last two lines by cli_cmd CliCmd = { .num = 0 };

Be careful not to forget the dot before num; if you need to also initialize other fields separate them by commas inside the braces (the order does not mind).

Note however that, if you want to initialize all fields to zero, you may as well do nothing, as the C compiler will initailize all non-initialized variables and fields to 0.

Bernard (Ac6)

Thanks for the quick reply and help

Yes I saw that issue after posting the question and as you stated after changing the location of the subsequent assignment it worked.