PSOC Creator 3.3 compile error in CyLib.h

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

cross mob
Anonymous
Not applicable

Creator 3.3 (3.3.0.410) 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:

   
#if(CY_PSOC5)      /***************************************************************************     * 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?

0 Likes
1 Solution
Anonymous
Not applicable

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.

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

   

 

   

Bob

0 Likes
Anonymous
Not applicable

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.

0 Likes
JaMi_334126
Level 1
Level 1
5 replies posted Welcome! First question asked

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.

0 Likes
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

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.

   

 

   

Regards,

   

 

   

Ralf

0 Likes