FRDM-K64 Ethernet / web HVAC example using MQX

Document created by Pedro Augusto Panecatl Salas Employee on Jun 29, 2014Last modified by Pedro Augusto Panecatl Salas Employee on Jun 29, 2014
Version 2Show Document
  • View in full screen mode

Since the mbed Ethernet library and interface for FRDM-K64 have not yet been fully tested, instead of using mbed we will use one of the latest demo codes from MQX specifically developed for the FRDM-K64 platform.

 

Before starting please make sure you have the following files and software installed in your computer:

 

  1. CodeWarrior 10.6 (professional or evaluation edition)
  2. MQX 4.1 for FRDM-K64 (it is not necessary to install full MQX 4.1)
  3. JLink_OpenSDA_V2.bin (this is the debugger application)

 

* If you don't have a valid license, you can find a temporary license below, it will only be valid until 7/30/2014 and it will only be available online until 7/05/2014.

 

 

Building the project

 

The first step to use an MQX project is to compile the target/IDE libraries for the specific platform:

 

1. Open CodeWarrior and drag the file from the following path C:\Freescale\Freescale_MQX_4_1_FRDMK64F\build\frdmk64f\cw10gcc onto your project area:

MQX Libraries.JPG.jpg

 

This will load all the necessary libraries to build the project, once they are loaded build them it is necessary to modify a couple of paths on the BSP:

 

2. Right click on the BSP project and then click on properties

BSP Paths.JPG.jpg

 

3. Once the properties are displayed, expand the C/C++ Build option, click on settings, on the right pane expand the ARM Ltd Windows GCC Assembler and select the directories folder, this will display all the libraries paths the compiler is using

BSP Paths2.JPG.jpg

 

4. Double click on the "C\Freescale\CW MCU v10.6\MCU\ProcessorExpert\lib\Kinetis\pdd_100331\inc" path to modify it, once the editor window is open, change the path from "pdd_100331" to "pdd"

BSP Paths3.JPG.jpg

 

5. Repeat steps 2 and 3 for the ARM Ltd Windows GCC Compiler

BSP Paths4.JPG.jpg

 

6. Now you can build the libraries, build them one at a time by right clicking on the library and selecting build project, build them in the following order, it is imperative you do it in that order.

 

  1. BSP
  2. PSP
  3. MFS
  4. RTCS
  5. SHELL
  6. USBD
  7. USBH

 

 

 

7. Once all the libraries are built, import the web hvac demo, do it by dragging the .project file to your project area; the project is located in the following directory:

                    C:\Freescale\Freescale_MQX_4_1_FRDMK64F\demo\web_hvac\build\cw10gcc\web_hvac_frdmk64f

 

Web HVAC 1.JPG.jpg

 

8. Once the project is loaded, build it by right clicking on the project folder and select Build project

 

 

 

Debugging the project


To debug the project it is necessary to update the FRDM-K64 debugging application:

 

  1. Press the reset button on the board and connect the USB cable
  2. Once the board enumerates as "BOOTLOADER" copy the JLink_OpenSDA_vs.bin file to the unit
  3. Disconnect and reconnect the board
  4. On CodeWarrior (having previously compiled the libraries and project) click on debug configurations

Debug4.JPG.jpg


5. Select the connection and click on debug

Debug5.JPG.jpg


6. Open HVAC.h and change the IP Address to 192.168.1.202




Now the demo code has been downloaded to the platform you will need the following to access all the demo features:

  • Router
  • Ethernet Cable
  • Serial Terminal

The code enables a shell access through the serial terminal, it also provides web server access with a series of options to simulate an Heating Air Conditioning Ventilation System, the system was implemented using MQX and a series of tasks, for more details on how the task are created, the information regarding how to modify the code please check the attached document:

Freescale MQX RTOS Example guide.

 

 

 

Outcomes