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

PSoC™ Creator & Designer Forum Discussions

euggersh
Level 4
Level 4
5 sign-ins First solution authored 50 replies posted

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.

0 Likes
1 Solution

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.

View solution in original post

0 Likes
7 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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

0 Likes

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.

0 Likes

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:

pastedImage_0.png

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

0 Likes

pastedImage_0.png

IRQUART_cfg is defined for the M4 core and not for the M0+ core.

pastedImage_1.png

0 Likes

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,

0 Likes

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?

0 Likes

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.

0 Likes