Skip to content
Snippets Groups Projects
Select Git revision
  • ba3a2bc5f42ad78d4f1339de69e286be7a6484c8
  • main default protected
  • blm_dev_chan
  • release/1.4.0 protected
  • widgets_draw
  • return_of_melodic_demo
  • task_cleanup
  • mixer2
  • dx/fb-save-restore
  • dx/dldldld
  • fpletz/flake
  • dx/jacksense-headset-mic-only
  • release/1.3.0 protected
  • fil3s-limit-filesize
  • allow-reloading-sunmenu
  • wifi-json-error-handling
  • app_text_viewer
  • shoegaze-fps
  • media_has_video_has_audio
  • fil3s-media
  • more-accurate-battery
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.2.0+rc1
  • v1.1.1
  • v1.1.0
  • v1.1.0+rc1
  • v1.0.0
  • v1.0.0+rc6
  • v1.0.0+rc5
  • v1.0.0+rc4
  • v1.0.0+rc3
  • v1.0.0+rc2
  • v1.0.0+rc1
35 results

flow3r-firmware

  • Clone with SSH
  • Clone with HTTPS
  • moon2's avatar
    moon2 authored and Serge Bazanski committed
    ba3a2bc5
    History

    current functionality

    micropython repl hooked up, hw functionality partly broken

    some fun commands to try:

    import hardware
    #turn on sound
    hardware.set_global_volume_dB(-10)
    
    from synth import tinysynth
    a=tinysynth(440,1); # enters decay phase without stop signal
    a.start();
    b=tinysynth(660,0); # sustains until stop signal
    b.start();
    b.stop();
    
    #tiny issue with garbage collect:
    hardware.count_sources();
    a.__del__();
    hardware.count_sources();
    import gc
    del b
    gc.collect()
    hardware.count_sources();
    #...don't know how to hook up gc to __del__, maybe wrong approach

    files can be transferred with mpremote, such as:

    mpremote fs cp python_payload/boot.py :boot.py
    mpremote fs cp python_payload/cap_touch_demo.py :cap_touch_demo.py

    how to build

    1. install esp-idf v4.4: (copied from https://www.wemos.cc/en/latest/tutorials/others/build_micropython_esp32.html)
    $ cd ~
    $ git clone https://github.com/espressif/esp-idf.git
    $ cd esp-idf
    $ git checkout v4.4
    $ git submodule update --init --recursive
    
    $ cd esp-idf
    $ ./install.sh
    $ source export.sh

    best put something like "alias espidf='source ~/esp-idf/export.sh'" in your .bashrc etc, you need to run it in every new terminal and adding it to autostart did bother us

    1. prepare build
    $ cd micropython/
    $ make -C mpy-cross
    $ cd ports/esp32
    $ make submodules
    1. build/flash make sure esp-idf is sourced as in step 1 and that you are in micropython/ports/esp32 build:
    $ make

    flash + build: (put badge into bootloader mode*)

    $ make deploy PORT=/dev/ttyACM0

    *press right shoulder button down during boot (on modified "last gen" prototypes)

    empty build cache (useful when moving files around):

    $ make clean
    1. access micropython repl:
    $ picocom -b 115200 /dev/ttyACM0

    how to modify

    general info

    global + micropython entry point: app_main() in micropython/ports/esp32/main.c (includes badge23/espan.h) c entry point, called by^: os_app_main() in badge23/espan.c register new c files for compilation: add to set(BADGE23_LIB) in micropython/ports/esp32/main/CMakelists.txt change output volume in the set_global_vol_dB(int8_t) call; -90 for mute

    to debug c files: printf broken atm, instead use: #include "../../py/mphal.h" mp_hal_stdout_tx_str("debug output: string literal here\n\r");

    don't expect esp component registry or idf.py menuconfig to work. tried adding config items manually to micropython/ports/esp32/boards/sdkconfig.badge23, doesn't work :/ just put them into header files manually ig;;