waterloo-rocketry / cansw_processor_stm

1 stars 0 forks source link

Sdcard otits #26

Closed celery6 closed 1 week ago

celery6 commented 2 weeks ago

idk how valid this otits test is. It would be nice to open and read the actual logger file, but I think that conflicts since you can't open the same file in two threads (?), and adding guards is not in the scope of this. So the purpose of this test is just to make sure sd card is in fact connected and able to open/write/read an arbitrary file.

Also created a separate sdmmcInit() method to separate the fatfs stuff from logger a bit, pls review if this works or not.

This branch is branched off the logger one, so just ignore all the changes to logger. Only relevant files are the sdmmc and main.

celery6 commented 1 week ago

bruh the sd card code got deleted again im so confused... Re-added using git cherry-pick, works.

Note: I think fatfs methods must be run inside a freertos task cuz they use queues and stuff? that's why putting it in sdmmcInit() doesn't work. I moved the init back into logTask.

also had to close the file after writing, then reopen it again to read. Not sure if that's how fatfs is supposed to be used... but it works, and reading/writing without reopening didn't work. This is also good to check that a file was actually created too i guess.

celery6 commented 1 week ago

image

image

image