RT1062 Crashes When Writing Text to File on SD Card

The attached code reproduces the issue. After a few hundred writes or less to the .txt file on the SD card, the app crashes and the IDE hangs.

Test_Logprint_V1.py (830 Bytes)

I just ran the script with my RT1062 using the tip of dev and made it to over 1k iterations and then with v4.5.9 and made it to 1k iterations.

You may wish to format your SD card and/or repair it using the drive manager on your PC.

Reformatted a new 32GB SD card and tested with brand new RT1062. FW Ver 4.5.9. Crash happens sooner when running with battery connected (<500), but also without (<1500). I thought it might be the powered USB hub so I removed that and tested without the battery connected and with a short USB C-C cable to XPS15 laptop. Crashing continues to happen.

I let it run for quite a while and got to 22399 loops with my RT1062 v4.5.9 connected to OpenMV IDE v4.4.7 before stopping it. No crashes. I am using a 128GB PHY SD card with a lot of random files on it over the years from testing various things. So, not a clean SD card at all.

Not sure what the issue is…

Changed to a SanDisk Extreme Plus 128 GB 30 MB/s SD card and still crashes using IDE v4.4.7. There is no error code on the Serial Terminal, just stops. What suggestions to you have to debug this?

Added flashing LED and ran test code as main.py on the SD card to be able to monitor without the IDE. When running off battery it does not appear to be crashing. When running same code from the IDE is crashes after <1500 cycles. Looks like it is an issue with the IDE. When the crash happens, the LED on the board stops flashing and cycle data stops appearing on the serial terminal without an error message. The “X” button on the IDE does not work, communication with the board is lost from the IDE, and the SD card on the board cannot be accessed from Windows Explorer. The only way to reset is to disconnect the board from USB C and reconnect.

Test_Logprint_V1.py (1.2 KB)

Mmm, I’ll just on a call with you and try to figure out what’s wrong. Since I can’t reproduce this is one of those weird edge case things. I’ll send a PM.

Thanks. I grabbed a timeslot on you calendar on 1/13.

Solved by updating to the latest firmware.