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:
- CodeWarrior 10.6 (professional or evaluation edition)
- MQX 4.1 for FRDM-K64 (it is not necessary to install full MQX 4.1)
- 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:
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
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
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"
5. Repeat steps 2 and 3 for the ARM Ltd Windows GCC Compiler
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.
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:
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:
- Press the reset button on the board and connect the USB cable
- Once the board enumerates as "BOOTLOADER" copy the JLink_OpenSDA_vs.bin file to the unit
- Disconnect and reconnect the board
- On CodeWarrior (having previously compiled the libraries and project) click on debug configurations
5. Select the connection and click on debug
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:
- 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.