MQX 4.2 BSP Compilation Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX 4.2 BSP Compilation Error

Jump to solution
1,413 Views
kackle123
Contributor IV

When I try to compile the BSP for a clone of a FRDM-K64F board (120 MHz), I get the following errors:

 

C:/Freescale/CW MCU v10.6/MCU/ProcessorExpert/lib/Kinetis/pdd2/MK64FN1M0LQ12/system/CPU_Init.c: In function 'CPU_EnableInt':

C:/Freescale/CW MCU v10.6/MCU/ProcessorExpert/lib/Kinetis/pdd2/MK64FN1M0LQ12/system/CPU_Init.c:1035:2: error: expected string literal before 'CPSIE'

C:/Freescale/CW MCU v10.6/MCU/ProcessorExpert/lib/Kinetis/pdd2/MK64FN1M0LQ12/system/CPU_Init.c: In function 'CPU_DisableInt':

C:/Freescale/CW MCU v10.6/MCU/ProcessorExpert/lib/Kinetis/pdd2/MK64FN1M0LQ12/system/CPU_Init.c:1051:2: error: expected string literal before 'CPSID'

 

I traced it to missing quotes in an assembly function call (asm(CPSIE, f)), but my correction gets removed every time I re-generate the Processor Expert files.  Is there a way for me to fix this permanently?  Thank you.

Labels (1)
0 Kudos
1 Solution
1,120 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Strange.

On my side I've the following:

++++++++++++++++++++++++++

#define __EI()\

do {\

  /*lint -save  -e950 Disable MISRA rule (1.1) checking. */\

    __asm("CPSIE f");\

  /*lint -restore Enable MISRA rule (1.1) checking. */\

} while(0)

/* Disable maskable interrupts */

#define __DI() \

do {\

  /*lint -save  -e950 Disable MISRA rule (1.1) checking. */\

    __asm ("CPSID f");\

  /*lint -restore Enable MISRA rule (1.1) checking. */\

} while(0)

++++++++++++++++++++++++++

But I know what is the problem ...

When you add a new processors you need to select a compiler between:

    - CodeWarrior ARM C Compiler

    - GNU C Compiler

This is confusing as the CodeWarrior ARM C Compiler is not available for all devices.

The BSP project is using the GNU compiler as the folder is: \Freescale_MQX_4_2\mqx\build\cw10gcc\bsp_twrk64f120m.

cw10gcc is for GNU build tool chain.

I met the problem 2 weeks ago and logged an issue in our bug base for this problem.

For me the build tool chain proposed should be linked to the project.

This is not checked.

Back to your problem.

Here you need to select the "GNU C Compiler" and not the "CodeWarrior ARM C Compiler"


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
8 Replies
1,120 Views
trytohelp
NXP Employee
NXP Employee

Hi,

By default when Processor Expert is generated or re-generated the processor Expert files are updated.

If you applied some modifications in the pe files, they will be lost and replace by default source files.

All PEx files included in the Generated_Code are re-generated and all modifications lost.

In this case you don't must re-generate PE..

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,120 Views
kackle123
Contributor IV

Is there a way to fix this permanently - why is PE putting that bug in its generated code?  Should I file a bug report?  Thank you.

0 Kudos
1,120 Views
trytohelp
NXP Employee
NXP Employee

This is my configuration:

    Windows 7 64 bit

    CW for MCU V10.6.4 (all updates installed - 10.6.5)

    MQX v4.2

With this configuration I've opened the \Freescale_MQX_4_2\mqx\build\cw10gcc\bsp_frdmk64f\bsp_frdmk64f.wsd file.

To generate the bsp, I've generated the PEx code and after build the bsp_frdmk64f project.

I can build the project without problem.

It seems it's not the case on your side - in this case you should have a problem.

Did you changed something in the PEx configuration ?

All files included in the Generated_Code are removed and re-generated when you select "Generate Processor Expert Code".

So if you applied some modifications in a file listed in this project folder for instance in cpu.c file, all modifications will be lost.

Now there are some options for Processor Expert which can be defined via the properties.

To access them click on View Menu + Properties

pastedImage_0.png

pastedImage_1.png

Here you can modify some settings if you want.

The  Freeze code Generation can be switch to YES to freeze the code. Then Processor Expert code can not be re-generated.

Excepted this option forbidden the PEx code generation, in all other case the files listed under Generated_Code Folder will be always updated

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,120 Views
kackle123
Contributor IV

Pascal,

Thank you for your responses.  I think I know how to recreate this issue:

1) Clone the BSP of the TWRK64F120M.

2) Drag its .WSD into CodeWarrior (CW).

3) Open Processor Expert (PE).

4) Add the MK64FN1M0VLQ12 CPU only.

5) Delete all other CPUs that are there.

6) Under the CPU Methods list, turn on code generation for Enabling Maskable Interrupts.

7) Under the CPU Methods list, turn on code generation for Disabling Maskable Interrupts.

8) Delete the PWM Component below since it causes errors and isn't needed for this test.  Save all...

9) Delete the Generated Code folder within CW, and tell PE to regenerate it.

10) Clean the BSP project and then build it; that's when I get those "CPSIE" and "CPSID" errors.

Do you see the same result?  Thank you.

0 Kudos
1,120 Views
trytohelp
NXP Employee
NXP Employee

Hi,

I followed your process but I don't reproduced the problem.

My config is CW for MCU V10.6.4 + all patches installed and MQX V4.2.

For the point 4 and 5 you can change directly the CPU and don't need to add a new one.

After to have changed/modified the PEx configuration you don't need to remove the generated folder.

Just re-generate PEx code will update the folder.

I will created a video showing the process and will post it asap.

     - with video


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,120 Views
kackle123
Contributor IV

Pascal,

Thank you for your efforts and your video.  I looked at the problem more closely; when you changed my test (steps 4 & 5), you skipped over the error!  Try my test again as I think there is a bug in PE.  To save your time, after you generate the code, you can see in Generated_Code\PE_Types.h that

__asm(CPSIE f);

__asm (CPSID f);

should be

__asm("CPSIE f");

__asm ("CPSID f");

Can you confirm this?

0 Kudos
1,121 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Strange.

On my side I've the following:

++++++++++++++++++++++++++

#define __EI()\

do {\

  /*lint -save  -e950 Disable MISRA rule (1.1) checking. */\

    __asm("CPSIE f");\

  /*lint -restore Enable MISRA rule (1.1) checking. */\

} while(0)

/* Disable maskable interrupts */

#define __DI() \

do {\

  /*lint -save  -e950 Disable MISRA rule (1.1) checking. */\

    __asm ("CPSID f");\

  /*lint -restore Enable MISRA rule (1.1) checking. */\

} while(0)

++++++++++++++++++++++++++

But I know what is the problem ...

When you add a new processors you need to select a compiler between:

    - CodeWarrior ARM C Compiler

    - GNU C Compiler

This is confusing as the CodeWarrior ARM C Compiler is not available for all devices.

The BSP project is using the GNU compiler as the folder is: \Freescale_MQX_4_2\mqx\build\cw10gcc\bsp_twrk64f120m.

cw10gcc is for GNU build tool chain.

I met the problem 2 weeks ago and logged an issue in our bug base for this problem.

For me the build tool chain proposed should be linked to the project.

This is not checked.

Back to your problem.

Here you need to select the "GNU C Compiler" and not the "CodeWarrior ARM C Compiler"


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,120 Views
kackle123
Contributor IV

Thank you, Pascal.  This was indeed the issue.  I appreciate your help and wish you pleasant holidays!

0 Kudos