Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Amedee
    • Continue chat with Amedee
    • Start new chat with Amedee
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Amedee

    @Amedee

    4
    Reputation
    6
    Posts
    183
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Amedee Follow

    Posts made by Amedee

    • M5Unit-ENV library for PlatformIO is not up-to-date

      FYI, I discovered that the M5Unit-ENV library for PlatformIO is missing at least 1 commit compared to the one for the Arduino IDE, which is strange as they both advertise the same version: 0.0.8

      I suspect that 0.0.8 has been re-issued as the release date on GitHub is from 2 weeks ago, an PlatformIO m5stack/M5Unit-ENV says: "Last Modified: a month ago"...

      In the meantime, if you need the latest version, you can use the GitHub URL instead of the name in your lib_deps

      posted in Arduino
      Amedee
    • RE: [CoreS3] I2C doesn't work...

      @felmue That was the problem

      Thank you very much!

      posted in Arduino
      Amedee
    • [CoreS3] I2C doesn't work...

      Hi!

      I can't get I2C working properly with my CoreS3...

      Environment:

      • CoreS3
      • ENV-III sensor on Port A or Port B (no difference)
      • Arduino IDE 2.2.1 with M5CoreS3 0.0.4
      • Same with PlatformIO Core 6.1.11 with M5CoreS3 0.0.4

      The issue is really weird:

      1. Connect a sensor on Port A or B
      2. Flash the "CoreS3 UserDemo" with M5Burner. Sensor can be seen in the I2C menu
      3. Flash a program using I2C (E.g. the I2C_Tester.ino from the sample folder)
      4. So far so good, it all works, we can get data from the SHT30 and the QMP6988 without any issue. Works on Port A and Port B.
      5. Power off the device completely (Battery off, USB cable disconnected), the re-connect.
      6. I2C doesn't work anymore (behavior is slightly different with the port: Port A times out and Port B just doesn't see any sensor, but none work)
      7. The only way to get I2C back is to re-flash "CoreS3 UserDemo"

      I2C does work as expected with UiFlow, so I assume the CoreS3 and the ENV-III aren't faulty.
      I would think that I2C isn't properly initialized at startup...

      The PIO console sometimes shows memory allocation error during startup (before setup() is invoked)

      0:40:11.059 > ESP-ROM:esp32s3-20210327
      20:40:11.059 > Build:Mar 27 2021
      20:40:11.060 > rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
      20:40:11.060 > Saved PC:0x40377900
      20:40:11.062 > SPIWP:0xee
      20:40:11.062 > mode:DIO, clock div:1
      20:40:11.064 > load:0x3fce3808,len:0x44c
      20:40:11.066 > load:0x403c9700,len:0xbe4
      20:40:11.068 > load:0x403cc700,len:0x2a68
      20:40:11.090 > entry 0x403c98d4
      20:40:11.245 > [   186][E][Wire.cpp:152] allocateWireBuffer(): Can't allocate memory for I2C_0 rxBuffer
      20:40:11.247 > [   187][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=2 scl=1 freq=100000
      20:40:12.143 > [  1084][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
      20:40:12.160 > Initialize M5
      20:40:13.660 > M5CoreS3 initializing...OK
      
      posted in Arduino
      Amedee
    • RE: ENV III Causes CoreS3 to restart.

      If you are desperate to get it running, I have forked the micropython-m5stamp-c3u library and removed the QMP6988 reset().

      Unfortunately I have not found a way to override the built-in libraries, so it needs some code blocks in UiFlow...

      First install the libraries:

      import mip
      mip.install("https://raw.githubusercontent.com/AmedeeBulle/micropython-m5stamp-c3u/main/lib/sht30.py", target="/flash/libs")
      mip.install("https://raw.githubusercontent.com/AmedeeBulle/micropython-m5stamp-c3u/main/lib/checksum.py", target="/flash/libs")
      mip.install("https://raw.githubusercontent.com/AmedeeBulle/micropython-m5stamp-c3u/main/lib/qmp6988.py", target="/flash/libs")
      

      Once done you can query both sensors -- e.g:

      0_1695141051212_Screenshot 2023-09-19 at 18.24.06.png

      There are basically 3 code blocks:

      Import libraries:

      import sht30
      import qmp6988
      

      Initialize sensors:

      sht = sht30.SHT30(i2c0)
      qmp = qmp6988.QMP6988(i2c0)
      

      Get data:

      temperature, pressure = qmp.measure()
      pressure = pressure / 100
      temperature2, humidity = sht.measure()
      

      Note that in the above example, my ENV-III is plugged in the Port B, if you use Port A, adjust SCL/SDA accordingly!

      posted in General
      Amedee
    • RE: ENV III Causes CoreS3 to restart.

      @mtylerjr I am not so sure about that...

      Even with that change, the module will reset at this line...

      What works for me is to bypass the reset(), after that I get correct temperature/pressure; but once you reset, the next readfrom_mem() will reset the MCU

      posted in General
      Amedee
    • RE: ENV III Causes CoreS3 to restart.

      Anybody got this working?

      I am facing the same issue.

      I tried to use Port B instead or port A, but the behavior is exactly the same: the device reboots when init is invoked...

      posted in General
      Amedee