Magic Lantern Forum

Using Magic Lantern => General Help Q&A => Topic started by: utigaard on December 26, 2017, 09:32:26 PM

Title: Canon EOS 70D/550D/others - SD card locked
Post by: utigaard on December 26, 2017, 09:32:26 PM
Hello, im not sure if this is the correct place to put this, but i'll give it a go. I've googled for the last month and have found nothing to help me. Canon here in Norway wants 300 euro to change out the sd slot. I was wondering if there was a way to use ML to just ignore the SD lock sensor. I would change it but I will have to wait for parts, and im not too keen to open the camera without exhausting every option. I'm just looking for a way ignore the sensor. Any replies will be appreciated.
Title: Re: Canon EOS 70D - SD card locked
Post by: a1ex on December 27, 2017, 08:09:52 AM
Should work by patching FF0C4574 from 0x0A00000B to 0xEA00000B (string: "[STARTUP] WriteProtect (%#x)").

The 70D branch already includes the patch manager (https://bitbucket.org/hudson/magic-lantern/pull-requests/687/patch-manager-wip/diff), so I believe this should work:


patch_instruction(0xFF0C4574, 0x0A00000B, 0xEA00000B, "WriteProtect");


This should go right before calling Canon's init_task, e.g. starting from the 70D_merge_fw112 branch:


diff -r d048d8447fa3 src/boot-hack.c
--- a/src/boot-hack.c
+++ b/src/boot-hack.c
@@ -41,6 +41,7 @@
#include "reloc.h"
#include "ml-cbr.h"
#include "backtrace.h"
+#include "patch.h"

#if defined(FEATURE_GPS_TWEAKS)
#include "gps.h"
@@ -756,6 +757,8 @@
         }
     }

+    patch_instruction(0xFF0C4574, 0x0A00000B, 0xEA00000B, "WriteProtect");
+
     // memory check OK, call Canon's init_task
     int ans = init_task_func(a,b,c,d);


Tested in QEMU (comment out "case 0x0168" from eos_handle_gpio in eos.c to simulate the WriteProtect switch being enabled). Not sure if the MPU also watches this switch (hopefully not) - will test later on 5D3.

edit: seems to work (5D3.113: 0xFF0C43C4)
Title: Re: Canon EOS 70D - SD card locked
Post by: Walter Schulz on December 27, 2017, 08:44:01 AM
If a1ex's hack doesn't work you may want to contact a mobile phone repair shop (with a good reputation ...). They might be able to replace this part without much hassle and with a lower price tag attached.
Title: Re: Canon EOS 70D - SD card locked
Post by: massi0189 on August 18, 2018, 10:49:19 AM
Hi a1ex,

how should I edit this line to make it work on a 550D with 1.09 firmware?

Quote from: a1ex on December 27, 2017, 08:09:52 AM

patch_instruction(0xFF0C4574, 0x0A00000B, 0xEA00000B, "WriteProtect");


Thanks,
Max
Title: Re: Canon EOS 70D - SD card locked
Post by: a1ex on August 18, 2018, 07:15:59 PM
For 550D 1.0.9, you need:

patch_instruction(0xFF012EE0, 0xEB016DBD, MOV_R0_0_INSTR, "WriteProtect");


You will also need a branch that includes the patch manager. For example, the experimental 70D branch should work just fine:

hg up 70D_merge_fw112 -C


Then apply the patch and compile ML as usual.
Title: Re: Canon EOS 70D - SD card locked
Post by: Banshee on August 23, 2018, 12:10:00 PM
Alex, I can't express how grateful I am for this fix. It actually worked on my 550D. There are hundreds of reports of this issue on the Internet since like 2009 and here is the solution finally)

The only issue I had was that during ML install SD is still write protected. Install doesn't report any error but it doesn't commit ROM and boot records to the card. So, in order to complete the installation I had to set boot records on SD with hex editor on PC manually.
Title: Re: Canon EOS 70D - SD card locked
Post by: a1ex on August 26, 2018, 07:34:16 PM
Nice to know it helped; maybe I should consider enabling this trick for all SD models. There must be a way to do the same without ROM patching...
Title: Re: Canon EOS 70D - SD card locked
Post by: alxjvr on March 01, 2019, 03:10:09 AM
Hi, I have the same scenario with my 550D.  Could you detail the app and steps you made in setting the boot records via a PC?  Thanks a lot! ;)

Quote from: Banshee on August 23, 2018, 12:10:00 PM
Alex, I can't express how grateful I am for this fix. It actually worked on my 550D. There are hundreds of reports of this issue on the Internet since like 2009 and here is the solution finally)

The only issue I had was that during ML install SD is still write protected. Install doesn't report any error but it doesn't commit ROM and boot records to the card. So, in order to complete the installation I had to set boot records on SD with hex editor on PC manually.
Title: Re: Canon EOS 70D - SD card locked
Post by: alxjvr on March 23, 2019, 02:30:39 AM
Woohoo! It works! Haha.

A million thanks Mr. Banshee and a1lex!  Hats off to you both ;)
Title: Re: Canon EOS 70D/550D/others - SD card locked
Post by: Hellmark on August 07, 2020, 12:13:51 AM
Will this work for the 450D?