搜索

[应用相关] STM32F4编译MicroPython源码报错求助

[复制链接]
191|9
 楼主 | 2021-2-16 13:22 | 显示全部楼层 |阅读模式
本帖最后由 caizhiwei 于 2021-2-19 09:41 编辑

#申请原创# 开发环境:Win10+ WSLMicropython源码,不是githuu上拉的,是官方网站发布的稳定版本:
MicroPython - Python for microcontrollers http://micropython.org/download/

第一步,安装gcc-arm-gnueabi
QQ浏览器截图20210216130258.png

2. 打开/mnt/c/Users/Administrator/Desktop/MicroPython/micropython-1.14/ports/stm32$ 路径下:
执行编译指令:
  1. make BOARD=NUCLEO_F412ZG
复制代码


一开始还很顺利,到后面就报错了。
  1. casy@amd-pc:/mnt/c/Users/Administrator/Desktop/MicroPython/micropython-1.14/ports/stm32$ make BOARD=NUCLEO_F412ZG
  2. Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
  3. mkdir -p build-NUCLEO_F412ZG/genhdr
  4. GEN build-NUCLEO_F412ZG/genhdr/pins.h
  5. GEN stmconst build-NUCLEO_F412ZG/modstm_qstr.h
  6. GEN build-NUCLEO_F412ZG/genhdr/mpversion.h
  7. GEN build-NUCLEO_F412ZG/genhdr/moduledefs.h
  8. GEN build-NUCLEO_F412ZG/genhdr/pybcdc.inf
  9. GEN build-NUCLEO_F412ZG/genhdr/pybcdc_inf.h
  10. GEN build-NUCLEO_F412ZG/genhdr/pllfreqtable.h
  11. GEN build-NUCLEO_F412ZG/genhdr/qstr.i.last
  12. GEN build-NUCLEO_F412ZG/genhdr/qstr.split
  13. GEN build-NUCLEO_F412ZG/genhdr/qstrdefs.collected.h
  14. QSTR updated
  15. GEN build-NUCLEO_F412ZG/genhdr/qstrdefs.generated.h
  16. GEN build-NUCLEO_F412ZG/genhdr/compressed.split
  17. GEN build-NUCLEO_F412ZG/genhdr/compressed.collected
  18. Compressed data updated
  19. GEN build-NUCLEO_F412ZG/genhdr/compressed.data.h
  20. mkdir -p build-NUCLEO_F412ZG/build-NUCLEO_F412ZG/
  21. mkdir -p build-NUCLEO_F412ZG/drivers/bus/
  22. mkdir -p build-NUCLEO_F412ZG/drivers/dht/
  23. mkdir -p build-NUCLEO_F412ZG/drivers/memory/
  24. mkdir -p build-NUCLEO_F412ZG/extmod/
  25. mkdir -p build-NUCLEO_F412ZG/lib/embed/
  26. mkdir -p build-NUCLEO_F412ZG/lib/libc/
  27. mkdir -p build-NUCLEO_F412ZG/lib/libm/
  28. mkdir -p build-NUCLEO_F412ZG/lib/mp-readline/
  29. mkdir -p build-NUCLEO_F412ZG/lib/netutils/
  30. mkdir -p build-NUCLEO_F412ZG/lib/oofatfs/
  31. mkdir -p build-NUCLEO_F412ZG/lib/stm32lib/CMSIS/STM32F4xx/Source/Templates/
  32. mkdir -p build-NUCLEO_F412ZG/lib/stm32lib/CMSIS/STM32F4xx/Source/Templates/gcc/
  33. mkdir -p build-NUCLEO_F412ZG/lib/stm32lib/STM32F4xx_HAL_Driver/Src/
  34. mkdir -p build-NUCLEO_F412ZG/lib/timeutils/
  35. mkdir -p build-NUCLEO_F412ZG/lib/utils/
  36. mkdir -p build-NUCLEO_F412ZG/py/
  37. mkdir -p build-NUCLEO_F412ZG/usbdev/class/src/
  38. mkdir -p build-NUCLEO_F412ZG/usbdev/core/src/
  39. CC ../../py/mpstate.c
  40. CC ../../py/nlr.c
  41. CC ../../py/nlrx86.c
  42. CC ../../py/nlrx64.c
  43. CC ../../py/nlrthumb.c
  44. CC ../../py/nlrpowerpc.c
  45. CC ../../py/nlrxtensa.c
  46. CC ../../py/nlrsetjmp.c
  47. CC ../../py/malloc.c
  48. CC ../../py/gc.c
  49. CC ../../py/pystack.c
  50. CC ../../py/qstr.c
  51. CC ../../py/vstr.c
  52. CC ../../py/mpprint.c

  53. CC ../../py/unicode.c
  54. CC ../../py/mpz.c
  55. CC ../../py/reader.c
  56. CC ../../py/lexer.c
  57. CC ../../py/parse.c
  58. CC ../../py/scope.c
  59. CC ../../py/compile.c
  60. CC ../../py/emitcommon.c
  61. CC ../../py/emitbc.c
  62. CC ../../py/asmbase.c
  63. CC ../../py/asmx64.c
  64. CC ../../py/emitnx64.c
  65. CC ../../py/asmx86.c
  66. CC ../../py/emitnx86.c
  67. CC ../../py/asmthumb.c
  68. CC ../../py/emitnthumb.c
  69. CC ../../py/emitinlinethumb.c
  70. CC ../../py/asmarm.c
  71. CC ../../py/emitnarm.c
  72. CC ../../py/asmxtensa.c
  73. CC ../../py/emitnxtensa.c
  74. CC ../../py/emitinlinextensa.c
  75. CC ../../py/emitnxtensawin.c
  76. CC ../../py/formatfloat.c
  77. CC ../../py/parsenumbase.c
  78. CC ../../py/parsenum.c
  79. CC ../../py/emitglue.c
  80. CC ../../py/persistentcode.c
  81. CC ../../py/runtime.c
  82. CC ../../py/runtime_utils.c
  83. CC ../../py/scheduler.c
  84. CC ../../py/nativeglue.c
  85. CC ../../py/pairheap.c
  86. CC ../../py/ringbuf.c
  87. CC ../../py/stackctrl.c
  88. CC ../../py/argcheck.c
  89. CC ../../py/warning.c
  90. CC ../../py/profile.c
  91. CC ../../py/map.c
  92. CC ../../py/obj.c
  93. CC ../../py/objarray.c
  94. CC ../../py/objattrtuple.c
  95. CC ../../py/objbool.c
  96. CC ../../py/objboundmeth.c
  97. CC ../../py/objcell.c
  98. CC ../../py/objclosure.c
  99. CC ../../py/objcomplex.c
  100. CC ../../py/objdeque.c
  101. CC ../../py/objdict.c
  102. CC ../../py/objenumerate.c
  103. CC ../../py/objexcept.c
  104. CC ../../py/objfilter.c
  105. CC ../../py/objfloat.c
  106. CC ../../py/objfun.c
  107. CC ../../py/objgenerator.c
  108. CC ../../py/objgetitemiter.c
  109. CC ../../py/objint.c
  110. CC ../../py/objint_longlong.c
  111. CC ../../py/objint_mpz.c
  112. CC ../../py/objlist.c
  113. CC ../../py/objmap.c
  114. CC ../../py/objmodule.c
  115. CC ../../py/objobject.c
  116. CC ../../py/objpolyiter.c
  117. CC ../../py/objproperty.c
  118. CC ../../py/objnone.c
  119. CC ../../py/objnamedtuple.c
  120. CC ../../py/objrange.c
  121. CC ../../py/objreversed.c
  122. CC ../../py/objset.c
  123. CC ../../py/objsingleton.c
  124. CC ../../py/objslice.c
  125. CC ../../py/objstr.c
  126. CC ../../py/objstrunicode.c
  127. CC ../../py/objstringio.c
  128. CC ../../py/objtuple.c
  129. CC ../../py/objtype.c
  130. CC ../../py/objzip.c
  131. CC ../../py/opmethods.c
  132. CC ../../py/sequence.c
  133. CC ../../py/stream.c
  134. CC ../../py/binary.c
  135. CC ../../py/builtinimport.c

  136. CC ../../py/builtinevex.c
  137. CC ../../py/builtinhelp.c
  138. CC ../../py/modarray.c
  139. CC ../../py/modbuiltins.c
  140. CC ../../py/modcollections.c
  141. CC ../../py/modgc.c
  142. CC ../../py/modio.c
  143. CC ../../py/modmath.c
  144. CC ../../py/modcmath.c
  145. CC ../../py/modmicropython.c
  146. CC ../../py/modstruct.c
  147. CC ../../py/modsys.c
  148. CC ../../py/moduerrno.c
  149. CC ../../py/modthread.c
  150. CC ../../py/vm.c
  151. CC ../../py/bc.c
  152. CC ../../py/showbc.c
  153. CC ../../py/repl.c
  154. CC ../../py/smallint.c
  155. CC ../../py/frozenmod.c
  156. CC ../../extmod/moduasyncio.c
  157. CC ../../extmod/moductypes.c
  158. CC ../../extmod/modujson.c
  159. CC ../../extmod/modure.c
  160. CC ../../extmod/moduzlib.c
  161. CC ../../extmod/moduheapq.c
  162. CC ../../extmod/modutimeq.c
  163. CC ../../extmod/moduhashlib.c
  164. CC ../../extmod/moducryptolib.c
  165. CC ../../extmod/modubinascii.c
  166. CC ../../extmod/virtpin.c
  167. CC ../../extmod/machine_mem.c
  168. CC ../../extmod/machine_pinbase.c
  169. CC ../../extmod/machine_signal.c
  170. CC ../../extmod/machine_pulse.c
  171. CC ../../extmod/machine_i2c.c
  172. CC ../../extmod/machine_spi.c
  173. CC ../../extmod/modbluetooth.c
  174. CC ../../extmod/modussl_axtls.c
  175. CC ../../extmod/modussl_mbedtls.c
  176. CC ../../extmod/modurandom.c
  177. CC ../../extmod/moduselect.c
  178. CC ../../extmod/moduwebsocket.c
  179. CC ../../extmod/modwebrepl.c
  180. CC ../../extmod/modframebuf.c
  181. CC ../../extmod/vfs.c
  182. CC ../../extmod/vfs_blockdev.c
  183. CC ../../extmod/vfs_reader.c
  184. CC ../../extmod/vfs_posix.c
  185. CC ../../extmod/vfs_posix_file.c
  186. CC ../../extmod/vfs_fat.c
  187. CC ../../extmod/vfs_fat_diskio.c
  188. CC ../../extmod/vfs_fat_file.c
  189. CC ../../extmod/vfs_lfs.c
  190. CC ../../extmod/utime_mphal.c
  191. CC ../../extmod/uos_dupterm.c
  192. CC ../../lib/embed/abort_.c
  193. CC ../../lib/utils/printf.c
  194. mpy-cross not found at /mnt/c/Users/Administrator/Desktop/MicroPython/micropython-1.14/mpy-cross/mpy-cross, please build it first
  195. ../../py/mkrules.mk:142: recipe for target 'build-NUCLEO_F412ZG/frozen_content.c' failed
  196. make: *** [build-NUCLEO_F412ZG/frozen_content.c] Error 1
  197. casy@amd-pc:/mnt/c/Users/Administrator/Desktop/MicroPython/micropython-1.14/ports/stm32$
