1
连接2
获取软件3
构建、运行
板信息
OpenSDA is a serial and debug adapter circuit that runs on a Kinetis K20 device built into many NXP development boards.
It allows users to download and debug programs onto the target K64F chip using only a USB cable.
Some FRDM-K64F boards may contain older OpenSDA firmware that is incompatible with Windows 10 due to changes made in how Windows handles Mass Storage Devices. This can potentially corrupt older versions of the OpenSDA firmware found on those FRDM-K64F boards.
The vast majority of FRDM-K64F boards currently being shipped from distributors will already have updated firmware that is not affected, but some older inventory may still contain the outdated firmware.
To ensure proper operation of the FRDM-K64F with Windows 10, disable Storage Services on your Windows 10 computer before plugging it in the first time and update the OpenSDA firmware if needed:
If you do not see any drive enumerate at all when plugging in the board in Step #6, the OpenSDA firmware may have been corrupted by Windows. The only way to fix this is to reprogram the K20 chip that the OpenSDA firmware runs on using an external debug tool. Instructions for this process can be found in this OpenSDA Community post.
Something went wrong! Please try again.
现在可以试用FRDM-K64F!您可以选择观看短片中的操作顺序或遵循下面列出的详细操作。
Diagnostic Test Release 201909XX
CPU: NXP S32G
Board: S32G274A Board
MC_CGM_0 Clock Mux 0 -> XBAR_CLK (Core Clock)
CORE_DFS_1 Clock -> MC_CGM_0 Clock Mux 0
CORE_VCO Clock -> CORE_DFS_1 Clock
FXOSC -> CORE_VCO Clock
FXOSC: 40000000Hz
CORE_VCO Clock: 2000000000Hz
CORE_DFS Clock: 1000000000Hz
XBAR_CLK: 500000000Hz
Something went wrong! Please try again.
Diagnostic Test Release 201909XX
CPU: NXP S32G
Board: S32G274A Board
MC_CGM_0 Clock Mux 0 -> XBAR_CLK (Core Clock)
CORE_DFS_1 Clock -> MC_CGM_0 Clock Mux 0
CORE_VCO Clock -> CORE_DFS_1 Clock
FXOSC -> CORE_VCO Clock
FXOSC: 40000000Hz
CORE_VCO Clock: 2000000000Hz
CORE_DFS Clock: 1000000000Hz
XBAR_CLK: 500000000Hz
Something went wrong! Please try again.
FRDM-K64F预装了”气泡水平仪“演示,可充分利用板载加速度传感器。When the board is flat, the RGB LED is turned off and when the board is tilted, the red or blue LEDs gradually illuminate based on the degree of tilt on the X- and Y-axis.
Something went wrong! Please try again.
选择开发路径
Something went wrong! Please try again.
点击以下链接,下载FRDM-K64F的预配置SDK版本。Learn about SDK.
MCUXpresso SDK为免费附赠,包含所有硬件抽象和外设驱动软件的完整源代码,根据宽松的开源许可提供。
Something went wrong! Please try again.
在 FRDM-K64F 上构建并运行 SDK 演示
MCUXpresso SDK附带一系列示例应用代码。To see what's available, browse to the SDK boards folder of your SDK installation and select your board, the FRDM-K64F .
如需了解特定示例代码的详细信息,请参阅示例目录中的readme.txt文件。
Something went wrong! Please try again.
如果您对其中的一个或几个演示应用或驱动程序示例感兴趣,也许想了解如何自己完成构建和调试。MCUXpresso SDK快速入门指南按步骤介绍了如何轻松地为SDK支持的所有工具链配置、构建和调试演示。
采用以下指南,了解如何使用MCUXpresso IDE打开、构建和调试示例应用。



The following steps will guide you through opening the hello_world example.
在左下角找到快速启动面板
然后点击“导入SDK示例……”
Click on the frdmk64f board to select that you want to import an example that can run on that board and then click on Next
Use the arrow button to expand the demo_apps category and then click the checkbox next to hello_world to select that project. 要使用UART进行打印(而不是默认的半主机),请清除项目选项下的“启用半主机”复选框。Then, click on Next
在“高级设置”向导中,清除“将SDK “PRINTF”重定向到C语言库“printf”“复选框,以便使用MCUXpresso SDK控制台功能进行打印,而不是通用的C库文件。然后点击“完成”。
现在点击项目名称来构建项目,然后点击Build图标
您可以在“控制台”选项卡中查看构建的状态
frdmk64f_demo_apps_hello_world' [Debug] 
MCUXpresso IDE 将探测互联的电路板,并应查找 MBED CMSIS-DAP 硬件调试器,此硬件调试器是 FRDM-K64F 上集成 OpenSDA 电路的一部分。Click on OK to continue
固件将被下载到板,并且调试器开始运行。
打开一个终端程序,并连接到已计入的电路板上的COM端口。Use 115,200 baud 8 data bits, no parity and 1 stop bit
点击"Resume"按钮启动应用:
hello_world应用开始运行,标语显示在终端上。If this is not the case, check your terminal settings and connections
使用菜单栏的控件暂停、进入和逐步执行指令,然后点击Terminate图标停止调试会话:
The following steps will guide you through opening the hello_world application. 对于其他示例应用,这些步骤可能会略有不同,因为某些应用的路径可能会有额外的文件夹层级。
如果还未完成,在以下路径中打开所需应用的示例应用工作区:大多数示例应用演示工作区文件位于以下路径:
/boards////iar Using the hello_world demo as an example, the path is:
/boards/frdmk64f/demo_apps/hello_world/iar 从下拉列表中选择所需的构建目标。在这个例子中,选择“hello_world - Debug”目标
要构建应用,点击"Make"按钮(下文中用红色突出显示)。
The build will complete without errors:
FRDM-K64F板出厂时预装了mbed/CMSIS-DAP调试接口。If you have changed the debug OpenSDA application on your board, visit Open SDA for information on updating or restoring your board to the factory state.
Connect the development platform to your PC via USB cable between the "SDAUSB" USB port on the board and the PC USB connector
点击"Download and Debug"(下载和调试)按钮,将应用下载到目标
然后,可将此应用下载到目标应用,并自动运行到main()函数。
点击"Go"按钮运行代码,以启动应用
hello_world应用开始运行,标语显示在终端上。如未显示,请检查您的终端设置和连接
安装MDK工具后,必须安装Cortex®微控制器软件接口标准(CMSIS)设备包,从调试角度来说才能完全支持该设备。这些设备包包括存储器映射信息、寄存器定义和闪存编程算法。按照这些步骤安装相应的CMSIS包。


