Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jama Func microSD test function #43

Open
ghvau opened this issue May 5, 2023 · 7 comments
Open

Jama Func microSD test function #43

ghvau opened this issue May 5, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@ghvau
Copy link

ghvau commented May 5, 2023

jama-func-sd.zip

I have problems the find the right connection data of the "SD Card" function in the main menu.
Therefore I build a "quick and dirty" test for the Jama Funcs with some good segments from github.
Maybe you are interested.

@jczic
Copy link
Owner

jczic commented May 5, 2023

Hey, this is really cool! :)

You didn't have the SDCard library in your MicroPython Port, right ? (from machine import SDCard)

So here you can actually choose the SPI GPIOs for testing the particular ESP32 boards.
But indeed, the SD Card menu in the software doesn't work for you I see, what exact message do you get when you try to activate it from this page ?

Also, in the information of the "Jama Func", you can put your mail (see the template) and your site or github in www :)
I could add it to the repository without problem then with an info in the main readme!

@jczic jczic added the enhancement New feature or request label May 5, 2023
@ghvau
Copy link
Author

ghvau commented May 6, 2023 via email

@jczic
Copy link
Owner

jczic commented May 6, 2023

Hi @ghvau, in fact, the SD Card part of the program simply uses the default SD Card slot of the ESP32 which works on most boards.
You have indeed particular boards that require different GPIOs.

However, if you get this error message, it means that the library is indeed supported on your MicroPython and in that case, it should be usable with your boards.
Look at all the options available here :
https://docs.micropython.org/en/latest/library/machine.SDCard.html

You could use it by proposing to configure these options instead of integrating another more restricted library in the Jama Func?

At what level did you manage to use this library? (there is the SLOT option which can be important too).

It would be a pleasure to add your code :)

@ghvau
Copy link
Author

ghvau commented May 7, 2023

SDCard_var-native.zip
(updated: final experimental, two versions)

Hi @jczic,

following your mind, I try the "native" SDCard Class, w/o any additional libs.
The result you find in the attachment, as minimalist implementation.

I thing the native solution is not usable for each board config (exotic card wiring).
Sometimes after repeated call of "sd = SDCard(slot=x ... " the function hang and
my integrated reset() get a trigger. But principle it works.

@jczic
Copy link
Owner

jczic commented May 7, 2023

Hello, yes I think it is more logical to use the built-in library and why not test if it's supported during the import instruction.

In fact, if sometimes the configuration crashes the board, it's simply because the selected GPIOSs are already used for something else and that causes a hardware error on the board.
Do you think it is really necessary to reboot in case of a problem?

Also, slots 0 and 1 are, for the ESP32, the default slots without indication of GPIOs. Only slots 2 and 3 can be set via an SPI interface.
Also, you may have a problem with the bus size in bits (argument width).

Your SD Card test is an excellent idea and actually, does it work well on your exotic cards?
(eventually, you should delete the file created at the end of the test?)

@ghvau
Copy link
Author

ghvau commented May 11, 2023

Hi @jczic,

good news for me, when I support

Line 1726: ' ___jama["sdCard"] = SDCard(xyz)\n'

with the parameter, I used in the above test prog. I have also "full" access to the SDCard via the main function.
-> init, mount, file access, umount, release. I don't try format because I have no free microSD available.

Tested with the ESP32-CAM board/data.

Maybe this is an stimulation for you to make this point also variable. :-)

@jczic
Copy link
Owner

jczic commented May 11, 2023

Yes, indeed, I had thought to tell you too, I use this variable to keep the instantiation of the SD Card object in memory :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants