您尚未登录。

楼主 #1 2020-02-04 10:29:17

我心飞翔
会员
注册时间: 2019-12-25
已发帖子: 82
积分: 82

跟着 @hpf202 @xiaohui 学习 华芯微特 swm320 micropython

离线

楼主 #2 2020-02-04 10:34:20

我心飞翔
会员
注册时间: 2019-12-25
已发帖子: 82
积分: 82

Re: 跟着 @hpf202 @xiaohui 学习 华芯微特 swm320 micropython

编译软件下载: https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update
Linux 编译软件下载: gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2

cd /tmp/

wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2

sudo tar xvf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 -C /usr/local/

克隆源码,编译:

git clone https://gitee.com/mongopy/micropython_for_swm320.git

cd micropython_for_swm320

CROSS_COMPILE=/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi- make

ubuntu18.04 编译成功:

CC ../../extmod/modurandom.c
CC ../../extmod/moduselect.c
CC ../../extmod/moduwebsocket.c
CC ../../extmod/modwebrepl.c
CC ../../extmod/modframebuf.c
CC ../../extmod/vfs.c
CC ../../extmod/vfs_blockdev.c
CC ../../extmod/vfs_reader.c
CC ../../extmod/vfs_posix.c
CC ../../extmod/vfs_posix_file.c
CC ../../extmod/vfs_fat.c
CC ../../extmod/vfs_fat_diskio.c
CC ../../extmod/vfs_fat_file.c
CC ../../extmod/vfs_lfs.c
CC ../../extmod/utime_mphal.c
CC ../../extmod/uos_dupterm.c
CC ../../lib/embed/abort_.c
CC ../../lib/utils/printf.c
CC ../../lib/timeutils/timeutils.c
CC ../../lib/utils/sys_stdio_mphal.c
CC ../../lib/mp-readline/readline.c
CC ../../lib/utils/stdout_helpers.c
CC ../../lib/utils/interrupt_char.c
CC ../../lib/utils/pyexec.c
CC ../../lib/libm/nearbyintf.c
CC ../../lib/libm_dbl/nearbyint.c
CC ../../lib/netutils/netutils.c
/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc -o build/SWM320_MPY.elf -Wl,--gc-sections -Wl,-Map=build/SWM320_MPY.elf.map -T swm320.ld -mthumb -mcpu=cortex-m4 -mfloat-abi=soft -specs=nosys.specs -specs=nano.specs -u _printf_float build/main.o build/mphalport.o build/help.o build/delay.o build/file_io.o build/modutime.o build/moduos.o build/FreeRTOS/croutine.o build/FreeRTOS/event_groups.o build/FreeRTOS/heap/heap_1.o build/FreeRTOS/list.o build/FreeRTOS/port/port.o build/FreeRTOS/queue.o build/FreeRTOS/tasks.o build/FreeRTOS/timers.o build/CSL/CMSIS/DeviceSupport/system_SWM320.o build/CSL/SWM320_StdPeriph_Driver/SWM320_adc.o build/CSL/SWM320_StdPeriph_Driver/SWM320_can.o build/CSL/SWM320_StdPeriph_Driver/SWM320_crc.o build/CSL/SWM320_StdPeriph_Driver/SWM320_dma.o build/CSL/SWM320_StdPeriph_Driver/SWM320_exti.o build/CSL/SWM320_StdPeriph_Driver/SWM320_flash.o build/CSL/SWM320_StdPeriph_Driver/SWM320_gpio.o build/CSL/SWM320_StdPeriph_Driver/SWM320_i2c.o build/CSL/SWM320_StdPeriph_Driver/SWM320_lcd.o build/CSL/SWM320_StdPeriph_Driver/SWM320_norflash.o build/CSL/SWM320_StdPeriph_Driver/SWM320_port.o build/CSL/SWM320_StdPeriph_Driver/SWM320_pwm.o build/CSL/SWM320_StdPeriph_Driver/SWM320_rtc.o build/CSL/SWM320_StdPeriph_Driver/SWM320_sdio.o build/CSL/SWM320_StdPeriph_Driver/SWM320_sdram.o build/CSL/SWM320_StdPeriph_Driver/SWM320_spi.o build/CSL/SWM320_StdPeriph_Driver/SWM320_sram.o build/CSL/SWM320_StdPeriph_Driver/SWM320_timr.o build/CSL/SWM320_StdPeriph_Driver/SWM320_uart.o build/CSL/SWM320_StdPeriph_Driver/SWM320_wdt.o build/CSL/CMSIS/DeviceSupport/startup/gcc/startup_SWM320.o build/py/mpstate.o build/py/nlr.o build/py/nlrx86.o build/py/nlrx64.o build/py/nlrthumb.o build/py/nlrpowerpc.o build/py/nlrxtensa.o build/py/nlrsetjmp.o build/py/malloc.o build/py/gc.o build/py/pystack.o build/py/qstr.o build/py/vstr.o build/py/mpprint.o build/py/unicode.o build/py/mpz.o build/py/reader.o build/py/lexer.o build/py/parse.o build/py/scope.o build/py/compile.o build/py/emitcommon.o build/py/emitbc.o build/py/asmbase.o build/py/asmx64.o build/py/emitnx64.o build/py/asmx86.o build/py/emitnx86.o build/py/asmthumb.o build/py/emitnthumb.o build/py/emitinlinethumb.o build/py/asmarm.o build/py/emitnarm.o build/py/asmxtensa.o build/py/emitnxtensa.o build/py/emitinlinextensa.o build/py/emitnxtensawin.o build/py/formatfloat.o build/py/parsenumbase.o build/py/parsenum.o build/py/emitglue.o build/py/persistentcode.o build/py/runtime.o build/py/runtime_utils.o build/py/scheduler.o build/py/nativeglue.o build/py/ringbuf.o build/py/stackctrl.o build/py/argcheck.o build/py/warning.o build/py/profile.o build/py/map.o build/py/obj.o build/py/objarray.o build/py/objattrtuple.o build/py/objbool.o build/py/objboundmeth.o build/py/objcell.o build/py/objclosure.o build/py/objcomplex.o build/py/objdeque.o build/py/objdict.o build/py/objenumerate.o build/py/objexcept.o build/py/objfilter.o build/py/objfloat.o build/py/objfun.o build/py/objgenerator.o build/py/objgetitemiter.o build/py/objint.o build/py/objint_longlong.o build/py/objint_mpz.o build/py/objlist.o build/py/objmap.o build/py/objmodule.o build/py/objobject.o build/py/objpolyiter.o build/py/objproperty.o build/py/objnone.o build/py/objnamedtuple.o build/py/objrange.o build/py/objreversed.o build/py/objset.o build/py/objsingleton.o build/py/objslice.o build/py/objstr.o build/py/objstrunicode.o build/py/objstringio.o build/py/objtuple.o build/py/objtype.o build/py/objzip.o build/py/opmethods.o build/py/sequence.o build/py/stream.o build/py/binary.o build/py/builtinimport.o build/py/builtinevex.o build/py/builtinhelp.o build/py/modarray.o build/py/modbuiltins.o build/py/modcollections.o build/py/modgc.o build/py/modio.o build/py/modmath.o build/py/modcmath.o build/py/modmicropython.o build/py/modstruct.o build/py/modsys.o build/py/moduerrno.o build/py/modthread.o build/py/vm.o build/py/bc.o build/py/showbc.o build/py/repl.o build/py/smallint.o build/py/frozenmod.o build/extmod/moductypes.o build/extmod/modujson.o build/extmod/modure.o build/extmod/moduzlib.o build/extmod/moduheapq.o build/extmod/modutimeq.o build/extmod/moduhashlib.o build/extmod/moducryptolib.o build/extmod/modubinascii.o build/extmod/virtpin.o build/extmod/machine_mem.o build/extmod/machine_pinbase.o build/extmod/machine_signal.o build/extmod/machine_pulse.o build/extmod/machine_i2c.o build/extmod/machine_spi.o build/extmod/modbluetooth.o build/extmod/modussl_axtls.o build/extmod/modussl_mbedtls.o build/extmod/modurandom.o build/extmod/moduselect.o build/extmod/moduwebsocket.o build/extmod/modwebrepl.o build/extmod/modframebuf.o build/extmod/vfs.o build/extmod/vfs_blockdev.o build/extmod/vfs_reader.o build/extmod/vfs_posix.o build/extmod/vfs_posix_file.o build/extmod/vfs_fat.o build/extmod/vfs_fat_diskio.o build/extmod/vfs_fat_file.o build/extmod/vfs_lfs.o build/extmod/utime_mphal.o build/extmod/uos_dupterm.o build/lib/embed/abort_.o build/lib/utils/printf.o  build/lib/timeutils/timeutils.o  build/lib/utils/sys_stdio_mphal.o  build/lib/mp-readline/readline.o  build/lib/utils/stdout_helpers.o  build/lib/utils/interrupt_char.o  build/lib/utils/pyexec.o  build/lib/libm/nearbyintf.o  build/lib/libm_dbl/nearbyint.o  build/lib/netutils/netutils.o build/_frozen_mpy.o -lm
/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-objcopy -O ihex   build/SWM320_MPY.elf build/SWM320_MPY.hex
/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-objcopy -O binary build/SWM320_MPY.elf build/SWM320_MPY.bin
#  -d build/SWM320_MPY.elf > build/SWM320_MPY.elf.dis
root@wxfx:/opt/micropython_for_swm320/ports/swm320#

