你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

基于STM32F767ZI AI 应用工程创建----转载  

[复制链接]
木木&点点 发布时间:2019-1-6 17:29
偶然看到一篇好文章,分享给大家。


1.jpg

今天介绍下ST官方刚刚推出的CubeMx 自带的X-CUBE-AI(Artificial intelligent)插件功能,可以给现有的STM32 M3-M7高性能的处理器添加基于训练好的ANN 的模型用于不同的数据分析处理。

使用STM32Cube.AI简化了人工神经网络映射

1.可与流行的深度学习培训工具互操作
2.兼容许多IDE和编译器
3.传感器和RTOS无关
4.允许多个人工神经网络在单个STM32MCU上运行
5.完全支持超低功耗STM32MCU

提高您的工作效率

利用DeepLearning的强大功能提高信号处理性能并提高STM32应用程序的生产率。创建人工神经网络并将其映射到STM32(通过CubeMx自动生成优化的代码),而无需手动构建代码。
以上就做个简短的介绍,想了解更多有关STM32Cube.AI可以访问下面的链接:http://www.st.com/content/st_com ... 2_gl_social_dec2018

那先前的准备工作就是需要安装最新版本的CubeMx 5.0.1
然后使用CubeMx 去安装X-CUBE-AI插件, 700多M的容量。。慢慢下载吧

2.jpg

下载好后,CubeMx里的Artificial intelligent
激活Enable

3.jpg

这里我们就可以看到里面的选项了
下载下来。。然后选择Keras 的AI API算法

4.jpg

model.h5就是我们需要导入到工程里的AI Keras的训练好的模型

5.jpg

Human Activity Recognition Using Convolutional Neural Network in Keras
人类活动识别卷积神经网络算法模型
6.jpg

然后我们导入到工程里
7.jpg

这里选择压缩参数,不同的压缩参数对MCU的flash容量
要求也不一样。。
8.jpg

点击Analyze cube就好计算使用这个神经网络算法的ram和flash容量占用

9.jpg

好了结果出来了,

10.jpg

经过分析后Cube会自动列出可以使用的MCU
然后显示在列表里
11.jpg

这里举个例子,我们选择没有压缩优化
分析模型算法后的结果我没有匹配的MCU可以使用

12.jpg

这是选择压缩比参数8的结果,可以支持很多的MCU使用这个神经网络算法。。

13.jpg

好了,这里我们就选择STM32F767ZI Nucleo 板卡作为 这次演示使用的板卡

14.jpg
好了选择好了,板卡,我们还需要给它添加扩展库,也就是AI库

15.jpg


选择好Validation 和打勾 AI core

16.jpg

然后在cube 左下方可以看到下图箭头 提示的插件功能

17.jpg

我们需要打勾以下2个功能

18.jpg

然后创建我的AI算法名称,这个名称会在后续的里自动创建好。

19.jpg

添加好,我们下载好的AI神经网络算法,然后再Analyze下就好。。打勾表示验证通过

20.jpg

然后我们需要配置我们的mcu的 CPU ICache 和 CPU DCache

21.jpg

然后配置MCU主频为216Mhz

22.jpg


然后我们需要配置串口3和CubeMx进行通讯,验证我们工程。。。

23.jpg

然后在 AI扩展功能里选择通讯端口为串口3

24.jpg
好了,工程差不多创建好了。接下来就是 配置工程的路径好 我们配置使用IAR 编译环境。。 然后Heap 然后要配置到2000 这个很重要,要是设置少了 系统就会奔溃(切记)

25.jpg

好了工程生成好了,我们就可以 使用IAR 打开工程了 工程如下,工程里自动生成了基于AI的算法的所以文件

26.jpg

这里可以看到,基于AI训练好的模型数据列表。。。

27.jpg

好了,配置位STLINK,然后编译好就可以直接下载到板子上了

28.jpg

