- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a PSoC 6 project, I have some shared header files which have sections for the two different cores, enabled or disabled by checking the CY_CPU_CORTEX_M0P and CY_CPU_CORTEX_M4 macros.
It seems that in the development environment, this always resolves to the M0+, even when the file being edited is for the M4. This causes the IDE to incorrectly display error flags even though the code builds without errors.
How does one get around this?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you are using ARM MDK generic as compiler toolchain, thus in the text editor it is showing like only Cortex-M0 ( i.e __CORTEX_M = 0, as content for #if (__CORTEX_M==4) is getting greyed out) is active.
If you switch to ARM GCC as compiler toolchain, then the reverse will occur.
It's a limitation that while editing files in Creator, the Intellisense in Creator is not able to know which file is for which core.It takes by default either M0 or M4 initially as active as supplied to it by compiler toolchain selected, then only at build time it actually can understand which file is for which core.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Both the defines CY_CPU_CORTEX_M0P and CY_CPU_CORTEX_M4 are defined in same cy_syslib.h file present in in PSoC Creator 4.2.
Can you please provide screenshot of error flags or the project to understand the issue better
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know where they're defined. That's why the code builds without errors. That has nothing to do with what's displayed at edit time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I created sample.h header file inside Shared folder and tried using macros CY_CPU_CORTEX_M0P and CY_CPU_CORTEX_M4 in that as shown below:
I didn't observed any kind of error or error flag during edit time.
Can you please share the screenshot of error flag that you are observing at edit time to understand the issue better.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IRQUART_cfg is defined for the M4 core and not for the M0+ core.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This error is showing because Inline Code Diagnostics setting has been enabled which is part of Clang Compiler.
This feature is enabled by default. You can disable it under the Text Editor Options.
The diagnostics displayed in the editor may not correspond to the errors/warnings generated when performing a build. This is because the editor uses a generic build framework that does not have identical rule checkers as the active toolchain. Because of this, none of the diagnostics are displayed in the Notice List. The errors/warnings displayed in the Notice List are strictly limited to what is generated for the current design configuration.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So the solution to this PSoC Creator bug that makes the inline code diagnostics not completely useful is to disable it entirely and make it completely useless?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you are using ARM MDK generic as compiler toolchain, thus in the text editor it is showing like only Cortex-M0 ( i.e __CORTEX_M = 0, as content for #if (__CORTEX_M==4) is getting greyed out) is active.
If you switch to ARM GCC as compiler toolchain, then the reverse will occur.
It's a limitation that while editing files in Creator, the Intellisense in Creator is not able to know which file is for which core.It takes by default either M0 or M4 initially as active as supplied to it by compiler toolchain selected, then only at build time it actually can understand which file is for which core.