GUI events in 550D

49 views
Skip to first unread message

Alex

unread,
Dec 9, 2010, 5:21:12 AM12/9/10
to Magic Lantern firmware development
Hello,

I've just been able to dump GUI events from my 550D and identify some
codes from button presses. My findings are here:

http://magiclantern.wikia.com/wiki/GUI_Events/550D

Does anyone want to help? If yes, compile this version from my repo:
https://bitbucket.org/a1ex/magic-lantern/src/5cefa40dd254/

Event log is displayed on the screen and saved in the debugging log
(see http://magiclantern.wikia.com/wiki/Debugging_Magic_Lantern )

There are still some problems (and I don't know what is causing them,
neither how to fix them):
1) Sometimes, camera shuts down right after starting. It shows "Sensor
cleaning" and, on the same screen, the ML init strings.
2) When the camera starts, card light blinks a few times, but the
screen remains black. You can press DISP to turn it on.
3) Display corruption.

Code is in gui.c; I think there's a problem in gui_main_task_550d().

Thanks.

Alex

unread,
Dec 9, 2010, 5:59:53 AM12/9/10
to Magic Lantern firmware development
Here are some new stubs for 1.0.8.
t2i.108.S

Piers

unread,
Dec 10, 2010, 3:53:29 PM12/10/10
to Magic Lantern firmware development
Sadly some other guy on this list ;-) got me to test his 1.0.9 builds,
so I'm on 1.0.9 now ... would love to help but that's my firmware now

PG
>  t2i.108.S
> 1KViewDownload

Alex

unread,
Dec 10, 2010, 4:02:17 PM12/10/10
to ml-d...@googlegroups.com
Then you can help trying it on 1.0.9 :)

For this, you have to find the new stubs.

> --
> 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

Alex

unread,
Dec 10, 2010, 4:39:23 PM12/10/10
to ml-d...@googlegroups.com
I've just been able to take pictures by pressing the trash button :)

... of course, I can't delete them any more :D ...

Alex

unread,
Dec 10, 2010, 4:45:23 PM12/10/10
to ml-d...@googlegroups.com
Menu is alive! but not yet kicking...
DSCF2707.JPG

arm.indy

unread,
Dec 10, 2010, 5:01:06 PM12/10/10
to Magic Lantern firmware development
Great news Alex!

Indy

On 10 déc, 22:45, Alex <broscutama...@gmail.com> wrote:
> Menu is alive! but not yet kicking...
>
> On Fri, Dec 10, 2010 at 11:39 PM, Alex <broscutama...@gmail.com> wrote:
> > I've just been able to take pictures by pressing the trash button :)
>
> > ... of course, I can't delete them any more :D ...
>
>  DSCF2707.JPG
> 1918KAfficherTélécharger

Alex

unread,
Dec 10, 2010, 5:28:26 PM12/10/10
to Magic Lantern firmware development
Menu works!

Does anyone want to play with it today, while it's hot?

In Debug, it says: CMOS temp: 153. What units are those?

Trammell Hudson

unread,
Dec 10, 2010, 5:42:41 PM12/10/10
to ml-d...@googlegroups.com
On Fri, 10 Dec 2010 14:28:26 -0800 (PST), Alex wrote:
> In Debug, it says: CMOS temp: 153. What units are those?

They are units of EFIC temperature. What that means is a mystery to
anyone outside of Canon...

I haven't tried to calibrate it against anything, but did notice that
the 5D will start flashing the red thermometer around 190. Clearly it
is not K, C, F or R, so my guess is it is a raw reading that needs some
scale factor applied.

--
Trammell

Alex

unread,
Dec 10, 2010, 6:52:54 PM12/10/10
to ml-d...@googlegroups.com
> Does anyone want to play with it today... ?
I guess the answer is no, so there's no release for today.

