建立STM32 F7 MDK 开发环境

安装MDK5开发环境

  1. 下载最新版MDK5
  2. 利用工具 破解MDK5

以上两步比较简单,不详描述

安装CubeF7

CubeMX是ST提供的一套库和框架标准,也是一种工程模版

  1. 下载http://www.st.com/web/en/catalog/tools/PF261909
  2. 下载完成后,利用MDK5打开STM32Cube_FW_F7_V1.1.0\Projects\STM32746G-Discovery\Demonstration\MDK-ARM\Project.uvprojx

更新ST-Link驱动和固件

  1. 进入ST官网http://www.st.com/web/catalog/tools/FM146/CL1984/SC720/SS1450/PF251168?s_searchtype=partnumber
  2. 通过STSW-LINK009更新st-link驱动
  3. 通过STSW-LINK005来更新固件

连接F7 Discovery开发板

  1. JP1的跳帽安装到5V-link
  2. 找一根mini USB线,插入CN14
  3. 插入电脑USB口,这时系统会枚举出ST-link设备,然后F7会启动固件,在屏幕上显示图标

常见问题

1 插入USB后,屏幕没亮;将USB插入充电器口,屏幕不亮

因为默认通过ST-link来供电,插入电脑USB接口后,只有枚举成功后,才会开启MCU的供电系统
枚举的时候,100mA;枚举成功后,才能供电500mA,如果电脑USB不接受500mA或者使用USB,就会枚举失败
详细的信息,请参考手册Power章节

1
2
3
4
5
6
7
8
STM32F746G-DISCO discovery board can be powered from ST-LINK USB connector CN14 (5V link), but only ST-LINK circuit has
the power before USB enumeration, because the host PC only provides 100mA to the board at that time. During the USB
enumeration, STM32F746G-DISCO board asks for the 500mA power to the host PC. If the host is able to provide the required
power, the enumeration finishes by a “SetConfiguration” command and then, the power transistor U8 (ST890) is switched
ON, the red LED LD2 is turned ON, thus STM32F746G-DISCO board can consume maximum 500mA current, but no more. If the
host is not able to provide the requested current, the enumeration fails. Therefore the ST890 (U8) remains OFF and the
MCU part including the extension board won’t be powered. As a consequence the red LED LD2 remains turned OFF. In this
case it is mandatory to use an external power supply.

2 用MDK5编译工程后,下载到板子,图标显示不正常

MDK的download工具,默认没有支持外部Flash的算法,所以会导致没有图标的部分,没有烧录到FLASH芯片

解决方案

1
2
3
4
- Open STM32 ST-Link Utility V3.6, click on "External Loader" from the bar menu then check "N25Q128A_STM32F746G-DISCO" box 
- Connect the STM32746G-DISCOVERY board to PC with USB cable through CN14
- Use "STM32CubeDemo_STM32746G-DISCO_V1.0.1.hex" file with STM32 ST-Link Utility to program both internal Flash and external QSPI memory
- Run the demonstration