29.jpg
好了,现在我们需要回到CubeMx里,回到 AI扩展功能里。。 先重启下开发板,然后 点击Validation on target


30.jpg

选择手动,然后选择对应的串口端口

31.jpg

这里可以看到验证已经开始了‘

32.jpg
好了,结果出来了。我们可以在串口输出的信息里看到有关的数据

33.jpg

34.jpg
35.jpg

36.jpg


好了,基于CubeMx+AI扩展库的使用就分享到这了,想了解更多关于 使用STM32 AI的朋友可以关注ST官网的教程。。。
收藏 3 评论33 发布时间:2019-1-6 17:29

举报

33个回答
单片机爱好者 回答时间:2019-5-25 21:12:11
Build target 'STM32F767_AI'
assembling startup_stm32f767xx.s...
compiling main.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Src/main.c: 0 warnings, 1 error
compiling app_x-cube-ai.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Src/app_x-cube-ai.c: 0 warnings, 1 error
compiling stm32f7xx_it.c...
compiling stm32f7xx_hal_msp.c...
compiling stm32f7xx_hal_cortex.c...
compiling stm32f7xx_hal_crc.c...
compiling stm32f7xx_hal_crc_ex.c...
compiling stm32f7xx_hal_tim.c...
compiling stm32f7xx_hal_tim_ex.c...
compiling stm32f7xx_hal_uart.c...
compiling stm32f7xx_hal_uart_ex.c...
compiling stm32f7xx_hal_rcc.c...
compiling stm32f7xx_hal_rcc_ex.c...
compiling stm32f7xx_hal_flash.c...
compiling stm32f7xx_hal_flash_ex.c...
compiling stm32f7xx_hal_gpio.c...
compiling stm32f7xx_hal_dma.c...
compiling stm32f7xx_hal_dma_ex.c...
compiling stm32f7xx_hal_pwr.c...
compiling stm32f7xx_hal_pwr_ex.c...
compiling stm32f7xx_hal.c...
compiling stm32f7xx_hal_i2c.c...
compiling stm32f7xx_hal_i2c_ex.c...
compiling stm32f7xx_hal_exti.c...
compiling system_stm32f7xx.c...
compiling aiPbMgr.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Middlewares/ST/X-CUBE-AI_Application/Validation/Src/aiPbMgr.c: 0 warnings, 1 error
compiling aiTestUtility.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Middlewares/ST/X-CUBE-AI_Application/Validation/Src/aiTestUtility.c: 0 warnings, 1 error
compiling aiValidation.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Middlewares/ST/X-CUBE-AI_Application/Validation/Src/aiValidation.c: 0 warnings, 1 error
compiling pb_common.c...
compiling pb_decode.c...
compiling pb_encode.c...
compiling stm32msg.pb.c...
"STM32F767_AI\STM32F767_AI.axf" - 5 Error(s), 0 Warning(s).
Target not created.
单片机爱好者 回答时间:2019-5-25 21:11:53
Build target 'STM32F767_AI'
assembling startup_stm32f767xx.s...
compiling main.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Src/main.c: 0 warnings, 1 error
compiling app_x-cube-ai.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Src/app_x-cube-ai.c: 0 warnings, 1 error
compiling stm32f7xx_it.c...
compiling stm32f7xx_hal_msp.c...
compiling stm32f7xx_hal_cortex.c...
compiling stm32f7xx_hal_crc.c...
compiling stm32f7xx_hal_crc_ex.c...
compiling stm32f7xx_hal_tim.c...
compiling stm32f7xx_hal_tim_ex.c...
compiling stm32f7xx_hal_uart.c...
compiling stm32f7xx_hal_uart_ex.c...
compiling stm32f7xx_hal_rcc.c...
compiling stm32f7xx_hal_rcc_ex.c...
compiling stm32f7xx_hal_flash.c...
compiling stm32f7xx_hal_flash_ex.c...
compiling stm32f7xx_hal_gpio.c...
compiling stm32f7xx_hal_dma.c...
compiling stm32f7xx_hal_dma_ex.c...
compiling stm32f7xx_hal_pwr.c...
compiling stm32f7xx_hal_pwr_ex.c...
compiling stm32f7xx_hal.c...
compiling stm32f7xx_hal_i2c.c...
compiling stm32f7xx_hal_i2c_ex.c...
compiling stm32f7xx_hal_exti.c...
compiling system_stm32f7xx.c...
compiling aiPbMgr.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Middlewares/ST/X-CUBE-AI_Application/Validation/Src/aiPbMgr.c: 0 warnings, 1 error
compiling aiTestUtility.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Middlewares/ST/X-CUBE-AI_Application/Validation/Src/aiTestUtility.c: 0 warnings, 1 error
compiling aiValidation.c...
../Inc/app_x-cube-ai.h(77): error:  #5: cannot open source input file "network.h": No such file or directory
  #include "network.h"
