Page 1 of 1

ESP32-S3: SPI w/ motion sensor HELP

Posted: Fri Feb 16, 2024 5:12 am
by juultrooper
Hi everyone, I am new to ESP32 and ESPIDF overall. I am trying to create a project using a ESP32-S3 with a Motion Sensor(PMW3389) to act as a mouse. Despite the project compiling, I couldn’t get the sensor to work and display the correct srom_id reading after downloading the SROM hex file. Any help is appreciated as I feel like I am losing my mind and don’t where to go from here. Thank you in advance for your time!

Link to the project:
https://github.com/vnguyen31/pwm3389-spi

Guide I am following:
https://github.com/mrjohnk/PMW3389DM/bl ... olling.ino

Re: ESP32-S3: SPI w/ motion sensor HELP

Posted: Sat Feb 17, 2024 1:56 pm
by MicroController
Quick check of the datasheet indicates minimum MISO and MOSI hold times of 200ns, i.e. 1/5us, and a maximum serial port clock frequency of 2MHz, so an SPI clock of <=2MHz is more likely to work than 16MHz.

Code: Select all

vTaskDelay(pdMS_TO_TICKS(1));
Note that FreeRTOS, by default, operates on 10ms ticks; this is the minimum amount and increment of time you can delay. pdMS_TO_TICKS(1) is 0, i.e. no delay.

Re: ESP32-S3: SPI w/ motion sensor HELP

Posted: Tue Feb 20, 2024 12:18 am
by juultrooper
Thank you so much for all the help I will make these changes ASAP.
BTW, do you know what is:
Backtrace: 0x42018CDA:0x3FC941B0 0x42018E86:0x3FC941D0 0x40377885:0x3FC941F0 0x40375BFE:0x3FC99DE0 0x40375C5D:0x3FC99E00 0x42001677:0x3FC99E20 0x42001707:0x3FC99EA0 0x4037D44C:0x3FC99EC0 0x4037D045:0x3FC99EF0

I keep getting this, but have no idea where to look.

Re: ESP32-S3: SPI w/ motion sensor HELP

Posted: Tue Feb 20, 2024 8:50 am
by MicroController
That's the so-called 'backtrace' which identifies where the 'panic', i.e. error, happened, see https://docs.espressif.com/projects/esp ... -backtrace
If you use idf.py monitor it will automatically decode the backtrace into source files, function names, and line numbers: https://docs.espressif.com/projects/esp ... s-decoding
Alternatively, you can also use addr2line to decode a backtrace, see https://esp32.com/viewtopic.php?t=23384#p84126