- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are two underscores missing. The correct statement has to be __asm volatile(...)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Error is in generated file. But what the hack do you need the pipeline flash for? Which component gives you the error???
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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