../Middlewares/ST/X-CUBE-AI_Application/Validation/Src/aiValidation.c: 0 warnings, 1 error
compiling pb_common.c...
compiling pb_decode.c...
compiling pb_encode.c...
compiling stm32msg.pb.c...
"STM32F767_AI\STM32F767_AI.axf" - 5 Error(s), 0 Warning(s).
Target not created.
Beatle 回答时间:2019-7-14 14:55:07
じ太阳当空照 发表于 2019-7-14 09:15
我真的不知道是哪出了问题,求大神指导,我导入以后,选好芯片,然后点击Additional Software进去,里面 ...

首先确保已经安装了AI库

1.png
使能Atificial intelligence后,配置好参数,确保自己使用的单片机是在列表中的。


2.png



如果确定上面操作无误,界面还是空的话那就看看这里的配置是否和你真实的路径是一致的。

3.png
zero99 回答时间:2019-1-8 13:15:38
看看
wujialing4000 回答时间:2019-1-8 15:24:33
辛苦了,学习了。耐心的看完每句话。
奏奏奏 回答时间:2019-1-8 19:12:17
用DSP部分来算神经网络,感觉是不是后面ST要出专用的神经网络计算单元了吗?
creep 回答时间:2019-1-9 09:44:21
厉害了@Paderboy
Paderboy 回答时间:2019-1-9 09:46:24
多谢分享。。
STMCU-管管 回答时间:2019-1-9 10:05:06

厉害了大佬
qhq8001 回答时间:2019-1-9 10:51:07
大概了解一下,感谢分享
xujiantj 回答时间:2019-1-10 09:06:19
谢谢楼主!!!
h55 回答时间:2019-1-21 09:14:29
我只看见MODEL.H5没看见STM32F767AI.H5,为什么
木木&点点 回答时间:2019-1-21 16:11:57
hu-jian-li 发表于 2019-1-21 09:14
我只看见MODEL.H5没看见STM32F767AI.H5,为什么

model.h5就是我们需要导入到工程里的AI Keras的训练好的模型
杨满意 回答时间:2019-1-21 16:52:12
解释下输出结果的含义
木木&点点 回答时间:2019-1-23 15:23:29
杨满意 发表于 2019-1-21 16:52
解释下输出结果的含义

输出吗   这是去使用库的AI神经算法
h55 回答时间:2019-1-28 11:02:50
点点&木木 发表于 2019-1-21 16:11
model.h5就是我们需要导入到工程里的AI Keras的训练好的模型

我导入model.h5就没反应了,没有出现他教程中的STM32F767AI.H5,请问要怎么操作
木木&点点 回答时间:2019-1-31 19:42:28
hu-jian-li 发表于 2019-1-28 11:02
我导入model.h5就没反应了,没有出现他教程中的STM32F767AI.H5,请问要怎么操作 ...

导入到工程的时候,没出现STM32F767AI.h5吗
123下一页

所属标签

相似分享

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版