Skip to content

Avoid a longint as a cmd arg #29

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

Merged
merged 2 commits into from
Nov 18, 2019
Merged

Conversation

dhalbert
Copy link
Contributor

This fixes #27.

PR #26 introduced a longint as a cmd arg, which makes the library fail on non-longint builds, such as Feather M0 Adalogger. I reworked the _cmd() method to take either an integer or a bytes, so non-longint constants can be expressed in the code.

@michelkluger, would you like to test? I can supply a .mpy if you need one.

@michelkluger
Copy link

Yes, i can Test it tomorrow at work and feedback you about the result.

Thanks a lot for taking a look into that. My scientific project will benefit a bunch from a working library :)

@michelkluger
Copy link

send me the .mpy when you can =)

Thanks in advance for the effort

@atwalsh
Copy link

atwalsh commented Nov 15, 2019

Can confirm this resolves the issue described in #27, tested on an Adalogger M0.

@michelkluger I built the .mpy using:

- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-sd --library_location
.

@michelkluger
Copy link

Can you provide me the .mpy file? I am yet to learn how to cross compile and everything. I'm pretty new to the embedded world

Thanks

@dhalbert
Copy link
Contributor Author

@michelkluger Sorry for the delay. Unzip this (I can't post a .mpy directly):

adafruit_sdcard.mpy.zip

@michelkluger
Copy link

this is working like a charm =)

Thanks a lot

@dhalbert
Copy link
Contributor Author

@michelkluger Great, we'll publish this as a release. Thanks for your testing!

@dhalbert dhalbert merged commit dd0fe85 into adafruit:master Nov 18, 2019
@dhalbert dhalbert deleted the avoid-longint branch November 18, 2019 14:15
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 18, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_SD to 3.2.5 from 3.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_SD#29 from dhalbert/avoid-longint
  > Merge pull request adafruit/Adafruit_CircuitPython_SD#26 from Anton-2/master
  > Merge pull request adafruit/Adafruit_CircuitPython_SD#24 from adafruit/dherrada-patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_SD#23 from Anton-2/master
@michelkluger
Copy link

@dhalbert is there a way to extract the data from the sd card to the pc, using the usb connection, without having to physically remove the card and plug in the slot?

@dhalbert
Copy link
Contributor Author

@michelkluger It is very difficult to expose the SD card filesystem as a mass storage device. I think the discussion here may be helpful to explain why: adafruit/circuitpython#2206.

@michelkluger
Copy link

but is it possible to stream the bytes somehow via usb (not as a mass storage device )? or ftp to grab the data?

it is not essential, but if there is a known method I would implement in my code

@dhalbert
Copy link
Contributor Author

You can always just print the data. For boards that didn't have mass storage USB support, there are tools for doing file transfer over serial. Take a look at https://github.com/scientifichackers/ampy (we used to support this, but transferred it to someone else).

@atwalsh
Copy link

atwalsh commented Nov 20, 2019

There's a post on the MicroPython forums discussing something that I have been wanting to try out. It looks like they are using the pyb library specific to the pyboard, but I wonder if something similar could be achieved with CircuitPython supported boards. This is unrelated to the PR, but I wanted to see if you know what they are discussing (exposing SD card through USB of the board) is possible on these boards.

@dhalbert
Copy link
Contributor Author

This is getting off the PR, and feel free to open a new issue. That post describes using rshell (similar to ampy) to get the data, or to mount the SD filesystem instead of the internal filesystem. It's not possible to present both filesystems via USB MSC.

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

Successfully merging this pull request may close these issues.

OverflowError: long int not supported in this build
4 participants