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

CC1101 + SD card support for M5stick C Plus2 #249

Open
geo-tp opened this issue Sep 7, 2024 · 12 comments
Open

CC1101 + SD card support for M5stick C Plus2 #249

geo-tp opened this issue Sep 7, 2024 · 12 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@geo-tp
Copy link

geo-tp commented Sep 7, 2024

Describe the bug:
When using a CC1101 module with an SD card on the M5Stick C Plus2, only one of the devices works correctly. Either the SD card or the CC1101 module works, but never both at the same time.

Steps To Reproduce:

  • Connect both the SD card and the CC1101 module
  • Try RF Scan/Copy, it will not work
  • Remove the SD card
  • Try RF Scan/Copy, now it works,but you can't save the signal on your SD card, even if you replug it

Expected behavior:
Both the SD card and the CC1101 module should work together on the same SPI bus

Actual behavior:
When one device is in use, the other stops functioning.

@eadmaster
Copy link
Contributor

afaik this would require an additional free gpio pin for the Chip Select , which the M5stick lacks.

As alternative, the CC1101 can also operate without the GDO0 pin, but some features won't work this way.

@GoldenboyITA
Copy link

Can we add a phisical switch between SD card reader and C1101?!

@bmorcelli
Copy link
Collaborator

There are a few things to consider about the code, itself, that I'll post tomorrow to allow CC1101 and SdCard coexisting together..

But the problem is that once the SdCard is mounted, it is draining the dgo0 signals from CC1101 (for reading/scanning) preventing the stickC to read the signals, and it will only reset (for now) ir you take the SDCard physically out and reconnect it..

You could add a 3 pin button, with NC connected to the 3,3V and NO connected to GND and COM connected to SdCard Vcc pin, when btn is pressed, it connects the Vcc pin of the Sdcard reader to GND, resetting the circuit..

Tomorrow I will keep studying this issue to try to find out a way to "unmount" the SD card without mods, or proposing other connection scheme

@geo-tp
Copy link
Author

geo-tp commented Sep 8, 2024

Tomorrow I will keep studying this issue to try to find out a way to "unmount" the SD card without mods, or proposing other connection scheme

That would be great, otherwise CatHack's behavior allows for recording once (and resetting to record again), and also enables sending .sub files from SD card. This allows access to all features even if a reset is needed to be able to record/save again.

@bmorcelli
Copy link
Collaborator

Saving for later research..

Maybe it'll be needed to change cc1101 clk pin to avoid SDCard from backing to initial state

greiman/SdFat#351 (comment)

@bmorcelli bmorcelli added the bug Something isn't working label Sep 20, 2024
@IncursioHack IncursioHack added the help wanted Extra attention is needed label Oct 25, 2024
@H3llawts
Copy link

Not sure if this could be of any help, but had my stick c plus 2 apart while working on another project and noticed free pins GND,5Vo,SDA(G21),SCL(G22), I soldered a groove port on and modified the case, but would it be possible to change the code for the cc1101 to use those 2 pins instead of G26, G25?

@bmorcelli
Copy link
Collaborator

IT IS COMMING, BOYS!!!

@CodeHedge
Copy link

IT IS COMMING, BOYS!!!

YES!

@Alberto0581
Copy link

Good morning, first of all, thank you for the great work you do, it's impressive.
Now I wanted to tell you. I have assembled the new scheme of the cc1101 with microsd reader. In order to work I have to play with the extraction of the sd card, I select module without sd, it accepts it, I record a signal, insert sd, then I go to files, I send sub from sd with the sd inserted it freezes, if I extract sd it says sent, but with cc1101 and sd inserted it always freezes and does not respond.

@bmorcelli
Copy link
Collaborator

For it to work, you need to use this schematic:
cc1101_stick_SDCard-1.jpg

This is different from the previous connection scheme, regarding Miso, Mosi, CS and GDO0 pins..

The "legacy" connection cannot be used with SD, and will cause problems (restartings and etc)

@Alberto0581
Copy link

Alberto0581 commented Mar 7, 2025

Good afternoon, thank you for your answer, yes, it is the scheme that I have used, I am learning programming, I work in a university related to electronics. The scheme (diagram) works well, the issue is its functionality as I mentioned before, I must emphasize that I am using a somewhat old 4Gb SD, I do not know if it can influence. I can try with other SDs and partition them.

Test update.
This morning I have continued testing. I have changed the SD card for another one. I have also installed the bruce firmware directly without the launcher and the same thing continues to happen to me. I have to remove and insert the microsd card so that it does not freeze.
On Monday at work I can change the BC547 transistor since the collector pin supports a maximum current of 100mA for a BC337 that the collector supports 800mA in case it is failing due to current.

@Alberto0581
Copy link

Good morning, I have changed the transistor for a BC337 and the same problem continues to occur. I have uploaded a video to Youtube so you can see what is happening, because I don't know how to explain it. Thank you very much and best regards.

https://youtube.com/shorts/L6GgbK09LRM?si=IYiWgNfFdrXfRLmc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants