Some success with writeCID

Guys...,

Can someone help me on this ?

Thanks, Harshana

When you use CMD27 you must only change the writable part of the CSD. The other data must match the read only part in the CSD.

You must use the correct value for the CRC field in the register.

These are the three bits you can change but only TMP_WRITE_PROTECT can changed back.

• COPY Defines whether the contents is original (=0) or has been copied (=1). Setting this bit to 1 indicates that the card content is a copy. The COPY bit is a one time programmable bit except ROM card. • PERM_WRITE_PROTECT Permanently protects the entire card content against overwriting or erasing (all write and erase commands for this card are permanently disabled). The default value is 0, i.e. not permanently write protected. • TMP_WRITE_PROTECT Temporarily protects the entire card content from being overwritten or erased (all write and erase commands for this card are temporarily disabled). This bit can be set and reset. The default value is 0, i.e. not write protected.

Thanks fat16lib for the reply.

OK I understand that I need to be careful when writing to CSD as PERM_WRITE_PROTECT will make my SD unusable (unless I have anything useful for reading). My query is how do I use CMD27.

I can use SD2Card cardCommand(27, 0) and get the response. How do I write the data that goes into the register?

if (ret = cardCommand(27, 0)) { Serial.print("CMD27 failed :"); Serial.println(ret, HEX); return false; } else Serial.println("CMD27 worked");

spiSend(data1); // send 1st byte spiSend(data2); // send 2nd byte spiSend(data3); ... spiSend(datan);

Will this work ? Doesn't want to try this and ruin the card.

Thanks again Harshana

Hi fat16lib, looks like you are my only hope.

Any improvement on modyfing SD CID registers?

Hi all,

There’s been inquiries on what happened on this project. This is to update all of you who are still searching for a solution.

I was not able to continue on this project after the roadblock I came across. I would love to hear from anyone who got it working. As per SD cards, go for cheap / unbranded SD cards, they will most probably support CID to be written.

Thanks,
Harshana

Hi all. Ok, I want to take a chance. I need some informations, though. Somebody wrote about cheap MMC or SD cards. I guess they could even be counterfeit or fake cards but which they allow CMD26. So, someone could tell what cards (brand and model or manufacturer) surely accept CMD26? Honestly I tried to find them but no joy. Where have you found them? That said it would be possible go ahead otherwise we are stuck no way out and without any possibility, hence it's game over. Another thing which could be important and useful to know is the way you need to send CMD26. I wonder if you need to send it in SPI mode or MMC mode. I guess the correct way is through SPI mode. This is because I know Arduino generally manages SD/MMC in that way and here in the beginning of the thread someone wrote about modified SD2Card library in order to change/rewrite CID. Though I could be wrong on this. Any answers based on your experience will be welcome. Thanks in advance!

AR

Hey you had any further progress changing the CID?

Hi Bucky101, sadly no, no progress. I'm pretty sure I'd be able to do the job but unluckily I can't find the right SD/MMC. I have contacted many manufacturer but nobody gave me even only one single piece. They ask to buy a lot of pieces, only few pieces are out of business on their point of view so they don't sold few pieces. All this stuck me. That is. But I don't give up!

AR

After few months of research and development I finally figured out how get this working. hranmuthu, I was able to send CMD26 via SPI and got permanent result (New CID) But it's more complex then just sending the command I was able to succeed with 2 major manufacturers out of 4 and each controller needs different methods. It is possible but very time consuming since you will need to come up with different ways for different controllers. Also Creating something (Universal) that will work with every controller is almost impossible.

Can you explain how to? Please?

legno75: Can you explain how to? Please?

As i mentioned on my post, I did a lot of experiment and reverse engineering on manufacturers firmwares It's not just sending CMD26 on SPI mode. You need to knock SD or MicroSD Card into firmware mode. Once done, They do accept CMD26 and Permanently accept new CID Values.