复制代码



使用特权

评论回复
 楼主 | 2021-2-16 21:26 | 显示全部楼层
在Linux下编译micropython源码的方法(包括win10的ubuntu子系统) - 灰信网(软件开发博客聚合) https://www.freesion.com/article/1270212647/

使用特权

评论回复
 楼主 | 2021-2-16 21:26 | 显示全部楼层
原来缺少一个东西没有编译。

使用特权

评论回复
| 2021-2-17 09:57 | 显示全部楼层
先到micropython/mpy-cross/目录,make一下,再回到ports/stm32  编译

使用特权

评论回复
 楼主 | 2021-2-19 09:25 | 显示全部楼层
zengyi703 发表于 2021-2-17 09:57
先到micropython/mpy-cross/目录,make一下,再回到ports/stm32  编译

对的,感谢~

使用特权

评论回复
| 2021-3-3 07:38 | 显示全部楼层
这是另外一种语言吗

使用特权

评论回复
| 2021-3-3 07:40 | 显示全部楼层
不会用这个 学习一下

使用特权

评论回复
| 2021-3-3 07:43 | 显示全部楼层
使用什么工具进行编译啊

使用特权

评论回复
| 2021-3-3 07:45 | 显示全部楼层
需要打开目录下的文件是吗

使用特权

评论回复
| 2021-3-3 07:47 | 显示全部楼层
原来是这样解决的  非常好啊

使用特权

评论回复
扫描二维码,随时随地手机跟帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

我要发帖 我要提问 投诉建议 申请版主

快速回复

您需要登录后才可以回帖
登录 | 注册
高级模式

论坛热帖

在线客服 快速回复 返回顶部 返回列表