一般我们编写代码都是采用手工编写的方法,这样的好处是自由,但对于一些复杂的问题,就感觉异常的困难,例如ST 的电机驱库存PMSM FOC。只是理解都要发几天的时间,幸运的时它有说明文档STM32F103xx PMSM FOC software library UM.pdf 其中
即是整个库代码的核心关键。 如果反过来要我们编写这样的代码,即感到非常的困难,既然图形能指导我们理解,那图形否能指导我们编写代码,甚至动态生成代码呢? 其实ST官网上已经有图形化编程的软件 STM32CubeMX http://www.st.com/web/cn/catalog/tools/FM147/CL1794/SC961/SS1533/PF259242 STM32CubeMX is part of STMicroelectronics STM32Cube™ original initiative to ease developers life by reducing development efforts, time and cost. STM32Cube™ covers STM32 portfolio. STM32Cube™ includes the STM32CubeMX which is a graphical software configuration tool that allows generating C initialization code using graphical wizards. ST官网的介绍主要是 initialization code 初始化代码的生成。帮助我们简化了工作量,但并不是我们的需要的核心关键代码。 想起了读大学用的MATLAB Simulink 动态生成的代码,不过是在DSP中实现的,不知道能否在STM32 实现,一查,竟然支持呢!~ http://www.st.com/web/cn/catalog/tools/FM147/CL1794/SC961/SS1533/PF258513 The STM32 Embedded Target enables you to quickly deploy your application models in MATLAB and Simulink to STM32 MCUs. In a first step, it gives possibility to run Simulink application models on STM32 F4 target using Processor In the Loop (PIL) configuration and USART communication link. The process from "C" code generation to programming STM32 F4 is fully automated. Code is built using one of three possible toolchains from Atollic, IAR or Keil. Code generation report is automatically generated. Code execution profiling report is automatically generated for PIL execution. In a second step, STM32 Embedded Target provides a Simulink blockset library containing several STM32 F4 peripherals to set parameters and generate peripherals initialization "C" code. Finally, generated code can be integrated to existing application or built and download to target. These capabilities and functionalities are easy to use and are available as soon as STM32F4xx product folder and subfolders are added to the MATLAB path. 不知道有没有高人,已经尝试过用Simulink 动态生成代码呢?可惜手头上缺少一块STM32 F4的开发板,不然可以尝试一下,借这次 【活动】邀您打造ST MCU网上课堂,高性能STM32F4探索套件送出! https://www.stmcu.org.cn/bbs/article_1188_581614.html 活动的机会,如果成功申请到一块STM32F4的开发板,必定尝试一下用Simulink 生成代码。如果成功一定写贴子,与大家一块分享。。。 |
STM32F407 定时器触发DMA 求助大神
【MCU实战经验】基于STM32F407的音频播放器设计
盘古UE-STM32F407工控板原理图
【STM32F429心得\疑问】+STM32F4之FSMC和FMC
STM32F429读取IO口传输的数据速率
STM32F407ZGT6 手摸芯片背部重启
STM32F4 SPI 动作时,软件片选信号被拉高,IO口程序逻辑失控
STM32F401RE NUCLEO求助,串口一直不能进中断
读取STM32F407内部温度传感器值错误
STM32F429多路内部ADC独立采集的办法
回复:【STM32F429心得\疑问】STM32能否实现图形化编程吗?
【MCU实战经验】图形化编程之初始化配置(1)STM32CubeMX
https://www.stmcu.org.cn/bbs/article_1188_581943.html
请大家提点