Bricking, unbricking...

1,146 views
Skip to first unread message

Alex

unread,
Jun 13, 2012, 10:05:19 AM6/13/12
to Magic Lantern firmware development
Just a little story that may change the current ideas about permanent
camera damage.

A user was playing with some USB remote controller and did something
pretty simple: he tried to change picture quality setting on his 5D
Mark II. However, not all combinations are valid, and Canon's
validation code is a bit strange: if some setting is incorrect, the
camera displays ERR70... AND saves the incorrect setting into NVRAM.
That means the user will get ERR70 at every boot (even without card or
without any third party software).

https://vimeo.com/groups/magiclantern/forum/topic:255083

What's worse: subsequent attempts of restoring a correct value for
that unlucky setting may fail. In this particular case, the ERR70 was
a failed assertion in the PropMgr task - the one managing the settings
- which explains why the setting couldn't be changed back.

Canon error message was: ASSERT: FALSE at DevelopCombination.c:98 (5D2 2.1.1).

Luckily, ML can disable the assert handler, so we could ignore the
error and get into Canon menus to restore defaults. The 5D2 is alive
again.

Imagine that your config file gets corrupted and you can't just delete
it and start from scratch. I consider this a design flaw in Canon
software. I've noticed this problem in 5D Mark II, 550D, 60D, 600D and
5D Mark III, so probably all their cameras have this problem.

If you are wondering: removing the main battery or the clock battery
will NOT solve the problem. I've tried leaving the camera without
batteries for a long time - the user settings were not reset.

What does this mean?

* With any USB controller app there's a risk of permanent damage. I'd
say that running ML carries the same risk as using some third party
USB controller app. Maybe even less, since ML has safeguards against
this kind of problems.

* A bug in Canon firmware can result in permanent damage. Sure, it is
very unlikely, because Canon engineers do test their code very well
(much better than I can do).

* Having autoboot enabled means that ML is loaded even if the settings
memory is corrupted. This allows us to troubleshoot the problem and
maybe even fix it. Without autoboot (with the FIR only), there would
be no way to run user code once we lose access to Canon menus. So, I'd
say the autoboot method is much safer - this is advice for those who
may request a FIR-only ML version.

The current FAQ says: "Nothing is written into the ROMs." (
http://magiclantern.wikia.com/wiki/FAQ#Does_it_modify_the_camera.3F )

Is it really true? Almost. Canon code is not changed by ML, but settings are.

So... is it that dangerous? Can a bug in the code render the camera unusable?

The custom modes (C1, C2, C3) have a very nice property: in those
modes, Canon settings are not saved automatically. The same code that
"bricks" a 5D Mark II in M mode (that is, causes ERR70 at every
startup, even with a fresh card), ran perfectly safely in C modes.
I've got ERR70 when running the known dangerous code, but after
reboot, the camera was 100% clean.

So... bottom line: custom modes are probably the safest way to run ML
and to experiment new things when developing. And, of course, knowing
what's dangerous for the camera is essential while developing.

This page contains technical details about how to recover the camera
from similar failures: http://magiclantern.wikia.com/wiki/Unbricking

What do you think - would a "safe mode" bring some peace of mind? That
is, ML could refuse to run in modes other than C. Maybe the rebel
cameras have hidden C modes too. This needs further research, but it
promises a huge improvement in safety of ML code.

P.S. Someone with better writing skills may help me turn this into a
nice blog post.

Alex

unread,
Jun 13, 2012, 11:04:29 AM6/13/12
to Magic Lantern firmware development
P.S. A user just sent me this link: http://www.reikan.co.uk/photography/blog/?p=1550

Looks like it's a great method for recovering from ERR70, with nice
insights. I didn't try it yet.

Takashi Miyake

unread,
Jun 13, 2012, 11:46:20 PM6/13/12
to ml-d...@googlegroups.com, Alex
Hi Alex and native English speakers.

Please help to understanding for non-English natives.

-Cannon firmware does not recover settings when detected the invalid
config parametes.right?
-Autoboot means a "set jump" in firmware, and automatically boot
autoexec.bin. right?
*then how we can solve this issue in ML menu? or autoboot will provide
to access a cannon-menu?
-C1/C2/C3 modes will ignore the all of user setting when we just choose
these modes?

miyake

Alex

unread,
Jun 14, 2012, 2:14:10 AM6/14/12
to Takashi Miyake, ml-d...@googlegroups.com
On Thu, Jun 14, 2012 at 6:46 AM, Takashi Miyake <kotya...@gmail.com> wrote:
> Hi Alex and native English speakers.
>
> Please help to understanding for non-English natives.
>
> -Cannon firmware does not recover settings when detected the invalid config
> parametes.right?

Right; you get ERR70 instead. Confirmed by the developer who uses
Canon SDK: http://www.reikan.co.uk/photography/blog/?p=1550

> -Autoboot means a "set jump" in firmware, and automatically boot
> autoexec.bin. right?

This is a feature in Canon's bootloader, probably used for service. If
it finds autoexec.bin on the card and the card is bootable, it loads
that one instead of main firmware.

>  *then how we can solve this issue in ML menu? or autoboot will provide to
> access a cannon-menu?
> -C1/C2/C3 modes will ignore the all of user setting when we just choose
> these modes?

in C modes, Canon firmware does not save their settings at shutdown.
So, if a third party program sets some incorrect setting, it won't be
remembered at next boot.

But only high-end cameras have C modes.

For this particular case (wrong picture quality setting), there's a
very easy solution for recovering from ERR70. If M mode no longer
works, you can start in C mode, change quality from Canon menu, reboot
in CA mode, shutdown, then reboot in M mode. This clears the error
(now figure out why!).

In a "safe mode", ML could simply refuse to run outside C modes (that
is, in M mode the camera would behave like normal Canon firmware, and
in C mode you would get ML functionality). But it's probably not a big
concern, since I do check these settings before sending them to Canon
firmware.

Takashi Miyake

unread,
Jun 14, 2012, 2:26:15 AM6/14/12
to Alex, ml-d...@googlegroups.com
Thankyou very much Alex.

I'm clearly understood now.
But now , I have new question.
We are talking about M/C1/C2/C3 modes. It's means a photo modes.
I'm main usage is shooting a movie. So the we movie shooter has no "safe
mode" .
Is this a correct understanding?

miyake

Alex

unread,
Jun 14, 2012, 2:29:20 AM6/14/12
to Takashi Miyake, ml-d...@googlegroups.com
On 5D2 you can shoot video in C modes too.

On 60D you can do the same via movie mode remap. The settings will not
be saved at shutdown.

On 50D... I don't know, probably the same as on 5D2.

Takashi Miyake

unread,
Jun 14, 2012, 2:44:10 AM6/14/12
to Alex, ml-d...@googlegroups.com
Oh, I see.
Because, I'm using 600D.

Thanks!!

miyake

Alex

unread,
Jun 14, 2012, 2:55:45 AM6/14/12
to ml-d...@googlegroups.com
There doesn't seem to be any hidden C mode in 550D. Switching to this
mode works (camera goes to P), but settings are still saved at
shutdown (including the wrong picture quality setting).

Luckily, so far I was able to recover from all these "bricking"
problems. Released ML binaries should never cause such things - I've
only experienced these problems during development.
> --
> http://magiclantern.wikia.com/
>
> To post to this group, send email to ml-d...@googlegroups.com
> To unsubscribe from this group, send email to
> ml-devel+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ml-devel?hl=en
Reply all
Reply to author
Forward
0 new messages