搜索
bottom↓
回复: 17

有在Linux下玩stm32的朋友吗?是用的什么工具呢(硬件和软件)?

[复制链接]

出0入0汤圆

发表于 2010-8-7 11:11:54 | 显示全部楼层 |阅读模式
我想用JLink那个linux的测试版,曾经试过,已经驱动上,进到

JLink > _

里面了,

而且用命令已经可以识别我的芯片型号 cortex-m3,可是Download的时候总是出错,失败

所以不知道具体还应该做什么?

还需要什么开发环境吗?用的是什么工具链呢?或者干脆不用JLink直接用串口线?

望不吝赐教~

阿莫论坛20周年了!感谢大家的支持与爱护!!

月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!

出0入0汤圆

 楼主| 发表于 2012-3-30 01:26:22 | 显示全部楼层
一年多过去了,自己来结这个帖子。
现在用linux环境用得很嗨,各种方便
搞这个东西基本就是 serial / dfu
编译器当然gcc了
makefile 那一套也基本搞明白了
编译链接这些琐碎的事情也没什么问题

把这个“悬帖”落实一下,为后来人提供个方便,有问题的话也可以解决了。

出0入0汤圆

发表于 2012-5-27 15:55:17 | 显示全部楼层
呵呵,希望具体描述下。谢谢!

出0入0汤圆

发表于 2012-5-27 16:01:40 | 显示全部楼层
支持下,同楼上也期待具体描述。

出0入0汤圆

发表于 2012-5-27 16:39:34 | 显示全部楼层
希望LZ写一个教程造福后来人

出0入0汤圆

发表于 2012-5-27 18:00:44 来自手机 | 显示全部楼层
同上,希望能有一系列教程。希望能完全摆脱windows。

出0入0汤圆

发表于 2012-6-20 15:36:19 | 显示全部楼层
楼主写个图文教程造福后人呗~~~

出0入0汤圆

发表于 2012-10-13 19:55:55 | 显示全部楼层
同样希望楼主出一个图文教程啊

自己摸索很困难

出0入0汤圆

发表于 2012-10-13 20:05:16 | 显示全部楼层
这个帖子够强,一年多了楼主还能占2楼

出0入85汤圆

发表于 2012-10-13 20:05:44 | 显示全部楼层
mark

出0入0汤圆

 楼主| 发表于 2013-7-25 22:41:14 | 显示全部楼层
本帖最后由 librae8226 于 2013-7-25 22:42 编辑

抱歉,好久没来看过了。
这些年在一家芯片公司工作,环境一直是linux,包括自己的机器和公司服务器,所以几乎不会用到windows,除了打实况 :P

关于stm32的开发,详细的方法可以参考我们的一个开源项目:
https://github.com/LeafGrass/ousia

这个项目里采用 linux host 作为开发环境,有完整的 build system,可以方便地添加/删减模块。
实现的是一个极其简化的操作系统,有最笨的调度和最简单的内存“管理”,最初就在stm32上进行开发成型的。
整个系统连上USB就可以玩了,类似arduino,不需要其它调试设备,只有第一次使用的时候需要烧写一遍bootloader。因此开发也变得非常方便。
相信对于初级阶段的学习非常合适。

有需要的朋友可以随便拿去用,pitolan大大曾教我们饮水思源,非常乐意帮助后来的同学,有问可以直接邮件联系我:
    我的论坛名字@gmail点com

