ULP I2C sensor readings.
Posted: Fri Feb 04, 2022 2:14 am
Greetings!
Thanks for the great micropython, v1.18 is awesome for speed
I am trying to understand how to manage the obscure ULP code,
I found https://github.com/ThomasWaldmann/py-esp32-ulp, Thanks to Thomas, I've done a few things with that.
It has some limitations(exclude .macro etc), but almost part, It doesn't matter to work with,
and I found it "I2C_WR/RD" instructions available, so I am trying to communicate with I2C sensors.
From Espressif instruction set(https://docs.espressif.com/projects/esp ... n_set.html),
it says Slave address (in 7-bit format) has to be set in advance into SENS_I2C_SLAVE_ADDRx register field
I've tried to set SENS_I2C_SLAVE_ADDR0 within py-esp32-ulp,
I could not move forward from this,
so I've tried to follow the espressif's "Compiling the ULP Code" instruction,
I though it could be loaded into micropython.
But It generates a whole bunch of firmware file include ulp binary.
Could you help me to go further?
Using ThomasWaldmann/py-esp32-ulp will be the best way for me,
But the any way could be okay to get assembly bin files to load into micropython.
Thanks in advance,
Regards
Sam Lee
Thanks for the great micropython, v1.18 is awesome for speed

I am trying to understand how to manage the obscure ULP code,
I found https://github.com/ThomasWaldmann/py-esp32-ulp, Thanks to Thomas, I've done a few things with that.
It has some limitations(exclude .macro etc), but almost part, It doesn't matter to work with,
and I found it "I2C_WR/RD" instructions available, so I am trying to communicate with I2C sensors.
From Espressif instruction set(https://docs.espressif.com/projects/esp ... n_set.html),
it says Slave address (in 7-bit format) has to be set in advance into SENS_I2C_SLAVE_ADDRx register field
Code: Select all
I2C_RD 0x10, 7, 0, 0
// Read byte from sub-address 0x10 of slave with address set in SENS_I2C_SLAVE_ADDR0
Code: Select all
#define SENS_I2C_SLAVE_ADDR0 0x000007FF // Found in soc/sens_reg.h
#define RTC_I2C_SLAVE_ADDR_S 0 // Found in soc/rtc_i2c_reg.h
WRITE_RTC_REG(SENS_I2C_SLAVE_ADDR0,RTC_I2C_SLAVE_ADDR_S,8,0x68)
ValueError: invalid register base
so I've tried to follow the espressif's "Compiling the ULP Code" instruction,
I though it could be loaded into micropython.
But It generates a whole bunch of firmware file include ulp binary.
Could you help me to go further?
Using ThomasWaldmann/py-esp32-ulp will be the best way for me,
But the any way could be okay to get assembly bin files to load into micropython.
Thanks in advance,
Regards
Sam Lee