Compilation error in "cyPm.h"

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
yuna_4671381
Level 1
Level 1

The device is developed using PSOC5 (PSoc Creator 4.3) on CY8C5888AXI-LP096.

Although cyPm.h is generated by the code generation at compile time, the following generated code causes a compile error.

         #define CY_PM_WFI asm volatile ("WFI \n")

"__asm" should be generated, but "asm" is generated.

Please tell me how to solve it.

0 Likes
1 Solution

To update the cy_boot, right click project and navigate to "Update Components" item. Click it and then the cy_boot shows as the following capture.

pastedImage_0.png

View solution in original post

0 Likes
6 Replies
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

I tried on my end that I have correct macro defined in line#205 cyPm.h -

#else   /* ASM for GCC & IAR */

        #define CY_PM_WFI       __asm volatile ("WFI \n")

    #endif /* (__ARMCC_VERSION) */

This file located in the following path on my end - C:\Program Files (x86)\Cypress\PSoC Creator\4.3\PSoC Creator\psoc\content\CyComponentLibrary\CyComponentLibrary.cylib\cy_boot_v5_90\PSoC5\API

What's your compiler used?

0 Likes

Thank you for your comment.

The compiler is using:

ARM GCC 5.4-2016-q2-update

Also, the gcc settings are attached.

01.png

02.png

03.png

04.png

05.png

06.png

07.png

08.png

09.png

10.png

0 Likes

Can you find out the specific cyPm.h file under your PSoC Creator installaiton path?

Is it correct or not correct? Generally, this file should has no such error.

0 Likes

I investigated PSoC Creator installaiton path.

cy_boot_v4_x is defined as "asm", and cy_boot_v5_x is defined as "__asm".

The file header of the automatically generated cyPm.h is as follows.

* File Name: cyPm.h

* Version 4.0

I assume that using v5 components will clear the error, but I don't know how to select the version of the cy_boot component.

Please teach me how to select the version of the cy_boot component.

0 Likes

To update the cy_boot, right click project and navigate to "Update Components" item. Click it and then the cy_boot shows as the following capture.

pastedImage_0.png

0 Likes
Hvdbrand
Level 1
Level 1
First solution authored 10 sign-ins 5 sign-ins

I stumbled upon this topic dealing with the same issue using PSoC Creator 2.2 and trying to compile my code using the C99 standard.

In that version of PSoC Creator, I did not have the option to upgrade to a newer cy_boot component.

The issue arises because the generated code uses "asm" for assembler code.

This is a construct that is gcc specific.

In the C99 standard, the construct "__asm__" is introduced.

So when gcc is configured to build with "-std=c99" it only allows the "__asm__" construct.

Therefore, in my case I needed to make sure not to compile with "-std=c99".

0 Likes