Erschließung von I2S-Support und FFT für MicroPython auf Pycom/ESP32

A little bit off-topic regarding our requirements, but it outlines activity on the work of I2S support by Mike Teachman.

Mike Teachman is still working on I2S and improved the code examples just recently, see Comparing adbc7b7308...2549264e08 · miketeachman/micropython-esp32-i2s-examples · GitHub.

1 Like

Is Mike Teachman’s I2S example working with the current pycom firmware? Or do we need a special firmware?

The uasyncio library probably needs support from Genuine MicroPython core, so it might not be available on Pycom MicroPython yet.

This is Arduino C, not MicroPython, but perhaps some parts we can have a look at (in the last third)

Und hier auch noch Beispiel-Code für Arduino-C für einen ESP32, Vorbilder waren die Adafruit-Sketches zu I2S

Seems that Mike Teachman’s read-mono-mic-write-internal-flash.py I’ve used 2019-11 is no longer available, but you can find now an example writing to SD

Make it working on a PyCom device

First I installed Andreas’ FiPy firmware version with I2S support:
FiPy-1.20.1.r1-0.7.0-vanilla-dragonfly-onewire-i2s.tar.gz, use this or a newer version.

The original code uses an other SD card interface, according to SD I changed some lines to fit it for the FiPy.

And I changed the pins for the I2S mic to:

P11 - SCK
P22 - WS
P21 - SD 

This is the modified code

# The MIT License (MIT)
# Copyright (c) 2019 Michael Shi
# Copyright (c) 2020 Mike Teachman
# https://opensource.org/licenses/MIT

# Purpose:
# - read 32-bit audio samples from the left channel of an I2S microphone
# - snip upper 16-bits from each 32-bit microphone sample
# - write 16-bit samples to a SD card file using WAV format
#
# Recorded WAV file is named:
#   "mic_left_channel_16bits.wav"
#
# Hardware tested:
# - INMP441 microphone module
# - MSM261S4030H0 microphone module

import os
from machine import Pin
from machine import SD
from machine import I2S

#======= USER CONFIGURATION =======
RECORD_TIME_IN_SECONDS = 5
SAMPLE_RATE_IN_HZ = 22050
#======= USER CONFIGURATION =======

WAV_SAMPLE_SIZE_IN_BITS = 16
WAV_SAMPLE_SIZE_IN_BYTES = WAV_SAMPLE_SIZE_IN_BITS // 8
MIC_SAMPLE_BUFFER_SIZE_IN_BYTES = 4096
SDCARD_SAMPLE_BUFFER_SIZE_IN_BYTES = MIC_SAMPLE_BUFFER_SIZE_IN_BYTES // 2 # why divide by 2? only using 16-bits of 32-bit samples
NUM_SAMPLE_BYTES_TO_WRITE = RECORD_TIME_IN_SECONDS * SAMPLE_RATE_IN_HZ * WAV_SAMPLE_SIZE_IN_BYTES
NUM_SAMPLES_IN_DMA_BUFFER = 256
NUM_CHANNELS = 1

# snip_16_mono():  snip 16-bit samples from a 32-bit mono sample stream
# assumption: I2S configuration for mono microphone.  e.g. I2S channelformat = ONLY_LEFT or ONLY_RIGHT
# example snip:
#   samples_in[] =  [0x44, 0x55, 0xAB, 0x77, 0x99, 0xBB, 0x11, 0x22]
#   samples_out[] = [0xAB, 0x77, 0x11, 0x22]
#   notes:
#       samples_in[] arranged in little endian format:
#           0x77 is the most significant byte of the 32-bit sample
#           0x44 is the least significant byte of the 32-bit sample
#
# returns:  number of bytes snipped
def snip_16_mono(samples_in, samples_out):
    num_samples = len(samples_in) // 4
    for i in range(num_samples):
        samples_out[2*i] = samples_in[4*i + 2]
        samples_out[2*i + 1] = samples_in[4*i + 3]

    return num_samples * 2

def create_wav_header(sampleRate, bitsPerSample, num_channels, num_samples):
    datasize = num_samples * num_channels * bitsPerSample // 8
    o = bytes("RIFF",'ascii')                                                   # (4byte) Marks file as RIFF
    o += (datasize + 36).to_bytes(4,'little')                                   # (4byte) File size in bytes excluding this and RIFF marker
    o += bytes("WAVE",'ascii')                                                  # (4byte) File type
    o += bytes("fmt ",'ascii')                                                  # (4byte) Format Chunk Marker
    o += (16).to_bytes(4,'little')                                              # (4byte) Length of above format data
    o += (1).to_bytes(2,'little')                                               # (2byte) Format type (1 - PCM)
    o += (num_channels).to_bytes(2,'little')                                    # (2byte)
    o += (sampleRate).to_bytes(4,'little')                                      # (4byte)
    o += (sampleRate * num_channels * bitsPerSample // 8).to_bytes(4,'little')  # (4byte)
    o += (num_channels * bitsPerSample // 8).to_bytes(2,'little')               # (2byte)
    o += (bitsPerSample).to_bytes(2,'little')                                   # (2byte)
    o += bytes("data",'ascii')                                                  # (4byte) Data Chunk Marker
    o += (datasize).to_bytes(4,'little')                                        # (4byte) Data size in bytes
    return o

bck_pin = Pin('P11')
ws_pin = Pin('P22')
sdin_pin = Pin('P21')

audio_in = I2S(
    I2S.NUM0,
    bck=bck_pin, ws=ws_pin, sdin=sdin_pin,
    standard=I2S.PHILIPS,
    mode=I2S.MASTER_RX,
    dataformat=I2S.B32,
    channelformat=I2S.ONLY_LEFT,
    samplerate=SAMPLE_RATE_IN_HZ,
    dmacount=50,
    dmalen=NUM_SAMPLES_IN_DMA_BUFFER
)

# configure SD card
#   slot=2 configures SD card to use the SPI3 controller (VSPI), DMA channel = 2
#   slot=3 configures SD card to use the SPI2 controller (HSPI), DMA channel = 1
sd = SD()
os.mount(sd, "/sd")
wav = open('/sd/mic_left_channel_16bits.wav','wb')

# create header for WAV file and write to SD card
wav_header = create_wav_header(
    SAMPLE_RATE_IN_HZ,
    WAV_SAMPLE_SIZE_IN_BITS,
    NUM_CHANNELS,
    SAMPLE_RATE_IN_HZ * RECORD_TIME_IN_SECONDS
)
num_bytes_written = wav.write(wav_header)

# allocate sample arrays
#   memoryview used to reduce heap allocation in while loop
mic_samples = bytearray(MIC_SAMPLE_BUFFER_SIZE_IN_BYTES)
mic_samples_mv = memoryview(mic_samples)
wav_samples = bytearray(SDCARD_SAMPLE_BUFFER_SIZE_IN_BYTES)
wav_samples_mv = memoryview(wav_samples)

num_sample_bytes_written_to_wav = 0

print('Starting')
# read 32-bit samples from I2S microphone, snip upper 16-bits, write snipped samples to WAV file
while num_sample_bytes_written_to_wav < NUM_SAMPLE_BYTES_TO_WRITE:
    try:
        # try to read a block of samples from the I2S microphone
        # readinto() method returns 0 if no DMA buffer is full
        num_bytes_read_from_mic = audio_in.readinto(mic_samples_mv, timeout=0)
        if num_bytes_read_from_mic > 0:
            # snip upper 16-bits from each 32-bit microphone sample
            num_bytes_snipped = snip_16_mono(mic_samples_mv[:num_bytes_read_from_mic], wav_samples_mv)
            num_bytes_to_write = min(num_bytes_snipped, NUM_SAMPLE_BYTES_TO_WRITE - num_sample_bytes_written_to_wav)
            # write samples to WAV file
            num_bytes_written = wav.write(wav_samples_mv[:num_bytes_to_write])
            num_sample_bytes_written_to_wav += num_bytes_written
    except (KeyboardInterrupt, Exception) as e:
        print('caught exception {} {}'.format(type(e).__name__, e))
        break

wav.close()
os.umount("/sd")
sd.deinit()
audio_in.deinit()
print('Done')
print('%d sample bytes written to WAV file' % num_sample_bytes_written_to_wav)

and this a quite good recording:

I got not always such a comfortable quality and I have to investigate what the reasons are. One is: you have to keep a distance of 20 cm to get a nice recording, at least for speach.

After some more testing the audio quality is really good and stable. Perhaps a wiring problem before. You can also record sound direct in front of the I2S mic!

[edit] @cedric.cfk reported a bad audio quality, sounds similar to my first recordings. I tried to reproduce it by shaking the wires and connectors a bit and it seems to produce this metallic sound:

[edit2] Just FYI, it was actual a connection problem caused by bad cables (jumper wire) on @cedric.cfk’s hardware setup.

2 Likes

There is now an updated test / example code version for the first step – recording to SD card: bee-observer_bee-monitoring-micropython/mic-to-sd_adapted-fipy_2-advanced at master · ClemensGruber/bee-observer_bee-monitoring-micropython · GitHub

  • records x times / files from the I2S mic
  • with an adjustable length (seconds)
  • increment file naming
  • WiFi connection (in boot.py) to download files via FTP and play it on your computer
  • Wifi and recording indicator via RGB-LED

Wiring is

For the FiPy you have to use our home brewed firmware with I2S dirver, the official PyCom firmware has this driver not build in! Use at least version FiPy-1.20.1.r1-0.7.0-vanilla-dragonfly-onewire-i2s.tar.gz or better a newer release, see Dragonfly firmware for Pycom/ESP32

1 Like

After getting a good audio stream out of the INMP441 the next “natural” step would be using this stream for a FFT analysis. Due to performance reasons we should count on this:

The official DSP lib from espressif contains a FFT analysis. But this module is not in our firmware yet.

Can someone guide us a bit more detailed through the process of firmware building and including this module?

[edit] Is ulab, see Treiber- und Modulsammlung für MicroPython - #8 by Andreas an alternative? Performance?

1 Like

Yes :slight_smile:

ulab mpy forum

@pythoncoder would surely like to know if an FFT costs a king’s ransom. No, it doesn’t. In fact, a 1024-point float transform can be gotten in less than 2 ms on the pyboard.

1 Like

We are a bit in a dilemma! We have a PyCom firmware (from @Andreas) with an I2S dirver but without FFT support and wie have a firmware with FFT / ulab but without I2S, and we have the official DSP lib which is not integrated in any PyCom firmware yet.

I have asked rcolistete if he has a firmware version with ulab and I2S Pycom firmwares with single/double precision and ulab module | Pycom user forum I pointed him to the pull request from Andreas, hope this is sufficient for a check of feasibility. I feel not so comfortable with this direction becaus I think he has not integrated all the good and helpfull stuff, Andreas hast build in for stability in the last month.

So my favorite would be to integrate the DSP lib (and / or ulab) in Andreas’ firmware code. But as you may know: Busy by other things.

1 Like

@MKO hat sich das ganze mal angesehen und der Weg könnte sein:

Dragonfly mit ulab pimpen?

Source code zur Dragonfly firmware verwenden (nicht verwirren lassen, der branch heißt squirrel beinhaltet aber den latest and greates dragonfly Stand):

Im Endeffekt brauchen wir, so hoffe ich, nur noch diesen commit:

… und den code zum ulab-Modul hier:

Anleitungen dazu hat @MKO auch gefunden, um daraus wieder eine Firmware zu klöppeln. Wär auf alle Fälle einen Versuch wert.

I2S in die aktuelle firmware mit ulab integrieren?

Noch ein Nachtrag zur Idee das anders rum zu machen, die ulab-PyCom-Firmware mit I2S anzureichern:

ulab hat eine neuere Version als unsere home brewed dragonfly als Grundlage. Hier Pycom · master · Roberto Colistete Junior / MicroPython Firmwares · GitLab schreibt ulab 1.20.2.rc10, Andreas hat als Grundlage 1.20.2.rc6 verwendet. Uns bringt die neueste PyCom firmware aber nichts, wenn die Nachbesserungen von Andreas zu onewire, LTE, core panics … wie hier beschrieben nicht drinnen sind. :-( also bleibt nur der Weg oben.

1 Like

Habe jetzt mal versucht beide Zweige zu verbinden, was auch geklappt haben müsste, so hoffe ich.


Ich versuche jetzt mit WSL2 die firmware zu Compilen. Zum testen erstmal ohne das ulab Modul.

Allerdings habe ich ein paar Probleme.
Ich bin strikt nach der Anleitung der README.md vorgegangen.
musste allerdings trotzdem den IDF Hasch im Makefile anpassen.
Irgendwas stimmt aber anscheinend mit meinem WSL nicht.
auf xtensa-esp32-elf-gcc wird der Zugriff verweigert.


Ich bin leider kein Linux Experte und weiß nicht so recht weiter.
Jemand eine Idee?

1 Like

Hmm, liegt es am aktuellen code oder an der Maschinerie? Du versuchst testweise den den alten Stand von Andreas zu compilieren, ja? Dann dürfte es nicht am neuen code liegen, sondern an der Firmware-Maschine.

Liegt wohl nicht am Code wenn ich in der Bash direkt eingebe

xtensa-esp32-elf-gcc

eingebe passiert das gleiche

-bash: /home/user/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Permission denied 

Xtensa kann anscheinend nicht geöffnet werden

das einzige was mir noch einfallen würde ich habe die 32Bit version von Xtensa genommen, da die 64Bit Version wegen Fehlern nicht entpackt werden konnte. Weiß nicht ob Linux da empfindlich ist.

Dir fehlen die Rechte, um den gcc zu starten.
Mach mal folgendes:

cd /home/user/xtensa-esp32-elf
chmod -R a+rwx *

Das ist der Holzhammer, der Dir alle Rechte (lesen, schreiben, ausführen) an allen Dateien unterhalb des Verzeichnisses gibt.
Falls da auch Permission denied kommt, hast Du das vermutlich als root installiert. Dann musst Du root werden (‘su’ + passwort). Dann in demselben Verzeichnis ‘chown -R user *’. Danach gehören alle Dateien dem user ‘user’. Danach mit CTRL-d wieder von root zu user wechseln.

leider war ich etwas ungeduldig und habe mein wsl zurückgesetzt und nochmal komplett neu aufgesetzt.
er kompiliert jetzt auch. bricht dann aber ab. Es fehlt ihn nun anscheinend pyserial

1407640  223256   54756 1685652  19b894 build/WIPY/release/application.elf
Building partitions from lib/partitions_4MB.csv...
Building partitions from lib/partitions_8MB.csv...
IMAGE build/WIPY/release/wipy.bin
Pyserial is not installed for /usr/bin/python. Check the README for installation instructions.
Traceback (most recent call last):
  File "/home/user/pycom-esp-idf/components/esptool_py/esptool/esptool.py", line 37, in <module>
    import serial
ImportError: No module named serial
make: *** [application.mk:681: build/WIPY/release/wipy.bin] Error 1

Leider brauche ich für die instalation von pyserial pip.
Pip läßt sich aber nicht mehr installieren.
image

habe jetzt schon alles mögliche versucht

Hab es hinbekommen er compiled jetzt zumindest schon mal “sqirrel”
mit dem gebasteltem Branch gibt es aktuell leider noch probleme in der ftp/ftp.c
schau mir das gerade an.

1 Like

Woran lag es denn bei pip?

schöner Mist… die ftp.c ist im vergleich zur Dragonfly Firmware von Andreas unverändert geblieben da haben sich anscheinend die Rahmenbedingungen verändert. Die Unterschiede zur https://github.com/rcolistete/pycom-micropython-sigfox/tree/pycom_compatible_ulab kommen vonFix core panics@amotl
also genau das was wir eigentlich behalten wollen.
Jetzt heißt es fleißarbeit: suchen und finden

1 Like

Ging viel einfacher als gedacht,es war nur ein } verschollen.
erstmal für WiPy ohne Ulab Modul.

WiPy-1.20.2.rc10.tar.gz (1,1 MB)

Muß jetzt erstmal nachlesen wie ich das Modul einbaue und Compile dann nochmal.
EDIT:
WiPy-1.20.2.rc10_ulab.tar.gz (1,1 MB)
FiPy-1.20.2.rc10_ulab.tar.gz (1,2 MB)

user@Werkstatt:~/pycom-micropython/esp32$ make BOARD=FIPY USER_C_MODULES=/home/user/micropython-ulab CFLAGS_EXTRA=-ulab_ENABLED=1 all
Use make SECURE=on [optionally SECURE_KEY ?= secure_boot_signing_key.pem] to enable Secure Boot and Flash Encryption mechanisms.
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Including User C Module from /home/user/micropython-ulab/code
BASE Variant
IDF Version OK! c61fe64
mkdir -p build/FIPY/release/bootloader/
CC bootloader/bootloader.c
CC bootloader/bootmgr.c
CC bootloader/mperror.c
CC bootloader/gpio.c
AR build/FIPY/release/bootloader/bootloader.a
LINK xtensa-esp32-elf-gcc *** -nostdlib -Wl,-Map=build/FIPY/release/bootloader/bootloader.map -Wl,--no-check-sections -u call_user_start_cpu0 -Wl,-static -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections -T esp32.bootloader.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.bootloader.rom.ld -T esp32.rom.spiram_incompatible_fns.ld *** -Wl,--start-group -Lbootloader/lib -Lbootloader -Lbuild/FIPY/release/bootloader -L/home/user/pycom-esp-idf/components/esp32/ld -L/home/user/pycom-esp-idf/components/esp32/lib -llog -lcore -lbootloader_support -lspi_flash -lsoc -lmicro-ecc -lgcc -lstdc++ -lgcov -lefuse build/FIPY/release/bootloader/bootloader.a -Wl,--end-group -Wl,-EL -o build/FIPY/release/bootloader/bootloader.elf
   text    data     bss     dec     hex filename
  19822    2148      32   22002    55f2 build/FIPY/release/bootloader/bootloader.elf
IMAGE build/FIPY/release/bootloader/bootloader.bin
esptool.py v2.8
mkdir -p build/FIPY/release/genhdr
Create build/FIPY/release/genhdr/pins.h
GEN build/FIPY/release/genhdr/mpversion.h
GEN build/FIPY/release/genhdr/moduledefs.h
GEN build/FIPY/release/genhdr/qstr.i.last
GEN build/FIPY/release/genhdr/qstr.split
GEN build/FIPY/release/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/FIPY/release/genhdr/qstrdefs.generated.h
mkdir -p build/FIPY/release/build/FIPY/release/
mkdir -p build/FIPY/release/can/
mkdir -p build/FIPY/release/code/
mkdir -p build/FIPY/release/code/approx/
mkdir -p build/FIPY/release/code/compare/
mkdir -p build/FIPY/release/code/fft/
mkdir -p build/FIPY/release/code/filter/
mkdir -p build/FIPY/release/code/linalg/
mkdir -p build/FIPY/release/code/numerical/
mkdir -p build/FIPY/release/code/poly/
mkdir -p build/FIPY/release/code/user/
mkdir -p build/FIPY/release/code/vector/
mkdir -p build/FIPY/release/drivers/sx127x/sx1272/
mkdir -p build/FIPY/release/extmod/
mkdir -p build/FIPY/release/fatfs/src/drivers/
mkdir -p build/FIPY/release/ftp/
mkdir -p build/FIPY/release/hal/
mkdir -p build/FIPY/release/lib/embed/
mkdir -p build/FIPY/release/lib/libm/
mkdir -p build/FIPY/release/lib/lora/mac/
mkdir -p build/FIPY/release/lib/lora/mac/region/
mkdir -p build/FIPY/release/lib/lora/system/
mkdir -p build/FIPY/release/lib/lora/system/crypto/
mkdir -p build/FIPY/release/lib/mp-readline/
mkdir -p build/FIPY/release/lib/netutils/
mkdir -p build/FIPY/release/lib/oofatfs/
mkdir -p build/FIPY/release/lib/timeutils/
mkdir -p build/FIPY/release/lib/utils/
mkdir -p build/FIPY/release/littlefs/
mkdir -p build/FIPY/release/lora/
mkdir -p build/FIPY/release/lte/
mkdir -p build/FIPY/release/mods/
mkdir -p build/FIPY/release/ports/stm32/
mkdir -p build/FIPY/release/py/
mkdir -p build/FIPY/release/telnet/
mkdir -p build/FIPY/release/util/
CC ../py/mpstate.c
CC ../py/nlr.c
CC ../py/nlrx86.c
CC ../py/nlrx64.c
CC ../py/nlrthumb.c
CC ../py/nlrxtensa.c
CC ../py/nlrsetjmp.c
CC ../py/malloc.c
CC ../py/gc.c
CC ../py/pystack.c
CC ../py/qstr.c
CC ../py/vstr.c
CC ../py/mpprint.c
CC ../py/unicode.c
CC ../py/mpz.c
CC ../py/reader.c
CC ../py/lexer.c
CC ../py/parse.c
CC ../py/scope.c
CC ../py/compile.c
CC ../py/emitcommon.c
CC ../py/emitbc.c
CC ../py/asmbase.c
CC ../py/asmx64.c
CC ../py/emitnx64.c
CC ../py/asmx86.c
CC ../py/emitnx86.c
CC ../py/asmthumb.c
CC ../py/emitnthumb.c
CC ../py/emitinlinethumb.c
CC ../py/asmarm.c
CC ../py/emitnarm.c
CC ../py/asmxtensa.c
CC ../py/emitnxtensa.c
CC ../py/emitinlinextensa.c
CC ../py/formatfloat.c
CC ../py/parsenumbase.c
CC ../py/parsenum.c
CC ../py/emitglue.c
CC ../py/persistentcode.c
CC ../py/runtime.c
CC ../py/runtime_utils.c
CC ../py/scheduler.c
CC ../py/nativeglue.c
CC ../py/stackctrl.c
CC ../py/argcheck.c
CC ../py/warning.c
CC ../py/map.c
CC ../py/obj.c
CC ../py/objarray.c
CC ../py/objattrtuple.c
CC ../py/objbool.c
CC ../py/objboundmeth.c
CC ../py/objcell.c
CC ../py/objclosure.c
CC ../py/objcomplex.c
CC ../py/objdeque.c
CC ../py/objdict.c
CC ../py/objenumerate.c
CC ../py/objexcept.c
CC ../py/objfilter.c
CC ../py/objfloat.c
CC ../py/objfun.c
CC ../py/objgenerator.c
CC ../py/objgetitemiter.c
CC ../py/objint.c
CC ../py/objint_longlong.c
CC ../py/objint_mpz.c
CC ../py/objlist.c
CC ../py/objmap.c
CC ../py/objmodule.c
CC ../py/objobject.c
CC ../py/objpolyiter.c
CC ../py/objproperty.c
CC ../py/objnone.c
CC ../py/objnamedtuple.c
CC ../py/objrange.c
CC ../py/objreversed.c
CC ../py/objset.c
CC ../py/objsingleton.c
CC ../py/objslice.c
CC ../py/objstr.c
CC ../py/objstrunicode.c
CC ../py/objstringio.c
CC ../py/objtuple.c
CC ../py/objtype.c
CC ../py/objzip.c
CC ../py/opmethods.c
CC ../py/sequence.c
CC ../py/stream.c
CC ../py/binary.c
CC ../py/builtinimport.c
CC ../py/builtinevex.c
CC ../py/builtinhelp.c
CC ../py/modarray.c
CC ../py/modbuiltins.c
CC ../py/modcollections.c
CC ../py/modgc.c
CC ../py/modio.c
CC ../py/modmath.c
CC ../py/modcmath.c
CC ../py/modmicropython.c
CC ../py/modstruct.c
CC ../py/modsys.c
CC ../py/moduerrno.c
CC ../py/modthread.c
CC ../py/vm.c
CC ../py/bc.c
CC ../py/showbc.c
CC ../py/repl.c
CC ../py/smallint.c
CC ../py/frozenmod.c
CC ../extmod/moductypes.c
CC ../extmod/modujson.c
CC ../extmod/modure.c
CC ../extmod/moduzlib.c
CC ../extmod/moduheapq.c
CC ../extmod/modutimeq.c
CC ../extmod/moduhashlib.c
CC ../extmod/moducryptolib.c
CC ../extmod/modubinascii.c
CC ../extmod/virtpin.c
CC ../extmod/machine_mem.c
CC ../extmod/machine_pinbase.c
CC ../extmod/machine_signal.c
CC ../extmod/machine_pulse.c
CC ../extmod/machine_i2c.c
CC ../extmod/machine_spi.c
CC ../extmod/modussl_axtls.c
CC ../extmod/modussl_mbedtls.c
CC ../extmod/modurandom.c
CC ../extmod/moduselect.c
CC ../extmod/moduwebsocket.c
CC ../extmod/modwebrepl.c
CC ../extmod/modframebuf.c
CC ../extmod/modonewire.c
CC ../extmod/vfs.c
CC ../extmod/vfs_reader.c
CC ../extmod/vfs_posix.c
CC ../extmod/vfs_posix_file.c
CC ../extmod/vfs_fat.c
CC ../extmod/vfs_fat_diskio.c
CC ../extmod/vfs_fat_file.c
CC ../extmod/utime_mphal.c
CC ../extmod/uos_dupterm.c
CC ../lib/embed/abort_.c
CC ../lib/utils/printf.c
MPY frozen/Base/_boot.py
MPY frozen/Base/_main.py
MPY frozen/LTE/sqnsbrz.py
MPY frozen/LTE/sqnscodec.py
MPY frozen/LTE/sqnscrc.py
MPY frozen/LTE/sqnstp.py
MPY frozen/LTE/sqnsupgrade.py
GEN build/FIPY/release/frozen_mpy.c
CC build/FIPY/release/frozen_mpy.c
CC lora/utilities.c
CC lora/timer-board.c
CC lora/gpio-board.c
CC lora/spi-board.c
CC lora/sx1276-board.c
CC lora/sx1272-board.c
CC lora/board.c
CC ../lib/lora/mac/LoRaMac.c
CC ../lib/lora/mac/LoRaMacCrypto.c
CC ../lib/lora/mac/region/Region.c
CC ../lib/lora/mac/region/RegionAS923.c
CC ../lib/lora/mac/region/RegionAU915.c
CC ../lib/lora/mac/region/RegionCommon.c
CC ../lib/lora/mac/region/RegionEU868.c
CC ../lib/lora/mac/region/RegionUS915.c
CC ../lib/lora/mac/region/RegionCN470.c
CC ../lib/lora/mac/region/RegionEU433.c
CC ../lib/lora/mac/region/RegionIN865.c
CC ../lib/lora/system/delay.c
CC ../lib/lora/system/gpio.c
CC ../lib/lora/system/timer.c
CC ../lib/lora/system/crypto/aes.c
CC ../lib/lora/system/crypto/cmac.c
CC ../drivers/sx127x/sx1272/sx1272.c
CC mods/modlora.c
CC mods/modsigfox_api.c
CC lte/lteppp.c
CC mods/modlte.c
CC main.c
CC mptask.c
CC serverstask.c
CC fatfs_port.c
CC pycom_config.c
CC mpthreadport.c
CC hal/esp32_mphal.c
CC ../lib/libm/math.c
CC ../lib/libm/fmodf.c
CC ../lib/libm/roundf.c
CC ../lib/libm/ef_sqrt.c
CC ../lib/libm/kf_rem_pio2.c
CC ../lib/libm/kf_sin.c
CC ../lib/libm/kf_cos.c
CC ../lib/libm/kf_tan.c
CC ../lib/libm/ef_rem_pio2.c
CC ../lib/libm/sf_sin.c
CC ../lib/libm/sf_cos.c
CC ../lib/libm/sf_tan.c
CC ../lib/libm/sf_frexp.c
CC ../lib/libm/sf_modf.c
CC ../lib/libm/sf_ldexp.c
CC ../lib/libm/asinfacosf.c
CC ../lib/libm/atanf.c
CC ../lib/libm/atan2f.c
CC ../lib/mp-readline/readline.c
CC ../lib/netutils/netutils.c
CC ../lib/utils/pyexec.c
CC ../lib/utils/interrupt_char.c
CC ../lib/utils/sys_stdio_mphal.c
CC ../lib/oofatfs/ff.c
CC ../lib/oofatfs/ffunicode.c
CC ../lib/timeutils/timeutils.c
CC mods/machuart.c
CC mods/machpin.c
CC mods/machrtc.c
CC mods/pybflash.c
CC mods/machspi.c
CC mods/machine_i2c.c
CC mods/machine_i2s.c
CC mods/machpwm.c
CC mods/machcan.c
CC mods/modmachine.c
CC mods/moduos.c
CC mods/modusocket.c
CC mods/modnetwork.c
CC mods/network_ppp.c
CC mods/modwlan.c
CC mods/modutime.c
CC mods/modpycom.c
CC mods/moduqueue.c
CC mods/moduhashlib.c
CC mods/moducrypto.c
CC mods/machtimer.c
CC mods/machtimer_alarm.c
CC mods/machtimer_chrono.c
CC mods/analog.c
CC mods/pybadc.c
CC mods/pybdac.c
CC mods/pybsd.c
CC mods/modussl.c
CC mods/modbt.c
CC mods/modled.c
CC mods/machwdt.c
CC mods/machrmt.c
CC mods/lwipsocket.c
CC mods/machtouch.c
CC mods/modcoap.c
CC mods/modmdns.c
CC ../ports/stm32/bufhelper.c
CC /home/user/micropython-ulab/code/ndarray.c
CC /home/user/micropython-ulab/code/ulab_create.c
CC /home/user/micropython-ulab/code/linalg/linalg.c
CC /home/user/micropython-ulab/code/vector/vectorise.c
CC /home/user/micropython-ulab/code/poly/poly.c
CC /home/user/micropython-ulab/code/fft/fft.c
CC /home/user/micropython-ulab/code/numerical/numerical.c
CC /home/user/micropython-ulab/code/filter/filter.c
CC /home/user/micropython-ulab/code/compare/compare.c
CC /home/user/micropython-ulab/code/approx/approx.c
CC /home/user/micropython-ulab/code/user/user.c
CC /home/user/micropython-ulab/code/ulab.c
CC fatfs/src/drivers/sflash_diskio.c
CC fatfs/src/drivers/sd_diskio.c
CC littlefs/lfs.c
CC littlefs/lfs_util.c
CC littlefs/vfs_littlefs.c
CC littlefs/vfs_littlefs_file.c
CC littlefs/sflash_diskio_littlefs.c
CC util/antenna.c
CC util/gccollect.c
CC util/help.c
CC util/mperror.c
CC util/random.c
CC util/mpexception.c
CC util/fifo.c
CC util/socketfifo.c
CC util/mpirq.c
CC util/mpsleep.c
CC util/timeutils.c
CC util/esp32chipinfo.c
CC util/pycom_general_util.c
CC util/str_utils.c
CC telnet/telnet.c
CC ftp/ftp.c
CC ftp/updater.c
CC can/CAN.c
CC build/FIPY/release/pins.c
AR build/FIPY/release/application.a
CPP build/FIPY/release/esp32_out.ld
LINK build/FIPY/release/application.elf
xtensa-esp32-elf-size build/FIPY/release/application.elf
   text    data     bss     dec     hex filename
1557572  329888   68844 1956304  1dd9d0 build/FIPY/release/application.elf
Building partitions from lib/partitions_4MB.csv...
Building partitions from lib/partitions_8MB.csv...
IMAGE build/FIPY/release/fipy.bin
esptool.py v2.8
user@Werkstatt:~/pycom-micropython/esp32$ make BOARD=FIPY release
Use make SECURE=on [optionally SECURE_KEY ?= secure_boot_signing_key.pem] to enable Secure Boot and Flash Encryption mechanisms.
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
BASE Variant
IDF Version OK! c61fe64
checking size of image
1909664 bytes => Size OK
Creating release package in /home/user/pycom-micropython/esp32/build
Release package FiPy-1.20.2.rc10.tar.gz created successfully.
user@Werkstatt:~/pycom-micropython/esp32$ 

bin jetzt nur noch nicht sicher ob pycom pybytes drin ist oder wie bei @Andreas Firmware raus ist.

@clemens fehlt noch ein freiwilliger Tester und ein Name :wink:

Anleitung und Beispielcodes fürs Ulab Modul gibt es hier:
https://micropython-ulab.readthedocs.io/en/latest/
das I2S mit Pycom grundsätzlich funktioniert hat Clemens ja hier in Thread ja schon gezeigt.

Upload klappt auch.
image

und der Terkin-firmware läst sich auch aufspielen weiter schaffe ich es aktuell nicht zu testen. Verbindungen und Sensoren sind nicht überprüft.

In der Repl läßt sich ulab und I2S auch schon mal importieren.

2 Likes