Hi DavidLE,
glad to read that you succeeded!
Please, could you tell exactly with which cards you were able to do that successfully?
You wrote 2 major manufacturers out of 4, but what exactly?
Were MMC or SD? (I guess SD and uSD)
What model exactly?
An interesting thing would be if you could provide original CID and CSD of the cards that you have been able to change, is it possible?
Knowing it would be possible to understand their manufacturer date and other useful parameters.
I know I asked for a lot of informations and I hope you will answer.
(Even if I’m pretty sure that your statements are based on something like this old document here

so actually your answer has to be interpreted academically rather than like a possible solution to the problem, being in the facts that in real life the things are far from being as you have described them.
Hence there will be no any reply.)
Anyway, you wrote that each controller needs different methods, I guess you mean working on different cards produced by different manufacturer’s brands.
Once you can reach the target with a certain type of cards produced by a specific manufacturer, then surely you can repeat the job on others cards which are the same as model, brand and manufacturer.
You wrote that it is possible but very time consuming do the job since you will need to come up with different ways for different controllers and also creating something (Universal) that will work with every controller is almost impossible.
I partially agree.
I don’t know what do you mean about the different ways for different controllers you wrote, but in my opinion I think with the right cards isn’t too hard to achieve the goal.
I’m pretty sure I’d be able to do the job but unluckily I can’t find the right SD/MMC.
So please, explain exactly with what kind of cards you were able to do the job possibly specifying their manufacturer, brand, type CSD and original CID (in order to know their manufacturer date).
Thanks in advance.

You also wrote that it’s not just sending CMD26 on SPI mode and it’s need to knock SD or MicroSD card into firmware mode, then once done, they do accept CMD26 and permanently accept new CID values.
That would not be a problem always working on the same type of cards.
Anyway I think it isn’t so complex, the real trick is to have the right cards, IMHO

AR

Somebody has news about change of CID? I found that CMD60 on SiliconMotion controlers transfers SD to the mode when the card doesn't respond to CMD26 to Error.

Hi Alexel, sadly no new news for now. Anyway, what do you mean by writing that you have found that CMD60 on SiliconMotion controlers transfers SD to the mode when the card doesn't respond to CMD26 to Error? Thanks.

AR

Seems like you guys are on right path :) I can share limited info thru PM

Thanks

Hi DavidLE, thank you for your kind support. Honestly though, I can't see why for you it's not possible to provide informations here while instead it is possible thrugh PM. Anyway meanwhile, if you want, you could start by answering the questions that I have made about the manufacturer, model, original CID and CSD of the cards you've modified successfully or at least confirm or deny that your statements are based on something like this old document here:

http://tinyurl.com/lncst9c

Thanks in advance!

AR

Hi guys, just wondering if any progress has been made on this... It looks like we have a lot of information to work with, but unfortunately, don't know which cards to target :(

Alexel: Somebody has news about change of CID? I found that CMD60 on SiliconMotion controlers transfers SD to the mode when the card doesn't respond to CMD26 to Error.

Can you please elaborate on what argument did you use for the first command? Also, what brand of SDHC cards use this controller?

Thanks.

Hi yyzyyz,

yyzyyz:
Hi guys, just wondering if any progress has been made on this… It looks like we have a lot of information to work with, but unfortunately, don’t know which cards to target :frowning:

That would be telling.
It’s a secret!
Ok, I’m just kidding, apologize me.
I agree, you are right.
Actually it doesn’t need anything else than to know what are the right cards because only those make the difference doing the trick.
Meanwhile I have purchased some cards from China, we’ll see if those are the right ones or no.

yyzyyz:
Can you please elaborate on what argument did you use for the first command? Also, what brand of SDHC cards use this controller?

Not just talking about SiliconMotion controllers, not only CMD60 has that behaviour, even other have it.
Some cards have it, some don’t.
In my opinion it isn’t much a matter of controller type but rather of the kind of card.
Alexel didn’t respond to my request for clarification, though.
So honestly I don’t know exactly what he meant, sorry.

However for any doubt you can try with a PM, maybe you’ll get the solution.

AR

I think it totally depends on the controller and the firmware running on it and as DavidLE has also mentioned, it's unique to each controller type. So what works on an SMI controller might not work on a Micron controller, for example. Although Alexel provided a good lead on the Silicon Motion controllers, he did not care to mention which card he was testing with. Similarly, DavidLE hasn't mentioned which brand of cards and specific controllers did he succeed with. I've sent them both a PM for more details but they haven't responded yet. Unfortunately, there's no easy way (that I know of) to determine which cards employ which controller by just interacting with the card firmware. I hope you have better luck with the Chinese cards; please do let us know how it goes.