Also enabled bracketing (works well) and rack focus / stack focus
(seems to do something... but not what I'd expect).

Power management is now disabled when menu is created, and reverted
back to config setting when menu disappears. If camera shuts down when
menu is on, it won't wake up.

If you want to test this, compile it from my repo.

Pedro Barbosa

unread,
Dec 10, 2010, 7:36:31 PM12/10/10
to Magic Lantern firmware development
great great work Alex...i'm really excited to have the oportunity to
test this when it comes to 1.0.9...

Petr Sedlacek

unread,
Dec 10, 2010, 9:26:34 PM12/10/10
to ml-d...@googlegroups.com
Dammit! Makes me sort of regret I sold the 550D and got 60D instead...
No fun with 60D, I want my 550D back now that we're much closer to a
full-blown ML :)

Great work, Alex, hats off.

Pete

Piers

unread,
Dec 10, 2010, 9:30:50 PM12/10/10
to ml-d...@googlegroups.com
erm, am I having some terrible brain fade? I did an hg clone of Alex's repository - using the commands provided by bitbucket, but it looks like I'm getting a very old build with *no* 550D stubs.

Piers

unread,
Dec 10, 2010, 11:06:21 PM12/10/10
to ml-d...@googlegroups.com
never mind, working thru the mercurial help pages, I think I'm there now. Beats me how I got to the current rev the last time ....

Piers

unread,
Dec 10, 2010, 11:46:15 PM12/10/10
to ml-d...@googlegroups.com
Well, with Indy's 109 stubs, and gcc 4.5.1, only two symbols were missing - AllocateMemory and FIO_RemoveFile. I took a punt and copied just those two over, as all memory and FIO funcs seemed to be the same, but ... black screen on startup.

Alex

unread,
Dec 11, 2010, 2:18:47 AM12/11/10
to ml-d...@googlegroups.com
Piers: clone the 550D branch. The default still contains the old 5D2 code.

> Well, with Indy's 109 stubs, and gcc 4.5.1, only two symbols were missing - AllocateMemory and FIO_RemoveFile

Those are essential for cropmarks and file logging.

To run it anyway, try these:
1) comment them in the stubs (to let the compiler help you)
2) Comment every FIO_RemoveFile (they are not essential, they just
avoid creating 2 files w/ the same name)
3) Comment AllocateMemory and disable cropmarks from config file
4) Use Indy's Makefile and take a look as his code changes, too.

Don't try to run anything with wrong stubs, as code may jump randomly
(and may even be dangerous!)

Alex

unread,
Dec 11, 2010, 2:22:23 AM12/11/10
to ml-d...@googlegroups.com
... Also try first to build an older revision, without those features,
and then enable them one by one. When something goes wrong, add (or
remove* ) DebugMsgs.

* remove: DebugMsg's placed in the overriden gui_main_task caused the
camera to restart randomly => commenting all of them was the solution
(thanks Indy for pointing this out!)

Alex

unread,
Dec 11, 2010, 4:21:30 AM12/11/10
to Magic Lantern firmware development
Piers: I've added the 4 input options (audio.input-source) to the
menu. Check the latest changeset.

On Dec 11, 9:22 am, Alex <broscutama...@gmail.com> wrote:
> ... Also try first to build an older revision, without those features,
> and then enable them one by one. When something goes wrong, add (or
> remove* ) DebugMsgs.
>
> * remove: DebugMsg's placed in the overriden gui_main_task caused the
> camera to restart randomly => commenting all of them was the solution
> (thanks Indy for pointing this out!)
>

Piers

unread,
Dec 11, 2010, 6:01:03 AM12/11/10
to ml-d...@googlegroups.com
Well, I think regardless I'll be spending a little more time in the hg man page, and that's probably not a bad thing ... ;-)

Alex

unread,
Dec 11, 2010, 6:07:51 AM12/11/10
to ml-d...@googlegroups.com
The command should be something like this:
hg clone -r 550d http://bitbucket.org/a1ex/magic-lantern

On Sat, Dec 11, 2010 at 1:01 PM, Piers <pie...@gmail.com> wrote:
> Well, I think regardless I'll be spending a little more time in the hg man
> page, and that's probably not a bad thing ... ;-)
>

Alex

unread,
Dec 11, 2010, 6:19:50 AM12/11/10
to Magic Lantern firmware development
I have some nasty bugs:

