micropython编译流程

最近终于都考完了,虽然最近没有发帖子,可是还是看了挺多东西的,都不深,就自己写一点自己做的工作。

git上面下载了micropython源码 这里就不留地址了,因为下下来还是需要改很多,,虽然我也不知道为什么还有不对的地方,可能环境不太相同,可能是我README没有看仔细。


//下载了 micropython源码,其中不包含其子项目,也就是你要应用在micropython在哪个环境中,那个对应环境的HAL或者是底层库没有包括其中,需要你自己下载 。README中有详细介绍。

/没手动下载stm32lib之前的错误   git之后无stm32的lib 


root@charles-VirtualBox:/media/sf_Linux/micropython-master/ports/stm32# make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
stm32lib submodule not found, fetching it now...
(cd ../.. && git submodule update --init lib/stm32lib)
error: pathspec 'lib/stm32lib' did not match any file(s) known to git.
Makefile:352: recipe for target '../../lib/stm32lib/README.md' failed
make: *** [../../lib/stm32lib/README.md] Error 1


手动下载的stm32lib之后的错误


root@charles-VirtualBox:/media/sf_Linux/micropython-master/ports/stm32# make BOARD=CANNON
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-CANNON/genhdr
Create build-CANNON/genhdr/pins.h
Create stmconst build-CANNON/modstm_qstr.h
Create build-CANNON/genhdr/pybcdc.inf
Create build-CANNON/genhdr/pybcdc_inf.h
Create build-CANNON/genhdr/pllfreqtable.h
Generating build-CANNON/genhdr/mpversion.h
GEN build-CANNON/genhdr/qstr.i.last
/bin/sh: 1: /media/sf_Linux/gcc-arm-none-eabi-linux/gcc-arm-noneezbi/bin/arm-none-linux-gnueabi-gcc: not found
../../py/mkrules.mk:73: recipe for target 'build-CANNON/genhdr/qstr.i.last' failed
make: *** [build-CANNON/genhdr/qstr.i.last] Error 127
make: *** Deleting file 'build-CANNON/genhdr/qstr.i.last'


///修改了makefile中的路径


CC ../../py/../extmod/uos_dupterm.c
CC ../../py/../lib/embed/abort_.c
CC ../../py/../lib/utils/printf.c
MPY modules/lcd160cr.py
Traceback (most recent call last):
  File "modules/lcd160cr.py", line 1
SyntaxError: invalid syntax
../../py/mkrules.mk:115: recipe for target 'build-CANNON/frozen_mpy/lcd160cr.mpy' failed
make: *** [build-CANNON/frozen_mpy/lcd160cr.mpy] Error 1
root@charles-VirtualBox:/media/sf_Linux/micropython-master/ports/stm32#  


//把lcd160cr.py lcd160cr_test.py onewire.py
//路径micropython-master\ports\stm32\modules下的显示函数都杠掉了


省略编译一堆lib下的库和stm32lib
CC usbdev/core/src/usbd_core.c
CC usbdev/core/src/usbd_ctlreq.c
CC usbdev/core/src/usbd_ioreq.c
CC usbdev/class/src/usbd_cdc_msc_hid.c
CC usbdev/class/src/usbd_msc_bot.c
CC usbdev/class/src/usbd_msc_scsi.c
CC usbdev/class/src/usbd_msc_data.c
CC build-CANNON/pins_CANNON.c
LINK build-CANNON/firmware.elf
build-CANNON/dma.o: In function `dma_init':
dma.c:(.text.dma_init+0xda): undefined reference to `DMA_CalcBaseAndBitshift'
Makefile:402: recipe for target 'build-CANNON/firmware.elf' failed
make: *** [build-CANNON/firmware.elf] Error 1


stm32f4xx_hal_dma.h文件  691行
添加
uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);//dd add


stm32f4xx_hal_dma.c文件
DMA_CalcBaseAndBitshift函数的 static去掉


编译成功
虽然现在还没有成功下进去 ,不过我感觉快了。
欢迎指正




评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值