The following steps will guide you through opening the hello_world application. 对于其他示例应用,这些步骤可能会略有不同,因为某些应用的路径可能会有额外的文件夹层级。
如果还未完成,在以下路径中打开所需的演示应用工作区:
/boards////mdk 此工作区文件名为
/boards/frdmk64f/demo_apps/hello_world/mdk/hello_world.uvmpw 
FRDM-K64F板出厂时预装了mbed/CMSIS-DAP调试接口。如果您已经更改了板上的调试OpenSDA应用,请访问OpenSDA了解如何更新板或将板恢复到出厂状态。



hello_world应用开始运行,标语显示在终端上。如未显示,请检查您的终端设置和连接
本节包含采用Kinetis SDK支持的Arm GCC工具链构建并运行KSDK演示应用所需的必要组件的安装步骤。Arm GCC工具有许多使用方式,但此例主要演示其在Windows环境中的使用。虽然这里未讨论,但GCC工具还可与Linux操作系统和Mac OSX配套使用。
从GNU Arm Embedded Toolchain下载并运行安装程序。这是我们实际使用工具链(例如,编译器、链接器等)。GCC工具链应当对应最新的支持版本,参见Kinetis SDK版本说明。
Minimalist GNU for Windows (MinGW)开发工具提供了一套不依赖第三方C-Runtime DLL (如Cygwin)的工具。KSDK所用的构建环境无需使用MinGW Build工具,但充分利用了MinGW和MSYS的基础安装。MSYS为与Unix类似的接口和工具提供基本的Shell。
C:\MinGW, however, you may install to any location注:此安装路径不包含任何空格。
mingw32-base" and "msys-base" are selected under Basic Setup 

添加相应项目到Windows操作系统的Path环境变量。在"Environment Variables..."部分的Control Panel → System and Security → System → Advanced System Settings下可找到它。路径为:
假设默认安装路径为C:\MinGW,此例如下所示。如果路径设置不正确,工具链将无法正常运行。
Note: If you have "C:\MinGW\msys\x.x\bin" in your PATH variable (as required by KSDK 1.0.0), remove it to ensure that the new GCC build system works correctly.
创建新的系统环境变量并命名为ARMGCC_DIR。此变量的值应当指向Arm GCC嵌入式工具链安装路径,此例中的安装路径为:
C:\Program Files (x86)\GNU Tools Arm Embedded\4.9 2015q3
参考GNU Arm GCC嵌入式工具的安装文件夹,获得确切的安装路径名。
从以下位置下载CMake 3.0.x:CMake
安装CMake,确保安装时选择"Add CMake to system PATH"选项。由用户选择是为所有用户还是只为当前用户将其安装到PATH。In this example, the assumption is that it's installed for all users
按照安装程序的其余指令操作
可能需要重启系统,才能使PATH更改生效
要构建示例应用,请按照这些步骤操作。

将目录更改为示例应用项目目录,它有如下路径:
/boards////armgcc 对于本指南,确切的路径为:
/boards/frdmk64f/demo_apps/hello_world/armgcc build_debug.bat”,或双击Windows操作系统Explorer中的"build_debug.bat"文件,执行构建。The output is shown in this figure: 
GCC工具需要J-Link调试接口。要将板上的OpenSDA固件更新为最新的J-Link应用,请访问OpenSDA。After installing the J-Link OpenSDA application, download the J-Link driver and software package from Segger



更改为包含演示应用输出的目录。根据所选的构建目标,使用以下两个路径中的一个可以找到此输出:
/boards////armgcc/debug /boards////armgcc/release 对于本指南,路径为:
/boards/frdmk64f/demo_apps/hello_world/armgcc/debug arm-none-eabi-gdb.exe .elf "。For this example, it is "arm-none-eabi-gdb.exe hello_world.elf" 
运行以下命令:
此应用已下载成功并停留在复位矢量。Execute the "monitor go" command to start the example application
The hello_world application is now running and a banner is displayed in the terminal window
Something went wrong! Please try again.