• Thanks to y'all help, I am making a lot of progress now. The code all seem working, but I am encountering this error "Prompt not detected - upload failed. Trying to recover..." when I run a long while loop in Espruino. I am trying to extract the FIFO data from the IMU(LSM6DSL) continuously for a long time. The data look correct at the beginning but the pattern got messed up after a couple of sets of data and then this error "Prompt not detected - upload failed. Trying to recover..." occurs and the entire program just stops.
    Does anyone have any ideas of why this would happen and how to fix this? Thank you very much for y'all help.

    Figure 1 While loop code

    Figure 2 Correct data pattern before the first 7th set. The number in the middle indicates the number of data left in the FIFO (2048 is when its full), it seems SPI is reading too slow to catch up the FIFO data generator, but I actually set SPI transmission rate to 10 MHz(max rate that the IMU can torrent), I would expect the SPI speed is sufficient enough.
    Sorry the print title does not match up with the actual data, the correct order should be "gyro x ,gyro y,gyro z, acceleration x, acceleration y, acceleration z,temperature, timestamps"

    Figure 3 shows the error I am getting and the program crashed.


    3 Attachments

    • Screen Shot 2019-11-02 at 10.00.01 PM.png
    • Screen Shot 2019-11-02 at 10.00.11 PM.png
    • Screen Shot 2019-11-02 at 10.01.45 PM.png
About

Avatar for user101931 @user101931 started