-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
binascii.crc32 and/or binascii.crc_hqx (=crc16) #5928
Comments
It looks like there is code to hook crc32 into binascii: https://github.com/adafruit/circuitpython/blob/main/extmod/modubinascii.c#L207-L219 The setting is We have it turned off. It could be enabled on full builds like the other settings here: https://github.com/adafruit/circuitpython/blob/main/py/circuitpy_mpconfig.h#L209-L236 |
thanks a lot for your help :)
but when I do a clean build, I get the following error:
I guess the problem is the undefined reference to uzlib_crc32 but but that's as far as I get with my ignorance of c ... |
I've also tried to move the crc32 code from uzlib directly into binascii (not sure if that's the way to go but I tried anyway) After prefixing L255 with |
You are making progress! The |
I think that's a good way to go, because then we are not dragging in |
ok, I removed the flag use, but I still have the same problem, i.e. circuitpython builds w/o errors but when I load the firmware.uf2 on a device (e.g. a Pyportal Titano) it no longer boots. Any idea what I might be doing wrong? (Does the capitalization of |
The capitalization doesn't matter. If you do a build without your changes (just the tip of |
No, it doesn't anymore, not from the tip of 'main'. I've been successfully building until recently, though. 7.1.0 was the last functional build that booted. So I checked out that tag and, low and behold, got a successfully booting firmware.uf2. Then I made a branch from there, modified modubinascii.c as before and started getting build errors related to ulab(?). I checked out 7.1.0 again (which should erase any changes, as far as I understand git) and the build errors started to multiply. Suspecting that I screwed up somewhere with git, I've started over with a fresh fork. This got me back to square one, i.e. circuitpython builds without errors, but the Pyportal won't boot. Scratching my head right now... |
If you forked I think your own repo (local or fork) has somehow gotten out of sync, possibly just due to submodule version skew. |
@bludin we're happy to help on Discord too in #circuitpython-dev: https://adafru.it/discord I suggest using |
sorry for being unclear - I freshly forked from adafruit/circuitpython today, i.e. from scratch. To exclude the possibility that I the problem was because I got out of sync. So the problem must lie elsewhere, but I can't imagine where, right now. |
ok, bulids work again. Problem was most likely related to #5951 |
... successfully did the changes discussed and opened my very first PR ever |
Fixed by #5969. Thanks! |
I would like to implement a file-transfer over serial protocol and to that end I need to calculate the CRC of typically 1kB byte-packets. Unfortunately, the latter is pretty slow in Python and CPython's binascii.crc32() and binascii.crc_hqx() are missing from circuitpython (because they use the implementation from zlib which is not turned on because of size and instability, according to Dan). Would anybody be willing to implement them directly in circuitypython's binascii?? It should only be relatively few lines of code, but the procedure is (still) beyond my skills to attempt it myself.
BTW, the SAMD51 apparently has a CRC32 engine. Maybe that could be leveraged for this platform?
Cheers, beat
Edit: I just found this https://github.com/adafruit/circuitpython/blob/main/lib/uzlib/crc32.c . Sorry for being ignorant, but does this mean it's already present or could be simply activated and if so, how?
The text was updated successfully, but these errors were encountered: