Skip to main content
Associate
April 22, 2024
Question

Warning after code generation

  • April 22, 2024
  • 3 replies
  • 1369 views

Hi,

 

I got the following warning after generating the code for evspin32g4:

Description Resource Path Location Type
array subscript 1 is above array bounds of 'PWMC_Handle_t *[1]' {aka 'struct PWMC_Handle *[1]'} [-Warray-bounds] mc_tasks.c /xxx/Application/User line 831 C/C++ Problem

Code line on 831 is:

CodeReturn |= PWMC_IsFaultOccurred(pwmcHandle[bMotor]); /* check for fault. It return MC_OVER_CURR or MC_NO_FAULTS

Versions applications:

motorcontrol workbench: 6.2.1

STM32CubeMX: 6.11.0

STM32CubeIDE: 1.15.0

I did not added only code yet. Only thing I did yet is converting the code from c to c++. If I convert back the warning is still there after building. Could someone help me please with this warning?

 

    3 replies

    AScha.3
    Super User
    April 22, 2024

    Hi,

    and if you make new project (same), with standard settings (C code.) - what then : warning also ?

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    TmasinAuthor
    Associate
    April 22, 2024

    Hi,

    With new project and no changes (C code), I still has the same problem

    Gael A
    ST Employee
    April 22, 2024

    Hello Tmasin,

    Thank you for your report. We will start working on a fix and we will come back to you shortly once we know more about it.

    In the meantime, know that this warning should not prevent you from running the code successfully. 

    If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.
    ST Employee
    May 17, 2024

    Hello,

    This issue has been fixed in our new MCSDK 6.3.0 release,
    so feel free to download it and try if it solved correctly your issue reported in this post.

    Kind Regards.

    Amina.