GithubHelp home page GithubHelp logo

smaeul / bouffalo-loader Goto Github PK

View Code? Open in Web Editor NEW
22.0 6.0 2.0 43 KB

Run an executable from RAM on a Bouffalo MCU (BL602 or BL808)

License: Other

Makefile 1.16% Python 88.28% Assembly 5.50% C 5.06%

bouffalo-loader's Introduction

Overview

This is a small tool that runs an ELF executable on Bouffalo Lab SoCs without touching the flash contents. It communicates with the boot ROM over UART. It is mostly focused on BL808, but it uses the unmodified image header definitions from bflb-mcu-tool, so it should be easy to extend to other SoCs.

Usage

Run loader.py. Its inputs are the firmware file and a configuration file. The configuration file sets fields in the boot header, such as clock and CPU setup. Default files are provided for BL602 and BL808, but they may need to be adjusted if your MCU has some eFuses set. Fields such as the load and entry addresses are automatically updated from the ELF file.

The tool uses a safe, slow baud rate by default, but larger values of at least 2 Mbaud are known to work.

See below or run python3 loader.py --help for the full help text.

usage: loader [-h] [-b BAUD] [-C CFG] [-c {bl602,bl808}] [-p PORT] firmware

Load an ELF to the MCU's RAM and execute it.

positional arguments:
  firmware              ELF executable file path

options:
  -h, --help            show this help message and exit
  -b BAUD, --baud BAUD  Serial port baud rate
  -C CFG, --cfg CFG     Config file with values for boot header fields
  -c {bl602,bl808}, --chip {bl602,bl808}
                        MCU variant connected to the serial port
  -p PORT, --port PORT  Serial port device path

Demo application

This repository also contains demo applications for testing the loader. They do nothing useful on their own. See the Makefile for more details. The loader itself is pure Python, and does not require compiling the demo applications.

bouffalo-loader's People

Contributors

orangecms avatar smaeul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

orangecms brawnd0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.