You are here

PSOC Creator 3.3 compile error in CyLib.h | Cypress Semiconductor

PSOC Creator 3.3 compile error in CyLib.h

Summary: 6 Replies, Latest post by RA1981 on 03 Jun 2016 02:02 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
user_193124556's picture
128 posts

Creator 3.3 ( seems to have a bug in the CyLib.h file.


I've got a PSoC5 project, nothing fancy.. USB and a bunch of FF and UDB timers. Generation works fine but building the application results in two errors in CyLib.h on line 442.


CyLib.h line 442 looks like this:


    * Instruction Synchronization Barrier flushes the pipeline in the processor,
    * so that all instructions following the ISB are fetched from cache or
    * memory, after the instruction has been completed.

    #if defined(__ARMCC_VERSION)
        #define CY_SYS_ISB       __isb(0x0f)
    #else   /* ASM for GCC & IAR */
        #define CY_SYS_ISB       asm volatile ("isb \n")
    #endif /* (__ARMCC_VERSION) */

#endif /* (CY_PSOC5) */

The errors are

prj.M0120: Build error: 'asm' undeclared (first use this function)
prj.M0120: Build error: expected ';' before 'volatile'


Before I go digging through everything trying to fix this, has anyone else run across this?


user_1377889's picture
9249 posts

There are two underscores missing. The correct statement has to be __asm volatile(...)



user_78878863's picture
2551 posts

But CyLib.h should be generated code, right? @akohlsmith: Did you modify it his file? Can you try 'clean and build' to re-generate it?

user_1377889's picture
9249 posts

Error is in generated file. But what the hack do you need the pipeline flash for? Which component gives you the error???



user_193124556's picture
128 posts

I found the error. the generated file is correct as-is.  I had added -std=c99 to my compiler options trying to correct something *else* and that caused this error. Removing my manually-added -std=c99 allowed the file to build fine.


@Bob: there is nothing funny in this design. A couple clocks, some synchronizer blocks, FF and UDB 16-bit timers, the USB device and pins. That's it.

Cypro100's picture
2 posts

I have the same problem. I had the following error:

.\RolandRiegel\cyp_fat.c:505:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
     for(cluster_t cluster_left = cluster_count; cluster_left > 0; --cluster_left, ++cluster_current)

I added the -std=c99 to the command line and this error went away. Now I have the 'asm' problem with the cache thing.


RA1981's picture
211 posts

I can't say if it would help with your current problem, but if it's needed to enable a dedicated C version, you can try if -std=gnu99 will give the same error.

If this doesn't work, it would be better if you create a project archive and post it here, so we can check how to solve the error.





Log in to post new comments.