搭建STM32的arduino尝试
这个几天捣鼓着不用bootloader使用maple-ide编译好的程序1:一片STM32F103RB最小系统板
2:一条usb转ttl下载线
工具软件:
Download and Install:
python-2.7.1
http://www.soliddigi.com/pub/SOLID_STM32/Tools/python-2.7.1.zip
pyserial-2.5.win32
http://www.soliddigi.com/pub/SOLID_STM32/Tools/pyserial-2.5.win32.exe
stm32loader.py
http://www.soliddigi.com/pub/SOLID_STM32/Tools/stm32loader.py
1:安装好python-2.7.1到c:\Python27目录
2:运行下pyserial-2.5.win32.exe
3:在C盘下建立spruce目录
4:将stm32loader.py 拷贝到spruce目录下
5:spruce目录下建立个BAT文件:C:\Python27\python.exe stm32loader1.py -p COM10(PL2303下载端口) -ewv HelloWorld.cpp.bin(或者其他的已经编译好的BIN文件)
6:word打开maple-ide-0.0.12-windowsxp32\hardware\leaflabs下的boards.txt
编辑增加:
mapleJTAG.name=LeafLabs Maple Rev 3+ to JTAG
mapleJTAG.upload.file_type=bin
mapleJTAG.upload.maximum_size=20000
mapleJTAG.upload.ram.maximum_size=20000
mapleJTAG.upload.flash.maximum_size=128000
mapleJTAG.upload.usbID=1EAF:0003
mapleJTAG.upload.altID=1
mapleJTAG.upload.uploader=dfu-util
mapleJTAG.upload.auto_reset=true
mapleJTAG.build.board=maple
mapleJTAG.build.mcu=STM32F103RB
mapleJTAG.build.family=cortex-m3
mapleJTAG.build.f_cpu=72000000L
mapleJTAG.build.core=maple
mapleJTAG.build.submdl=stm32f103
mapleJTAG.build.vect= VECT_TAB_BASE
mapleJTAG.build.linker=maple/jtag.ld
mapleJTAG.build.using=armcompiler
mapleJTAG.build.density=STM32_MEDIUM_DENSITY
mapleJTAG.build.error_led_port=GPIOA
mapleJTAG.build.error_led_pin=5
##############################################################
打开maple-ide-0.0.12
打开HelloWorld示例
void setup() {
}
void loop() {
SerialUSB.println("Hello World!");
需要将 SerialUSB.println替换成为 Serial1.println
void setup() {
Serial1.begin(19200);
}
void loop() {
Serial1.println("Hello World!");
delay(1000);
}
然后Ctrl+R
找到IDE提示目录的C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build2329881976077313879.tmp\HelloWorld.cpp.bin(.tmp目录会变化)
拷贝HelloWorld.cpp.bin到c:\spruce目录下
设置最小系统板的BOOT0 1
RX1 TX1 接到PL2303
复位或者上电后稍等,运行BAT ,下载成功后,设置最小系统板的为BOOT0 1
复位或者上电后,程序在没bootloader情况下运行:)
搜了下淘宝上最便宜的核心板:)
LQFP64 封装STM32F103RBT6的核心板41元
LQFP144封装STM32F103ZET6的核心板68元 端口对应需要查看http://leaflabs.com/docs/hardware/maple.html#gpio-port-pin-map
当然如果你需要更加多端口,LQFP144封装的stm32f103zet6对应Maple Native 问楼主个问题,其他stm32的芯片能用吗?比如STM32F103RB? Maple对应STM32F103RBT6,
Maple Mini对应STM32F103RCBT6,
Maple Native对应STM32F103ZET6,
其他的STM32芯片 对应需要去http://forums.leaflabs.com/ 查阅或者提问
stm32 F4的好像也快出来了
型号太多了,有点搞不明白
还有一点,stm32没有直插的,不太容易diy 一般建议买现成的支持ISP下载的STM32最小系统板来捣鼓 LZ看我的帖子 我已经搞定了在stm32最小系统上上使用maple的dfu通过usb下载程序:lol
并且可以使用SerialUSB
http://www.geek-workshop.com/thread-3355-1-1.html histamine 发表于 2013-3-14 15:18 static/image/common/back.gif
LZ看我的帖子 我已经搞定了在stm32最小系统上上使用maple的dfu通过usb下载程序
并且可以使用SerialUSB ...
嗯,你的贴子学习了:)
我只是不想用bootloader来做次尝试,maple的板子我有买,平常调试程序比较方便,如果程序OK后,单片机用去做控制其他东西,我想没有bootloader会可能方便点:) 一段时间没关注,没想到maple发展挺快。不过太贵了,国内怎么没人山寨啊。maple native换成人民币要400多块,同样的核心板才100多。 xmdesign 发表于 2013-3-15 07:17 static/image/common/back.gif
搜了下淘宝上最便宜的核心板:)
LQFP64 封装STM32F103RBT6的核心板41元
LQFP144封装STM32F103ZET6的核心 ...
楼主的研究很好,国内stm32很火,maple很不火。
maple native是103ZET扩展了1M的SRAM。
淘宝上的103ZET核心板集成1M的SRAM+128M的Flash是140块。 哈哈,终于看到个python+STM32的 学习来了:) Reading data from sketch_apr20a.cpp.bin
Bootloader version 0x22
Chip id '0x4 0x10'
Writing 12816 bytes to start address 0x8000000
Write 256 bytes at 0x8000000
Write 256 bytes at 0x8000100
Write 256 bytes at 0x8000200
Traceback (most recent call last):
File "stm32loader.py", line 484, in <module>
cmd.writeMemory(conf['address'], data)
File "stm32loader.py", line 311, in writeMemory
self.cmdWriteMemory(addr, data)
File "stm32loader.py", line 203, in cmdWriteMemory
self._wait_for_ask("0x31 programming failed")
File "stm32loader.py", line 79, in _wait_for_ask
raise CmdException("Chip replied with a NACK during %s" % info)
__main__.CmdException: Chip replied with a NACK during 0x31 programming failed
用这个办法出这个错是什么原因? 请教原因Reading data from sketch_apr20a.cpp.bin
Bootloader version 0x22
Chip id '0x4 0x10'
Writing 12816 bytes to start address 0x8000000
Write 256 bytes at 0x8000000
Write 256 bytes at 0x8000100
Write 256 bytes at 0x8000200
Traceback (most recent call last):
File "stm32loader.py", line 484, in <module>
cmd.writeMemory(conf['address'], data)
File "stm32loader.py", line 311, in writeMemory
self.cmdWriteMemory(addr, data)
File "stm32loader.py", line 203, in cmdWriteMemory
self._wait_for_ask("0x31 programming failed")
File "stm32loader.py", line 79, in _wait_for_ask
raise CmdException("Chip replied with a NACK during %s" % info)
__main__.CmdException: Chip replied with a NACK during 0x31 programming failed
页:
[1]