这里把 README 内容贴出来:
  1.         Ousia
  2. =======================
  3. COPYRIGHT (C) LEAFGRASS


  4. Introduction
  5. ------------
  6. "Ousia" is picked from Greek.
  7. Mainly intend to represent the essence of Real-Time Theory.
  8. Developed following K-I-S-S principle.


  9. Source Tree Architecture
  10. ------------------------
  11. * core/
  12.     Ousia core routines.

  13. * doc/
  14.     Complete documentation of Ousia.

  15. * driver/
  16.     Different kinds of device drivers based on Ousia.
  17.     They are all configurable.

  18. * framework/
  19.     Framework based on Ousia. Such as shell, vfs, etc.
  20.     They are scalable and configurable, either.

  21. * include/
  22.     Header files of main routines of Ousia.

  23. * platform/
  24.     Chip and board specific code, e.g. low-level library.
  25.     Ousia porting code are also placed here.

  26. * project/
  27.     Project source code. Include several sample project instances.

  28. * script/
  29.     Useful scripts used while Ousia developing.

  30. * support/
  31.     Basic supporting stuffs for Ousia developing and building.
  32.     Useful template files are placed here, such as porting code template.


  33. How to Start for Fresh New Environment
  34. --------------------------------------
  35. -   Install toolchain
  36. -   Make
  37.     For a general purpose, these steps are enough, but there are some more
  38.     steps needs to do for each platform.

  39.     As for stm32 on linux host, we use dfu/serial/jtag to upload firmware,
  40.     setup like below:
  41. -   Install Codesourcery toolchain. (e.g. arm-2011.03-42-arm-none-eabi)
  42. -   Install dfu-util/pyserial/openocd (it's up to your preference).
  43.     Ps: In fedora or ubuntu, yum/apt-get install them is ok.
  44. -   Resolve usb or serial access problems.
  45.     (e.g. copy ousia/support/dfu/45-maple.rules to /etc/udev/rules.d/)
  46. -   Install minicom for console print if you want to debug with uart.
  47.     Ps: Default port is /dev/ttyACMx
  48. -   Do 'make' and 'make install'.


  49. Create User Project Steps
  50. -------------------------
  51. -   Create a directory named PROJECT_NAME in folder "project".
  52. -   Add user source code.
  53. -   Create a file rules.mk to specify source code related rules for makefile.
  54. -   Update TARGET_PLATFORM and PROJECT_NAME in main Makefile, then make.

  55. Ps: Refer to existing projects for further detailed information.


  56. Core Developing Steps
  57. ---------------------
  58. -   Choose or create a branch of yourself to work on.
  59. -   Update source code, include those version related strings.
  60. -   Modify related Makefiles and configuration files.
  61. -   Build then do some testing on this branch.
  62. -   Commit it.
  63. -   Tag a new one if a new version is commited.
  64. -   Push this branch to remote repo.
  65. -   If this is a release version, update Ousia Release Notes.


  66. Porting Steps
  67. -------------
  68. -   Create a directory named PLATFORM_NAME in folder "platform", then enter it.
  69. -   Create three files: rules.mk config.mk target.mk.
  70.         @rules.mk: makefile source code related rules
  71.         @config.mk: parameters or flags for toolchains and environment
  72.         @target.mk: rules for building target
  73. -   Create a directory named "port" there then create three files in it.
  74.         @ousia_cfg.h: os scalability related configurations
  75.         @ousia_port.h: header of porting code
  76.         @ousia_port.c: implentation of porting
  77. -   Create other porting related stuffs, such as linker scripts, if necessary.
  78. -   Update TARGET_PLATFORM and PROJECT_NAME in main Makefile, then make.

  79. Ps: If modified porting related code, should not edit directly in "core/port",
  80. do that in specific platform directory instead, e.g. "platform/stm32/port".
  81. Makefile will copy them into "core/port" automatically depend on specific cpu
  82. types.


  83. Build A Different Platform
  84. --------------------------
  85. Only modify the header TODO in root Makefile
  86. -   Assign specific TARGET_PLATFORM and PROJECT_NAME


  87. Download Code to Target Chip
  88. ----------------------------
  89. -   Modify related User Customization Items in Makefile in source tree.
  90.     For stm32, you need to decide which MEMORY_TARGET to use:
  91.     jtag, flash, or ram.
  92. -   Do proper operation on hardware. (i.e. change boot jumper or reset or sth.)
  93. -   Then type 'make install' and it will do everything for you.

  94. Ps: For stm32, there may be a bootloader, 'make bootloader' will download
  95. bootloader code to chip via serial. And for simulation on x86, no code
  96. downloading procedure is needed. See Makefile for detailed information.


  97. Acknowledgments
  98. ---------------
  99. Parts of make system and libmaple stm32 low-level code are borrowed from libmaple.
  100. Thanks to their excellent works! - http://leaflabs.com
  101. Many code are originally come or inspired from Nuttx, a perfect and stable operating system.
  102. Also great appreciations to the contributors! - http://nuttx.org
复制代码
上两幅简单的图吧








出0入0汤圆

发表于 2013-7-26 08:38:27 | 显示全部楼层
这个真的可以有

出0入0汤圆

发表于 2013-7-26 08:39:56 | 显示全部楼层
librae8226 发表于 2012-3-30 01:26
一年多过去了,自己来结这个帖子。
现在用linux环境用得很嗨,各种方便
搞这个东西基本就是 serial / dfu

希望楼主写个图文教程说明下啊!

出0入0汤圆

发表于 2013-7-26 08:45:33 来自手机 | 显示全部楼层
手机看贴,mark

出0入0汤圆

 楼主| 发表于 2013-7-26 12:02:34 | 显示全部楼层
qzxy0927 发表于 2013-7-26 08:39
希望楼主写个图文教程说明下啊!

回#13的朋友:

可以参考下在11楼贴出来的一个README文件,里面有一些讲解,包括怎么搭建环境,需要哪些工具,等等。
图的话其实都是命令行的,没有window了 :)

具体遇到的问题可以贴出来,我会尽量解答。

出0入0汤圆

发表于 2013-7-26 14:07:17 | 显示全部楼层
so good...

出0入0汤圆

发表于 2013-11-6 19:18:11 | 显示全部楼层
要是楼主能够提供一个教程就好了。

出0入0汤圆

发表于 2019-2-19 11:01:08 | 显示全部楼层
入啦,支持一下,跟进!
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-4-24 18:46

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表