1) Outside LV mode: when menu disappears, camera seems to freeze; have
to press Disp to make it alive again.
2) Inside LV mode: after using ML menu, and then switching to Play
mode, the display becomes black. After that, camera behaves like drunk
(does not show pictures, empty histograms...). I have to turn it off
and back on.

Did anyone experience anything like this on the 5D2?

On Dec 11, 1:07 pm, Alex <broscutama...@gmail.com> wrote:
> The command should be something like this:
> hg clone -r 550dhttp://bitbucket.org/a1ex/magic-lantern

Piers

unread,
Dec 11, 2010, 6:40:56 AM12/11/10
to ml-d...@googlegroups.com
nice. I also had audio.disable-filters in my audio code - this just turns off the audio filter bits, and based on my non-exhaustive reading of the 4646 datasheet I think that should be enough, but independent verifcation is always nice ...

phil

unread,
Dec 11, 2010, 7:05:04 AM12/11/10
to Magic Lantern firmware development
Yeah you guys are amazing. Once it really works, we can pack the menu
with a lot of custom features :))
Using the config file for this really sucks...

On Dec 10, 9:45 pm, Alex <broscutama...@gmail.com> wrote:
> Menu is alive! but not yet kicking...On Fri, Dec 10, 2010 at 11:39 PM, Alex <broscutama...@gmail.com> wrote:
> > I've just been able to take pictures by pressing the trash button :)
>
> > ... of course, I can't delete them any more :D ...
>
>  DSCF2707.JPG
> 1918KViewDownload

Piers

unread,
Dec 11, 2010, 7:54:13 AM12/11/10
to ml-d...@googlegroups.com
seems to run on 1.0.9 up to 

changeset:   608:b6788e6073b3

Something you did in gui.c broke it! (yes, I commented out the RemoveFiles)

Still, I got to see the zebs and histo. FTW! Are we deliberately refreshing them slowly to not overburden the CPU, or is that as fast as they can go?

PG

Alex

unread,
Dec 11, 2010, 8:03:40 AM12/11/10
to ml-d...@googlegroups.com
Excellent, Piers!

There is a delay here, play with it:
CONFIG_INT( "zebra.delay", zebra_delay, 1000 );

What is the address of gui_main_task in 1.0.9? I've reversed a
function right from the assembly, and it might have changed a bit.
Those changes are required for menu.

Piers

unread,
Dec 11, 2010, 8:11:59 AM12/11/10
to ml-d...@googlegroups.com

NSTUB( 0xFF01FF94, gui_main_task )       //  uses a 8 functions table compared to 5d2 204


According to Indy anyway ...

(New Google Groups formatted clipboard paste is also very cool - or it is if what I've pasted stays styled after I hit "Post")

Alex

unread,
Dec 11, 2010, 8:14:52 AM12/11/10
to ml-d...@googlegroups.com
> nasty bugs...

After letting unhandled events back into camera GUI (i.e. not trying
to stop them, like the original code did), it's much better! At least,
I've tried to crash it for 5 minutes and didn't succeed :)

> gui_main_task

I'll check the gui related stubs, too.

Alex

unread,
Dec 11, 2010, 8:15:33 AM12/11/10
to ml-d...@googlegroups.com
... I think the formatting comes from your editor, and you pasted it as HTML.

Alex

unread,
Dec 11, 2010, 9:11:06 AM12/11/10
to ml-d...@googlegroups.com
Just compared Indy's 1.0.9 stubs with match.py output (by running the
commands from http://magiclantern.wikia.com/wiki/GPL_Tools/match.py )
and noticed the following new/different addresses:

NSTUB(0xFF06B270, AllocateMemory) // might be good
(dumps=1, score=13)
NSTUB(0xFF1C66F4, FIO_RemoveFile) // might be good
(dumps=1, score=1.5)

NSTUB(0xFF07A9A0, register_func)                  // might be good
(dumps=1, score=42)
NSTUB(0xFF06B600, free) // Good. Found
matches: ff06b600/67, ff0182cc/13

The two gui_main_task functions are identical. The DebugMsgs there do
caused blank screen and camera restarts, so comment them, too, i.e.
leave it like this:

static void gui_main_task_550d()
{
struct event * event = NULL;
int index = 0;
void* funcs[8];
memcpy(funcs, 0xff453de0, 32); // copy 8 functions in an array
gui_init_end();
while(1)
{
msg_queue_receive(gui_main_struct.msg_queue_550d, &event, 0);
gui_main_struct.counter--;
if (event == NULL) continue;
index = event->type;
if ((index >= 8) || (index < 0))
continue;
void(*f)(struct event *) = funcs[index];
f(event);
}
}


Attached is match.py output.

109.from.108.and.204.match.py.txt

Piers

unread,
Dec 11, 2010, 5:57:42 PM12/11/10
to ml-d...@googlegroups.com


On Sunday, December 12, 2010 1:11:06 AM UTC+11, Alex wrote:

NSTUB(0xFF06B270, AllocateMemory) // might be good
(dumps=1, score=13)
NSTUB(0xFF1C66F4, FIO_RemoveFile) // might be good
(dumps=1, score=1.5)

Those two look the same as the 108 stubs ... 
 

NSTUB(0xFF07A9A0, register_func)                  // might be good
(dumps=1, score=42)
NSTUB(0xFF06B600, free) // Good. Found
matches: ff06b600/67, ff0182cc/13

Indy has register func at 0xFF1D7E78 I kind of think if that was wrong nothing much would work .. he also has free at a different addr

The two gui_main_task functions are identical. The DebugMsgs there do
caused blank screen and camera restarts, so comment them, too, i.e.
leave it like this:


I tried commenting them out, but that's also done by build 609. I'm also noticing on the builds that do run I have to jiggle the quick menu a couple of times before I see the "histozebs". But that's progress! I'm sure we're not too far off..

PG

Alex

unread,
Dec 11, 2010, 6:16:41 PM12/11/10
to ml-d...@googlegroups.com
register_func is not called in the code (at least not in my 1.0.8).
free is used in config.c, only in error situations (so it might be
never called in normal cases).

The other two are at the same address (look in the disassembly).

arm.indy

unread,
Dec 12, 2010, 3:58:53 AM12/12/10
to Magic Lantern firmware development
Petr,

There is no reason we can not port ML to 60d, let cross fingers.
I'll have a 60d in hands early 2011.
and an update is upcoming... http://www.canonrumors.com/2010/12/new-60d-firmware-coming/

Indy

Petr Sedlacek

unread,
Dec 12, 2010, 7:06:48 AM12/12/10
to ml-d...@googlegroups.com
That would be great. I understand the first step is to obtain a firmware
dump, so let's hope Canon release the update soon.

I will go ahead and study how firmware is analysed with the scripts so
that I'm ready to help when it happens :)

Pete

On 12/12/10 08:58, arm.indy wrote:
> Petr,
>
> There is no reason we can not port ML to 60d, let cross fingers.
> I'll have a 60d in hands early 2011.
> and an update is upcoming... http://www.canonrumors.com/2010/12/new-60d-firmware-coming/
>
> Indy
>

Alex

unread,
Dec 12, 2010, 7:54:52 AM12/12/10
to Magic Lantern firmware development
> I have to jiggle the quick menu a couple of times before I see the "histozebs"

Early versions of "histozebs" did the same on 550D. They sometimes did
not show, other times were drawn over the menus... What I've noticed
was that audio meters were always drawn correctly => I've copied the
conditions from there.


On Dec 12, 2:06 pm, Petr Sedlacek <p...@sedlacek.biz> wrote:
> That would be great. I understand the first step is to obtain a firmware
> dump, so let's hope Canon release the update soon.
>
> I will go ahead and study how firmware is analysed with the scripts so
> that I'm ready to help when it happens :)
>
> Pete
>
> On 12/12/10 08:58, arm.indy wrote:
>
> > Petr,
>
> > There is no reason we can not port ML to 60d, let cross fingers.
> > I'll have a 60d in hands early 2011.
> > and an update is upcoming...http://www.canonrumors.com/2010/12/new-60d-firmware-coming/
Reply all
Reply to author
Forward
0 new messages