hi,
I am trying to use PE driver in my MQX 4.0 project. Acording to the Freescale_MQX_4_0\doc\tools\cw\FSL_MQX_in_CW_10_x document, I added some PE components in bsp project, and configure them carefully. Then I build the bsp project. But how can use the PE code in my application project? I checked Freescale_MQX_4_0\lib\twrk60n512.cw10\debug\bsp\Generated_Code folder, according to my understanding, there should be PE related header files in this folder, but actrually there is only a PE_LDD.h in this folder...
Is there any steps I missed to enable using PE in MQX4. Thanks for your help in advance.
Solved! Go to Solution.
Hi Juan,
I didn’t get the error you had but had to do a couple of modifications to the BSP as shown below. After re-compiling the BSP, then opening the pe_demo, it compiled without issue.
Add to BSP Properties:
"$/Generated_Code/IO_Map.h"
Copy C:\Freescale\CW MCU v10.6\MCU\ProcessorExpert\lib\Kinetis\iofiles\MK60F12.h
To C:\Freescale\Freescale_MQX_4_1_0_GA_RC7\mqx\build\cw10gcc\bsp_twrk60f120m\Generated_Code\IO_Map
MK60F12.h is in the BSP BUT it is a link to the CW10.6 path and the file is not physically copied into the BSP\IO_Map folder. Copying it resolved BSP build issue.
Regards,
David
Hi Shicheng,
Please verify the same compiler is being used for the RTOS build and the MQX application (pe_demo). I have made that mistake before.
Regards,
David
Hello, I have followed your cooments but when I try to build the project pe_demo_twrk60f120m I get the error:
Does anyone know why I get this error and how it could be resolved?
Hi Juan,
I didn’t get the error you had but had to do a couple of modifications to the BSP as shown below. After re-compiling the BSP, then opening the pe_demo, it compiled without issue.
Add to BSP Properties:
"$/Generated_Code/IO_Map.h"
Copy C:\Freescale\CW MCU v10.6\MCU\ProcessorExpert\lib\Kinetis\iofiles\MK60F12.h
To C:\Freescale\Freescale_MQX_4_1_0_GA_RC7\mqx\build\cw10gcc\bsp_twrk60f120m\Generated_Code\IO_Map
MK60F12.h is in the BSP BUT it is a link to the CW10.6 path and the file is not physically copied into the BSP\IO_Map folder. Copying it resolved BSP build issue.
Regards,
David
Thank you ! :smileyhappy:
Hi Shicheng,
Now that you have added components to the BSP, generated PE code, and compiled, please open and review the MQX4.0.2\demo\pe_demo that has MQX application using default components in the BSP as reference to access your components.
Regards,
David
hi David,
Thanks for your reply.
I do have tried the pe_demo. I got error "Demo requires Processor Expert BSP code to be generated" as the demo require "PE_LDD_VERSION" defined. But PE_LDD_VERSION is actually undefined in Freescale_MQX_4_0\lib\twrk60n512.cw10\debug\bsp\Generat_Code\PE_LDD.h file on my side.
I remember that in MQX3.8, there is PE bsp project for kinetis target, for example, bsp_twrk40x256_pe. All related PE header files will be copied to lib\twrk40x256.cw10\debug\bsp\Generated_Code folder automatically after I build the _pe bsp project. But there are no _pe bsp project in MQX4.0.
Hi,
You're right, that changed in MQX 4.x. Now, all the BSP's have pe enabled. For example, the K70 bsp:
Open the standard BSP. Go to Processor Expert Show Views:
Select the ProcessorExpert.pe (click on it)
And you will see the BSP PE components:
Then, Generate the code and build BSP.
Then, you can run the pe example.
Luis
hi Luis,
I added some components in bsp project and build the bsp project.
But there are no pe header files in Freescale_MQX_4_0\lib\twrk70f120m.cw10\debug\bsp\Generated_Code.
Then if I build the pe_demo_twrk70f120m, I got the error message as below:
Hi,
If you generate the PE code in the BSP Project, you can see the files in the project window:
And then, build the BSP.
Do you see those files?
Best Regards,
hi Luis, Yes, I can see the files in bsp projects. But the pe header files, for example, GPIO1.h should be copied to the Freescale_MQX_4_0\lib\xxx.cw10\debug\bsp\Generated_Code folder automatically after building the bsp project. So that the application project can find these header files.
Hi,
Looking at the bat file (postbuild step) bsp_twrk60n512.bat
It looks like the copy should be done:
for /R %MQXROOTDIR%\mqx\build\cw10\bsp_twrk60n512\Generated_Code %%f in (*.h) do copy %%f %OUTPUTDIR%\Generated_Code\
The old bat file (3.8) used :
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk60n512\Generated_Code\*.h .\Generated_Code
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk60n512\Sources\*.h .\Generated_Code
But files should be there after postbuild step.
Luis