MQX4.0 + twrk60n512 + demo pe_demo_twrk60n512.eww

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

MQX4.0 + twrk60n512 + demo pe_demo_twrk60n512.eww

1,210 Views
identec
Contributor II

I am using IAR 6.50.5. I just downloaded MQX 4.0,

I did rebuild MQX by using the following IAR solution C:\Freescale\Freescale_MQX_4_0\config\twrk60n512\iar\build_libs.eww without problem.

I try to rebuild the project C:\Freescale\Freescale_MQX_4_0\demo\pe_demo\iar\pe_demo_twrk60n512\pe_demo_twrk60n512.eww but I get the following error message

Fatal Error[Pe035]: #error directive: Demo requires Processor Expert BSP code to be generated.  C:\Freescale\Freescale_MQX_4_0\demo\pe_demo\main.c 48

Has anybody been able to rebuild this project?

I am running win7 x64.

Thanks in advance for your feedback.

Giso

5 Replies

657 Views
c0170
Senior Contributor III

Hello Adalgiso Castrignano,

that error includes message:

#error See "<MQX_INSTALL_DIR>\doc\tools\cw\FSL_MQX_in_CW_10_x.pdf" chapter "CW10.x, MQX and Processor Expert" for details

You have to build BSP in Processor Expert (PE driver suite) which generates necessary files.

Regards,

c0170

0 Kudos
Reply

657 Views
identec
Contributor II

Hi,

In MQX-IAR-Getting-Started.pdf document, nothing is mentionned regarding rebuilding the BSP in Processor expert. I did see the message you mentionned regarding rebuilding the BSP in processor expert but is there any documentation explaining how to rebuild the BSP when we do not use Codewarrior?

Regards,

Adalgiso

0 Kudos
Reply

657 Views
adyr
Contributor V

Hi Adalgiso,

Did you get anywhere with this?

Can anyone tell me how to build the Processor Expert in the BSP for the IAR tools?

Regards,

Adrian.

0 Kudos
Reply

657 Views
adyr
Contributor V


Make a Processor Expert MQX build for IAR

 

In the following text, <MQX_INSTALL> means the location of your root Freescale MQX installation folder. I often refer to twrk60f120m or a variation of that which is for the TWR_K60F120M tower. I haven’t tried with other kits but I assume the procedure will be the same. There may be an easier way to do this but I have only been using this setup (processor / RTOS / Compiler) for a couple of weeks so I’m still learning. I also made lots of mistakes along the way so this is a summary of what I think are the required steps. Make a backup of your <MQX_INSTALL> folder before doing any modifications or be prepared to reinstall the RTOS if it all goes wrong.

 

Copy all files (not folders) from <MQX_INSTALL>\mqx\build\cw10gcc\bsp_twrk60f120m to <MQX_INSTALL>\mqx\build\iar\bsp_twrk60f120m

Open up the project that was copied to the IAR folder in Processor Expert.


Expand the Processors folder in the Components – bsp_twrk…. Panel.

Select the Cpu:MK60FN1M0VLQ12 component.

In the Component Inspector select the Build Options tab and change the Compiler field to IAR ARM C Compiler.

Right click on the bsp_twrk60f120m project in the Project Explorer and select the Properties options. 

Browse through all the options and change all the references to the cw10gcc folder to the iar folder.

Click on the Generate Processor Expert Code button or use the menu command under Project. 

Now in Explorer, make a copy the IAR project files in the <MQX_INSTALL>\mqx\build\iar\bsp_twrk60f120m folder and add a PE on the end (e.g  bsp_twrk60f120mPE.ewp ) then open the project in the IAR Workbench IDE.

Delete all the entries from the Files list so it just has the Output folder 

Make sure the Tools – Options – Project – Enable project connections option is enabled in the Workbench.

Use the Project - Add Project Connection menu command, then select Freescale Processor Expert from drop list click on OK and browse for the ProjectInfo.xml file in the <MQX_INSTALL>\mqx\build\iar\bsp_twrk60f120m folder. 

Open the projects options and make sure the Sources and Generated_Code folders are at the top of the list in the Additional includes. If this is not done then the wrong PE_LDD.H file is picked up when bsp_cm.c is compiled so it won’t know that the PE has been created.

Edit the $PROJ_DIR$/../../../../mqx/build/bat/bsp_twrk60f120m.bat file and make sure the following lines are in the :tool_iar section: 

IF NOT EXIST "%OUTPUTDIR%\" mkdir "%OUTPUTDIR%\"

IF NOT EXIST "%OUTPUTDIR%\Generated_Code" mkdir "%OUTPUTDIR%\Generated_Code" 

IF NOT EXIST "%OUTPUTDIR%\Sources" mkdir "%OUTPUTDIR%\Sources"

for /R "%ROOTDIR%\mqx\build\iar\bsp_twrk60f120m\Generated_Code" %%f in (*.h) do copy %%f "%OUTPUTDIR%\Generated_Code\"

for /R "%ROOTDIR%\mqx\build\iar\bsp_twrk60f120m\Sources" %%f in (*.h) do copy %%f "%OUTPUTDIR%\Sources\" 

Now do a Rebuild All on the project.

Testing the library.

 

Open the pe_demo located in the <MQX_INSTALL>\demo\pe_demo\build\iar\pe_demo_twrk60f120m folder.

Add the \PExDrv v10.3\eclipse\ProcessorExpert\lib\Kinetis\pdd\inc to the Additional includes 

Rename the PWM_OnCounterRestart function to PWM_OnCounterRestartApp

In the Linker – Extra Options tab add: 

--redirect PWM_OnCounterRestart=PWM_OnCounterRestartApp

This will ensure the overridden function is used without generating a linker error. 

If required, change the Debug Driver.

Build the demo and run it.

657 Views
c0170
Senior Contributor III

Hello Adalgiso Castrignano,

Processor Expert: Integrating with IAR Embedded

I have not integrated PE with IAR neither KEIL, this one I'll post here even though it's for KEIL, might be similar:

How to Integrate Processor Expert Drivers into MQX BSP in Keil

One more link (it's FreeRTOS with IAR and PE), worth to check:

Tutorial: IAR + FreeRTOS + Freedom Board | MCU on Eclipse

Please share the outcome :smileywink:

Regards,

c0170

0 Kudos
Reply