Code Monkey home page Code Monkey logo

bl602tool's Introduction

BL602 tools

Work in progress

bltool.py: flashing utility

Command line arguments

Argument Description
-p / --port The serial port to use
-b / --baudrate the baudrate to use (default: 115200)
-i / --info Print OTP info
-e / --erase Erase the flash chip
-w / --write Write to the flash chip. Usage: -w address filename
-r / --read Read from the flash chip. Usage: -r address length filename
-v / --verify Read back after writing to verify the resulting flash state

Notes

  • Always erase the flash before writing, this is needed because of how flash memory works
  • A baudrate of 115200 works, higher baudrates seem to work but can cause verification errors
  • Needs pre-processed binaries to work, this tool currently does not add the required boot headers
  • Work in progress

printheader.py: show boot header contents

Work in progress!

genheader.py: generate boot headers

Work in progress!

genimage.py: generate flash image from an application

Work in progress!

Other files

Bootloader from SDK: blsp_boot2.bin Flash image generated using the official flashing tool: compare.bin Flashing utility firmware from the official flashing tool: eflash_loader_rc32m.bin Alternative flashing utility firmware from the official flashing tool: eflash_loader_40m.bin Bare application binary: application.bin

bl602tool's People

Contributors

renzenicolai avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

punnerud

bl602tool's Issues

Parse errors with hex loading addresses

I was revisiting this for the BL706 ('it's the same, they said...') and came across an error that I suspect is just another incompatibility across python versions. With

python3 --version
Python 3.9.5

an attempt to run python3 ./bltool.py -L -p /dev/cu.usbmodem0000000200001 -w 0x23000000 /tmp/lvgl_main.bin

will result in a a parse error for 0x230000000 as base 10. It looks like

diff --git a/bltool.py b/bltool.py
index 07d403c..5409a5e 100644
--- a/bltool.py
+++ b/bltool.py
@@ -288,7 +288,7 @@ def main():
eflash.eraseFlash()

     if args.write:
  •        address = int(args.write[0])
    
  •        address = int(args.write[0], 0)
           filename = args.write[1]
           print("Writing file {} to address 0x{:08x}...".format(filename, address))
           with open(filename, "rb") as f:
    

is the style of change needed. I'll leave it to you to figure out how to do that across Python versions that you care about.

Thanx!

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.