nxp-mcuxpresso / vscode-for-mcux

Support for NXP Visual Studio Code for MCUXpresso Extension project.
13 stars 0 forks source link

__ASM volatile assembly problem #16

Closed MaxOvervoordee closed 9 months ago

MaxOvervoordee commented 9 months ago

Hi,

I'm having difficulty finding a solution for the next problem: When i'm building my code, i get an "inconsistent operand contraints in an 'asm'" error. In MCUXpresso thecode builds without a problem, but in zephyr i get 8 of these errors. The code that got the error is the following:

#else
    __asm volatile( 
                    #if defined(__GNUC__) && !defined(__ARMCC_VERSION)  /* For GCC compiler */
                        ".syntax unified \n"           /* Using unified asm syntax */
                    #endif
                    "vcvt.s16.f32 %1, %1, #15 \n"       /* Converts between floating point and fixed point */
                    "vmov %0, %1 \n"                    /* f16Out = fltVal */
                    : "=l"(f16Out): "t"(fltVal));
#endif

Maybe im missing something regarding cmake settings with the compiler, that's what i'm guesssing but i can't find a fix for it

DragosMiloiuNXP commented 9 months ago

Hi @MaxOvervoordee,

The error is caused by differences in FPU configuration between MCUXpresso SDK and Zephyr.

In order to change the Zephyr configuration for the project please follow these steps:

With this change the application (with the snippet above) built successfully on LPCXpresso55s69.

MaxOvervoordee commented 9 months ago

Yes thank you this helped me intensely!