[开发工具]

如何用arduino语法来玩STM32<1>

[复制链接]
2274|34
手机看帖
扫描二维码
随时随地手机跟帖
wangjiahao88|  楼主 | 2019-8-8 15:57 | 显示全部楼层 |阅读模式
This software is experimental and a work in progress. Under no circumstances should these files be used in relation to any critical system(s). Use of these files is at your own risk.

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 15:57 | 显示全部楼层
765345d4bd60347591.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 15:59 | 显示全部楼层
753255d4bd6656a786.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 15:59 | 显示全部楼层
782665d4bd677e940b.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:00 | 显示全部楼层
开始使用arduino版本的STM32

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:00 | 显示全部楼层
IDE部分介绍
先下载OCROBOTO IDE: http://www.ocrobot.com/doku.php?id=zh:downloads
下载最新版本即可

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:00 | 显示全部楼层
859475d4bd6aa54829.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:01 | 显示全部楼层
Win7 下Maple驱动问题解决方案

搞了类Arduino的STM32的开发板Maple在Win7下使用时dfu驱动装不上,导致上传程序会报错,找不到dfu设备。后来看到官方说推荐winXP上用,于是装了个XP虚拟机来用,还是不行。因为Maple国内用的很少,资料不多,找不到。最后还是在浏览官方论坛的时候偶尔看到这个解决方案。自己试过可行,也不用虚拟机了,直接win7下使用也可。

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:01 | 显示全部楼层
After getting pissed with this board not working correctly in Windows 7 64-bit with the default drivers, and then problems with a Windows XP 32-bit VM (VMWare) on Windows 7 64-bit (because it kept enumerating the device in the host machine), I tried Feyr's method. It works great!

Step-by-step instructions:

Download the binary libUSB package (http://sourceforge.net/projects/libusb-win32/files/), extract somewhere (we'll call it c:\LIBUSB)
Plug the Maple board into the computer
Open Device Manager
Switch Maple board into continuous Bootloader mode (hit reset until you get the fast blinks followed by slower blinks; reset again and immediately hit and hold the boot "BUT" button until it changes into slow blink mode, release).
It should show some broken USB device in y**ices, not a com-port
Run the libusb INF wizard (c:\LIBUSB\bin\x86\inf-wizard.exe)
Click through the dialogs, the default values should be fine, or you can fill in some descriptive info
Save the INF and have it install. It'll produce a big red prompt about the driver being unsigned and problematic; however, it will still work.
"Update" the MAPLE 003 device in y**ice manager and select the INF file you generated.
To load any program:

Run the Maple IDE, when you hit the Upload, hit your Reset button on your Maple Board. It should detect and load the data on it. If your compile takes too long, try hitting the reset later in the upload. I used an alternating interval blink to prove it was working to me instead of the straight blink code.

The serial drivers that came with the Maple IDE package do work fine, so you can use those drivers for the COM port directly.

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:04 | 显示全部楼层
国内 似乎 零知实验室的开发环境 搞得很完善 也很好!

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:04 | 显示全部楼层
582595d4bd78e59351.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:05 | 显示全部楼层
497175d4bd7b533df8.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:05 | 显示全部楼层
522435d4bd7c07886d.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:07 | 显示全部楼层
Arduino是一个开源平台,而C51是一系列的开发芯片,在Arduino开发板上面可以用C51的芯片开发自己所需产品,这套开发板开放了原始码simple I/O介面版,并且可以用Java、C语言、汇编语言以及C++语言开发,主要的软件开发工具有Keil等。其实上MCS-51系列单片机,它是一种低端的8位单片机,一般在学校都是用这种开发板,上手简单,易学。

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:08 | 显示全部楼层
而STM32也是一种芯片,是ARM®Cortex® M 处理器内核的 32位闪存微控制器,特点是:高性能、低成本、低功耗。说白了就是就是ARM芯片的一种,使用的是最新的ARM V7内核架构,Cortex还有A、R两个系列。ARM处理器就是相当于一系列的芯片的统称,ARM开发板有很多,功能非常强大,像大型系统方面用到。需要根据ARM内核来,一般有ARM7、ARM9、ARM11开发板等。STM32和51单片机相比,代码效率高,执行速度快、功能强大,一般用C语言等进行编程

807155d4bd87d25474.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:08 | 显示全部楼层
与C51以及ARM不同的是,FPGA是并行运算的,上面提到的两种都是单片机,编程语言是核心,而它则不是,FPGA是一块可以编程的电路板,只进行硬件编程,也就是基于并行逻辑单元的器件运算,不过需要学习相关电路知识,其中主要是基本电路单元有锁存器,触发器等,同时还需要学习Verilog语法。

802685d4bd892ab926.png

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:09 | 显示全部楼层
现在FPGA 貌似也可以用 arduino 来开发了。

但是,大部分人还是感觉 arduino 不太好。

功能受限制。

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:10 | 显示全部楼层
#define pinLED PC13

void setup() {
  Serial.begin(9600);
  pinMode(pinLED, OUTPUT);
  Serial.println("START");  
}

void loop() {
  digitalWrite(pinLED, HIGH);
  delay(100);
  digitalWrite(pinLED, LOW);
  delay(100);
  Serial.println("Hello World ");  
}

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:10 | 显示全部楼层
例如上段:好多都写成了库的形式。类似于PLC那种开发吧,个人以为。

使用特权

评论回复
wangjiahao88|  楼主 | 2019-8-8 16:16 | 显示全部楼层
arduino 开发STM32 看一下串口回传监控:

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

461

主题

7476

帖子

29

粉丝