4 Star 2 Fork 0

OpenNuvoton / NuMicroPy

加入 Gitee
与超过 800 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README.md

NuMicroPy

NuMicroPy is Nuvoton microcontroller porting for MicroPython. MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. See MicroPython


Major components in this repository

  • M480BSP/ -- NuMicro M480 series BSP
  • M261BSP/ -- NuMicro M261 series BSP
  • build/ -- Prebuilt frimware
  • patch/ -- BSP/MicroPython patch files
  • M48x/ -- M480 series porting of MicroPython
  • M26x/ -- M261 series porting of MicroPython
  • micropython/ -- MicroPython official release(v1.10)
  • ThirdParty/ -- Third party library

Supported target

Board MCU Required ROM size Required RAM size
NuMaker-PFM-M487 M487 364KB/648KB(W/lvgl) 75KB/123KB(W/lvgl)
NuMaker-IOT-M487 M487 322KB 46KB
NuMaker-M263KI M263 266KB 35KB

LittlevGL required RAM size 123KB = 91KB + 32KB(SPIM cache)


How to start NuMicroPy

  1. Download and install Nu-Link Command Tool
  2. Hardware setup steps
    a. Turn on ICE function switch pin 1,2,3 and 4
    NuMaker-PFM-M487
    b. Connect USB ICE and USB1.1 to PC
    c. Setup your terminal program
    TeraTerm_setup1
    TeraTerm_setup2
  3. Burn firmware
    Nu-Link-Me exported a "NuMicro MCU" disk, just Copy and Paste prebuilt firmware.bin into "NuMicro MCU" disk.
    CopyPasteFirmware
  4. Python code update steps
    a. Connected USB1.1 to PC
    b. [NuMaker-PFM-M487 and NuMaker-IOT-M487]: Press the SW2 and RESET button together. [NuMaker-M263KI]: Press the RESET button. Firmware will export a PYBFLASH disk. PYBFLASH disk
    c. Update your python code to boot.py or main.py Main Code
    d. Press the RESET button.
    Execute Result

How to build firmware

The development of MicroPython firmware is in Unix-like environment. The description as below will be using Ubuntu 16.04.

  1. Packages Requirement
    The following packages will need to be installed before you can compile and run MicroPython

    • build-essential
    • libreadline-dev
    • libffi-dev
    • git
    • pkg-config

    To install these packages using the following command.

sudo apt-get install build-essential libreadline-dev libffi-dev git pkg-config
  1. Install GNU Arm Toolchain
    Download GNU Arm toolchain linux 64-bit version 7-2018-q2 update from Arm Developer. Next use the tar command to extract the file to your favor directory (ex. /usr/local)
mv gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 /usr/local/  
cd /usr/local  
tar -xjvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2  

Now, modify your PATH environment variable to access the bin directory of toolchain

  1. Build firmware
    To build MicroPython firmware for M487, use the following command.
git clone --recursive https://github.com/OpenNuvoton/NuMicroPy.git  
cd patch  
./run_patch.sh

For M480 series

cd ../M48x  
#For NuMaker-PFM-M487 board
make V=1
#For NuMaker-IOT-M487 board
make BOARD=NuMaker-IOT-M487 V=1

For M261 series

cd ../M26x
#For NuMaker-M263KI board
make V=1

How to run LittlevGL

M487Advance

  1. Hardware requirement: NuMaker-PFM-M487 + M487 Advance Ver 4.0
  2. Burn firmware.bin (build/NuMaker-PFM-M487/WithLittlevGL/) to APROM and firmware_spim.bin (build/NuMaker-PFM-M487/WithLittlevGL) to SPI flash
    a. Execute NuMicro ICP programming tool and connect to target chip(M480 Series)
    ICP_Connect
    b. Check SPIM multi-function pin select to PC2/PC3/PC1/PC0
    ICP_SPIM_PIN
    c. Programming config setting first
    ICP_PROG_CONF
    e. Programming APROM(firmware.bin) and SPI flash(firmware_spim.bin)
    ICP_PROG_CODE
    f. ICP tool disconnect target chip and press NuMaker-PFM-M487 RESET button
    ICP_Disconnect
    SPIM_TERM
  3. Please follow "How to start NuMicroPy" section 4. Copy example code(M48x/example/LittlevGL.py) to main.py
    LVGL_EXAM
    LVGL_TERM

简介

Nuvoton microcontroller porting for micropython 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/OpenNuvoton/NuMicroPy.git
git@gitee.com:OpenNuvoton/NuMicroPy.git
OpenNuvoton
NuMicroPy
NuMicroPy
master

搜索帮助