离线

楼主 #3 2020-02-04 22:04:03

我心飞翔
会员
注册时间: 2019-12-25
已发帖子: 82
积分: 82

Re: 跟着 @hpf202 @xiaohui 学习 华芯微特 swm320 micropython

用 JLink SWD连接松果派one,

A1 接 SWDIO
A0 接 SWCLK

编译好的固件SWM320_MPY.hex烧录进去: https://whycan.cn/t_3652.html#p33399

松果派one运行一切OK:

sysclk:100.000000mhz
 __          __  _    _  __     __   _____              _   _
 \ \        / / | |  | | \ \   / /  / ____|     /\     | \ | |
  \ \  /\  / /  | |__| |  \ \_/ /  | |         /  \    |  \| |
   \ \/  \/ /   |  __  |   \   /   | |        / /\ \   | . ` |
    \  /\  /    | |  | |    | |    | |____   / ____ \  | |\  |
     \/  \/     |_|  |_|    |_|     \_____| /_/    \_\ |_| \_|
Official Site:http://www.whycan.cn/
SiteEmail:admin@whycan.cn
AuthEmail:1766769299@qq.com,2535418266@qq.comxTaskCreate
Tasktest start
Taskmpy start
vTaskStartScheduler
Taskmpy
Taskmpy

MicroPython a29ef7a2f-dirty on 2020-02-03; SWM320VET7 with WHYCAN-SWM320VET7
Type "help()" for more information.
>>> 1+100
101
>>>

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn