🤖Have you ever tried Chat.M5Stack.com before asking??😎

Subcategories

  • 551 Topics
    2k Posts
    H
    @Danieldsouza I prefer to use KiCAD for schematic and PCB design. The software is open source It runs on Windows, Linux, Mac there is a strong community there is a ton of libraries for thousands of components some part distributor and assembling factories provide their own library or allow symbol and footprint download making your own symbols and footprints is very easy design rule checking I am not an advanced user but managed to make a 4-layer PCB after watching a few tutorial videos. Independend of the EDA Tool make sure you avoid the common tripping hazard like missing blocking caps or unwanted ground loops.
  • When you meet problems using M5Stack, we help you solve it.

    201 Topics
    990 Posts
    S
    不小心下载了一个imu什么的……咔咔一顿后……我关了重新开……,但还是不会动,只会左右动,然后跳舞的话只会亮灯,不会动,只能左右转动……
  • 505 Topics
    2k Posts
    D
    Hopefully I can shed a little light on this topic. The AIN4-20mA unit uses a STM32 processor to handle the I2C interface in software. For some reason, the timing is not wholly compatible with the Raspberry Pi kernel I2C drivers. However, the Espressif I2C implementation is a lot more tolerant and flexible and works just fine. That's why it works with the M5 controllers. There was a an update to the github repo for this unit's firmware (https://github.com/m5stack/M5Module-4-20mA-Internal-FW) which changed the I2C library that was used. It's possible that this will fix it, but I haven't bothered to set up a STM32 development system to try it. If you really want to use a Pi or other Linux host board, you could use any inexpensive ESP device (like an M5Stamp) as a go-between. Another option is to use something like the Arduino UNO Q, which runs Linux on the main processor and allows you to run C++ code on the STM32 microcontroller to talk to I2C devices. It's really better to run real-time control on a separate microcontroller anyway.
  • 1k Topics
    6k Posts
    Y
    Root Cause Analysis A detailed schematic review revealed the source of the problem. All three components — Core2, Audio Module, and Bottom2 — are interconnected through the shared M5 BUS. The Bottom2 module includes a SPM1423 MEMS microphone, which uses: GPIO0 (BUS pin 24) for the clock signal (CLK) GPIO34 (BUS pin 26) for the data signal (DAT, digital output) The Audio Module, based on the ES8388 codec, uses: GPIO0 (BUS pin 24) for I2S_MCLK GPIO34 (BUS pin 26) for I2S_MAIN_DIN This creates a fundamental hardware conflict on the I2S bus. The Core Conflict Two independent devices attempt to drive the same data line: The ES8388 (M144 Audio Module) uses GPIO34 to send digitized audio data from its ADC (line-in or microphone) to the ESP32 via I2S. The SPM1423 (Bottom2) uses the same GPIO34 to output PDM audio data from its internal MEMS microphone. From the ESP32’s perspective: GPIO34 is input-only However, on the physical PCB traces, both devices are electrically connected to this same line and actively drive it. This results in a classic and severe bus contention scenario: Two outputs connected together No arbitration No isolation No possibility for coexistence Why This Cannot Be Solved in Software At first glance, one might consider disabling the microphone via software. Unfortunately, this is not feasible due to both architectural and hardware constraints. The Bottom2 doesn’t expose the SPM1423 MEMS dedicated enable/disable (chip select) pin. The only way to silence it — effectively forcing its data output into a high-impedance (Hi-Z) state — is to stop its clock signal on GPIO0. This leads directly to a deadlock: If the M144 switch is set to position A: GPIO0 is used as MCLK (mandatory master clock for ES8388 operation, typically 12.288 MHz) If the switch is set to position B: GPIO0 becomes I2S SCLK (bit clock) Additionally: The internal amplifier of the Core2 (NS4168) also uses GPIO0 for BCLK In other words, GPIO0 is always actively used in any valid configuration. Stopping the clock to disable the microphone would simultaneously break: the ES8388 codec or the Core2 internal audio path Thus, there is no viable way to control the microphone via software without disrupting essential system functionality. Design Oversight The A/B switch on the M144 Audio Module was clearly designed to avoid clock conflicts (MCLK vs SCLK) with other peripherals. However, the design completely overlooks the data line conflict on GPIO34. This is particularly problematic because: the Bottom2 module is an official M5Stack accessory the SPM1423 microphone is always active by default both modules are intended to be used within the same ecosystem Despite this, their coexistence leads to a non-functional configuration when using the ES8388 input path. Conclusion This issue is not a matter of configuration, firmware, or library incompatibility. It is a fundamental hardware design conflict on the shared M5 BUS. When Bottom2 is attached: the SPM1423 microphone continuously drives the I2S data line the ES8388 is unable to deliver valid audio data the result is severe noise and corrupted signal There is no reliable software workaround. The only effective solutions are hardware-level: physically removing or isolating the SPM1423 microphone redesigning the Bottom2 PCB to include a switch or gating mechanism routing the microphone control (e.g., SELECT or enable logic) to a dedicated GPIO Until such changes are implemented, the ES8388 input functionality cannot be used in conjunction with the Bottom2 module in a stable and predictable way. My solution was to remove the SPM1423 Microphone from the PCB. Another solution is to cut the relevant pins from the Bottom2 BUS with the same effect - removing SPM1423 from the circuit.
  • 55 Topics
    203 Posts
    J
    I have been able to get a program to work that uses the M5EchoBase library but no luck using the unified library. For example the simple program below doesn't work. #include <M5Unified.h> void setup() { // 1. Initialize M5Unified delay(1000); // Delay for a moment to allow the system to stabilize. auto cfg = M5.config(); cfg.serial_baudrate = 115200; M5.begin(cfg); // 2. Configure the Speaker for the Atomic Audio Base (ES8311) // We access the speaker configuration directly via M5.Speaker.config() auto spk_cfg = M5.Speaker.config(); // Set pins for Atomic Audio Base (ES8311) spk_cfg.pin_bck = 8; // BCLK spk_cfg.pin_ws = 6; // LRCK (WS) spk_cfg.pin_data_out = 5; // DAC (DOUT) spk_cfg.i2s_port = I2S_NUM_0; // Configure for external codec (not internal DAC) spk_cfg.use_dac = false; spk_cfg.sample_rate = 44100; // Apply the configuration M5.Speaker.config(spk_cfg); // 3. Start the speaker M5.Speaker.begin(); // 4. Set volume (0-255) M5.Speaker.setVolume(128); } void loop() { M5.update(); // Play a 1000 Hz tone for 1000 milliseconds (1 second) M5.Speaker.tone(1000, 1000); // Wait for the tone to finish delay(1000); // Small delay before next loop delay(1000); } Is there no way to set up the ES8311 codec without using M5EchoBase? strangely if I run the program below then load the above program the tone works? But I can't stick the M5.Speaker.tone(1000, 1000); command in the program below and have it work. Does anyone know how to play a tone using only the Unified library from an AtomS3R into a Atomic Audio Base (ES8311 codec)? #include <M5Unified.h> #include <M5EchoBase.h> #if defined(CONFIG_IDF_TARGET_ESP32S3) #define RECORD_SIZE (1024 * 400) #elif defined(CONFIG_IDF_TARGET_ESP32) #define RECORD_SIZE (1024 * 400) #endif #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)) M5EchoBase echobase; #else M5EchoBase echobase(I2S_NUM_0); #endif static uint8_t *buffer = nullptr; // Pointer to hold the audio buffer. void setup() { delay(1000); // Delay for a moment to allow the system to stabilize. auto cfg = M5.config(); cfg.serial_baudrate = 115200; M5.begin(cfg); // Initialize the EchoBase with ATOMS3 pinmap. #if defined(CONFIG_IDF_TARGET_ESP32S3) if (!echobase.init(44100 /*Sample Rate*/, 38 /*I2C SDA*/, 39 /*I2C SCL*/, 7 /*I2S DIN*/, 6 /*I2S WS*/, 5 /*I2S DOUT*/, 8 /*I2S BCK*/, Wire) != 0) { Serial.println("Failed to initialize EchoBase!"); while (true) { delay(1000); } } #elif defined(CONFIG_IDF_TARGET_ESP32) // Initialize the EchoBase with ATOM pinmap. if (!echobase.init(44100 /*Sample Rate*/, 25 /*I2C SDA*/, 21 /*I2C SCL*/, 23 /*I2S DIN*/, 19 /*I2S WS*/, 22 /*I2S DOUT*/, 33 /*I2S BCK*/, Wire) != 0) { Serial.println("Failed to initialize EchoBase!"); while (true) { delay(1000); } } #endif echobase.setSpeakerVolume(80); // Set speaker volume to 70%. echobase.setMicGain(ES8311_MIC_GAIN_0DB); // Set microphone gain to 0dB. buffer = (uint8_t *)malloc(RECORD_SIZE); // Allocate memory for the record buffer. // Check if memory allocation was successful. if (buffer == nullptr) { // If memory allocation fails, enter an infinite loop. while (true) { Serial.println("Failed to allocate memory :("); delay(1000); } } Serial.println("EchoBase ready, start recording and playing!"); // M5.Speaker.tone(2000, 2000); // delay(2000); } void loop() { Serial.println("Start recording..."); // Recording echobase.setMute(false); echobase.record(buffer, RECORD_SIZE); // Record audio into buffer. delay(100); Serial.println("Start playing..."); // Playing echobase.setMute(false); delay(10); echobase.play(buffer, RECORD_SIZE); // Play audio from buffer. //M5.Speaker.playRaw(buffer, RECORD_SIZE, 44100, false, 1, 0); delay(100); }
  • For topics on the M5Stack Atom.

    260 Topics
    849 Posts
    K
    After a lot of testing and searching it became apparent that the M5Atom controller did not work properly (never had this type of problem before). This, outdated software and some wrong suggestions by both ChatGPT and the AI bot from M5Stack (with the knowledge base available) made it a bit of struggle. However, after all updates and testing different hardware it finally works again. So thanks to anyone that spent time on this!
  • PaperS3 Bluetooth?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • M5 stack paper stop storing data in preferences?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • LLM SKU: M140 Discontinued and now what

    2
    0 Votes
    2 Posts
    2k Views
    ajb2k3A
    @mumin50 They are releasing it as part of an upgrade kit with an adapter board that should be out next Friday. https://docs.m5stack.com/en/module/Module LLM Kit
  • AirQ VOC measurements

    3
    0 Votes
    3 Posts
    2k Views
    I
    @rictim thanks for pointing this out. I already guessed that fan isn't functioning in battery mode and thought of using the connector. But it looks like I need to hook them up to a USB battery pack for VOC. Assuming the sensors work also better when the fan works.
  • SPI on M5dial but i cannot use I2C port

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to disable M5stack fire power saving

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Need advice for a Camera.

    2
    0 Votes
    2 Posts
    1k Views
    kurikoK
    @QuiqueMartinez We don't have any camera model with night vision
  • DLight keeps giving max value

    1
    1 Votes
    1 Posts
    996 Views
    No one has replied
  • Controller that can be powered with 5v through GROVE

    5
    0 Votes
    5 Posts
    3k Views
    A
    @felmue Thank you! I learned something today by downloading the PDF's and applying what you explained :)
  • Cardputer keeps restarting.

    9
    0 Votes
    9 Posts
    5k Views
    robskiR
    @anubisdarkwatch said in Cardputer keeps restarting.: @robski So with another firmware it was showing as having 98% charge, I just loaded UIFlow2 and it showed as 22%. Weird. So I have it charging now, hopefully that is the issue. think it charges battery when connected and ON/OFF switch in ON position
  • 0 Votes
    5 Posts
    3k Views
    O
    @felmue You're absolutely right about VBUS. When I flashed the example firmware from the Arduino IDE, the power supply worked normally. However, the factory firmware did not. How the hell is it possible that such a thing isn't described anywhere in the documentation? Thank you, you really helped me a lot.
  • cfg.clear_display=false has no effect on PaperS3?

    3
    0 Votes
    3 Posts
    2k Views
    felmueF
    Hello @wsanders this issue has been fixed in recent M5Unified and M5GFX libraries - see here. Make sure you are using the latest versions of these two libraries. BTW: I am using this feature in my non flickering RTC clock example - see here. Thanks Felix
  • Sending MIDI Signal via USB on M5Dial – Need Help!

    2
    0 Votes
    2 Posts
    2k Views
    H
    Unfortunately you did not post your code so no one knows how you try to send the midi messages. Check first: does the device apear as USB-MIDI-Class in your computers device manager? Probably it is shown as a USB-Serial-Class device (which MIDI indeed is) but your MIDI application (seems to be a top secret application as you don't wrote which one) expect a MIDI-Class device. Maybe this helps: https://github.com/esp32beans/ESP32USBMIDI
  • Sim800l

    13
    0 Votes
    13 Posts
    40k Views
    felmueF
    Hello @cepics try changing the line to: Serial2.printf("AT+CSTT=\"%s\",\"%s\",\"%s\"\r\n", apn, user, pass); Thanks Felix
  • M5Paper loosing power completely

    5
    0 Votes
    5 Posts
    2k Views
    Z
    Looks like it has to do something with the bootloader. I previously flashed the full factory-firmware which comes out of ESHome(platformio) build, but if I just flash the firmware to 0x10000, then it boots up all the time from battery as well. Needs more digging what could go wrong with platformio bootloader.
  • CoreS3 adding a External Speaker? or use bluetooth?

    1
    0 Votes
    1 Posts
    998 Views
    No one has replied
  • U111-B NB IoT Module

    1
    0 Votes
    1 Posts
    832 Views
    No one has replied
  • AtomS3R Ext proto

    1
    0 Votes
    1 Posts
    786 Views
    No one has replied
  • M5Stack Core S3 Access to SDCARD Micropython

    2
    0 Votes
    2 Posts
    2k Views
    L
    @LordInchcape Using M5CoreS3_SDCard_read_dir_UIFlow2.0.4 the following micropython will work:- *import machine import os card = machine.SDCard(slot=2, sck=36, miso=35, mosi=37, cs=4, freq=1000000) os.mount(card,"/sd") print(os.listdir("/sd")) f = open("/sd/test.txt", "w") f.write("Hello world\r\n") f.close() g = open("/sd/test.txt", "r") print(g.read()) g.close() os.unlink("/sd/test.txt")** Still to determine if it treads on something else.
  • How to connect SIM7020G to the network?

    8
    0 Votes
    8 Posts
    9k Views
    felmueF
    Hello @silentrain23 I think you probably just need to wait a bit longer for it to register. From the AT Command document (link here) the 2 in the AT+CREG 0,2 response means: Not registered, but MT is currently searching a new operator to register to Thanks Felix