proveskit / circuitpy_flight_software

Flight software for the PROVES Kit.
MIT License
3 stars 8 forks source link

SD card umount function doesn't work on reset_vbus, and reset_vbus kills our satellite #46

Open Michael-Esser777 opened 2 hours ago

Michael-Esser777 commented 2 hours ago
 def reset_vbus(self):
        # unmount SD card to avoid errors
        if self.hardware["SDcard"]:
            try:
                umount("/sd")
                self.spi.deinit()
                time.sleep(3)
            except Exception as e:
                self.error_print(
                    "error unmounting SD card" + "".join(traceback.format_exception(e))
                )
        try:
            self._resetReg.drive_mode = digitalio.DriveMode.PUSH_PULL
            self._resetReg.value = 1
        except Exception as e:
            self.error_print(
                "vbus reset error: " + "".join(traceback.format_exception(e))
            )

We get an error on the "umount("/sd")" line: [pysquared]error unmounting SD cardTraceback (most recent call last): File "lib/pysquared.py", line 630, in reset_vbus OSError: [Errno 22] Invalid argument

We've tried everything including manually adding a sd directory to the rp2040. Also, even when we comment out the umount line, this function deinitializes our radio and kills the satellite. When we comment out the function entirely the satellite works perfectly fine.

Mikefly123 commented 2 hours ago

Hey @Michael-Esser777 is this an error that you are getting when pysquared.py is initialized or when you try to call this function?

Also, there aren't any line numbers here, so could you let me know what is on line 630 or upload a copy of your file to the issue ticket?