Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ESP32 ULP Co-Processor assembler implemented in CircuitPython

License

NotificationsYou must be signed in to change notification settings

Sola85/circuitpython-esp32-ulp-assembler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

circuitpython-esp32-ulp-assembler

The goal is to be able to write ESP-ULP Assembly code and run it from within circuit python.This requires CircuitPython 9.1.0 or later.

A fork of the original micropython-esp32-ulp assembler was necessary, since that project uses micropython packages that are not enabled in cirucitpython.This fork fixes this incompatibility.

The examples provided in this fork are tested to work on esp32s3 and partially tested on an esp32.

The documentation in`docs`_ is outdated and the tests, as well as the tools are not yet updated to circuitpython.

micropython-esp32-ulp

micropython-esp32-ulp is an assembler toolchain for the ESP32 ULP (Ultra Low-Power)Co-Processor, written in MicroPython.

It can translate small assembly language programs to a loadable/executableULP-FSM (not RISC-V) machine code binary, directly on a ESP32 microcontroller.

This is intended as an alternative approach to assembling such programs usingthebinutils-gdb toolchain(esp32-elf-as) from Espressif on a development machine.

It can also be useful in cases where esp32-elf-as is not available.

Features

The following features are supported:

  • the entireESP32 ULP instruction set
  • the entireESP32-S2 ULP instruction set(this also covers the ESP32-S3)[1][2]
  • constants defined with.set
  • constants defined with#define
  • expressions in assembly code and constant definitions
  • RTC convenience macros (e.g.WRITE_RTC_REG)
  • many ESP32 ULP code examples found on the web will work unmodified
  • a simple disassembler is also provided
[1]Note: the ESP32-S2 and ESP32-S3 have the same ULP binary format between each otherbut the binary format is different than that of the original ESP32 ULP. You need toselect theesp32s2 cpu (see docs) when assembling code foruse on an ESP32-S2/S3.
[2]Note: The ESP32-S2 and ESP32-S3 have the same ULP binary format, but the peripheralregister addresses (those accessed with REG_RD and REG_WR) are different. For bestresults, use the correct peripheral register addresses for the specific variant youare working with. The assembler (when used withcpu=esp32s2) will acceptaddresses for any of the 3 variants, because they are translated into relativeoffsets anyway and many registers live at the same relative offset on all 3 variants.This conveniently means that the same assembly code can assembled unmodified for eachvariant and produce a correctly working binary - as long as only peripheral registersare used, which have the same relative offset across the variants. Use with care!

Quick start

To get going, copy the esp32_ulp folder to the lib folder on the circuitpy drive.

Theexamples/counter.py example shows how to assemble code,load and run the resulting binary and exchange data between the ULP and the main CPU.

Documentation

Seedocs/index.rst.

Requirements

This branch of circuitpython:

An ESP32 device is required to run the ULP machine code binary produced bymicropython-esp32-ulp.

License

This project is released under theMIT License.

About

ESP32 ULP Co-Processor assembler implemented in CircuitPython

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python88.5%
  • Shell6.4%
  • Assembly5.1%

[8]ページ先頭

©2009-2025 Movatter.jp