550D boot issue workaround: remove and reinsert battery

20 views
Skip to first unread message

de...@42u.de

unread,
Dec 13, 2010, 7:24:00 PM12/13/10
to Magic Lantern firmware development
My symptoms are:

The camera seems to startup only once with the ML firmware (0.2.0rc1 for
1.0.9, built directly from latest sources using gcc 4.3.2) directly
after flashing. If the camera shuts down itself or if you switch it off
it is impossible to switch it on again. My workaround is to remove and
reinsert the battery.
For me it seems that something remains in the camera's memory that
prevents a proper boot process. Can anybody confirm this behavior?
If needed I can provide more log files or debug output.

Deti

de...@42u.de

unread,
Dec 13, 2010, 7:50:00 PM12/13/10
to ml-d...@googlegroups.com
To make that clear: I don't have to re-flash the camera! After
re-inserting the battery it boots up properly with the ml-firmware.

Alex

unread,
Dec 14, 2010, 1:46:54 AM12/14/10
to ml-d...@googlegroups.com
Read the compiling instructions again. The problem is from GCC 4.3.2.
Upgrade to 4.4.2.

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

de...@42u.de

unread,
Dec 14, 2010, 10:31:10 AM12/14/10
to ml-d...@googlegroups.com
On 12/14/2010 07:46 AM, Alex wrote:
> Read the compiling instructions again. The problem is from GCC 4.3.2.
> Upgrade to 4.4.2.
I now upgraded to 4.4.2 by following the instructions on the build page
(took magiclantern.fir from prebuilt zip archive) and the problem still
persists.

Deti

de...@42u.de

unread,
Dec 14, 2010, 10:33:59 AM12/14/10
to ml-d...@googlegroups.com
Got it - had to write the MBR manually.

Deti

de...@42u.de

unread,
Dec 14, 2010, 5:08:52 PM12/14/10
to ml-d...@googlegroups.com
Sorry for all the confusion but now I found out that you have to choose
"Save config" from the Debug menu to get the camera shutting down and
booting properly again.

This issue is NOT related to any compiler version or SD card size - I
think I really hit a bug now.

Try to remove MAGIC.CFG from your card and then you will not be able to
shutdown and power on the camera again.

Deti

Alex

unread,
Dec 14, 2010, 5:25:02 PM12/14/10
to ml-d...@googlegroups.com
I'll take a look at this. Thanks for the bug report.

Alex

unread,
Dec 15, 2010, 4:22:29 AM12/15/10
to ml-d...@googlegroups.com
I'm trying to reproduce the issue on my (latest) 1.0.9 build. It's
from the sources which are right now on the repo, GCC 4.4.2.

I've deleted MAGIC.CFG.

Then:
- Turned off the camera from the main switch. Sensor cleaning => OK.
Turned back on => OK.
- Waited for the camera to enter power management (i.e. turn off by
itself.) Pressed half-shutter => OK.

After this, I've deleted ALL files from the card, except for autoexec bin.
Did the same tests. Results are identical. I couldn't freeze the camera.

Then I've played a bit with options, live view, histozebs,
enable/disable some settings, zoom. Waited for camera to turn off
automatically, then booted it again with half-shutter normally. Tried
from both LV and non-LV modes => all worked well.

Alex

unread,
Dec 15, 2010, 4:24:33 AM12/15/10
to ml-d...@googlegroups.com
Also try make clean / make.

Deti

unread,
Dec 15, 2010, 5:06:34 AM12/15/10
to ml-d...@googlegroups.com
On 12/15/10 10:24 AM, Alex wrote:
> Also try make clean / make.
I always prepend make clean to the build process and I have several 550D
here for testing and tried the build on different systems (all using gcc
4.4.2, binutils 2.19.1, newlib 1.18). All show the same behavior.

Deti

Alex

unread,
Dec 15, 2010, 5:09:59 AM12/15/10
to ml-d...@googlegroups.com
Here are my versions:

BINUTILS=binutils-2.20
NEWLIB=newlib-1.18.0
GDB=gdb-7.2
LIBCMSIS=v1.10-2
LIBSTM32=v3.0.0-1
LIBSTM32USB=v3.0.1-1
LIBOPENSTM32=master

Alex

unread,
Dec 15, 2010, 5:10:50 AM12/15/10
to ml-d...@googlegroups.com
This is my latest build (the one I've used in my tests). Does it show
the same problem on your camera?

On Wed, Dec 15, 2010 at 12:06 PM, Deti <de...@42u.de> wrote:

magiclantern-2010dec15.550d.fw109.PRERELEASE.a1ex.zip

Deti

unread,
Dec 15, 2010, 5:21:15 AM12/15/10
to ml-d...@googlegroups.com
On 12/15/10 11:10 AM, Alex wrote:
> This is my latest build (the one I've used in my tests). Does it show
> the same problem on your camera?
Used a Transcend 16GB class 6 card, deleted all my files, just kept the
diskboot signature, copied all of your files onto the card and...
Yes, it shows exactly the same behavior on two cameras.

Deti

Alex

unread,
Dec 15, 2010, 5:34:44 AM12/15/10
to ml-d...@googlegroups.com
Exact steps? (press this and that and that?)

Deti

unread,
Dec 15, 2010, 5:49:08 AM12/15/10
to ml-d...@googlegroups.com
On 12/15/10 11:34 AM, Alex wrote:
> Exact steps? (press this and that and that?)
1. Format card in camera with low level option checked
2. Insert into USB card read, mount card, copy files form ZIP archive to
mount point, umuont card
3. Set DISKBOOT flag and EOS_DEVELOP name with dd
4. put card into camera, select movie mode, switch camera on, wait some
seconds, switch camera off
5. try to switch camera on again (should fail)

Deti

Alex

unread,
Dec 15, 2010, 6:00:07 AM12/15/10
to ml-d...@googlegroups.com
If I format the card with low level in the camera, my card reader
refuses to read it (no idea why.... it says it's not formatted). My
card reader is integrated into a Windows laptop.

Deti

unread,
Dec 15, 2010, 6:03:28 AM12/15/10
to ml-d...@googlegroups.com
On 12/15/10 12:00 PM, Alex wrote:
> If I format the card with low level in the camera, my card reader
> refuses to read it (no idea why.... it says it's not formatted). My
> card reader is integrated into a Windows laptop.
It should not make any difference if this option is checked - wanted to
make clear that no data from my previous experiments remained on the card.

Deti

Alex

unread,
Dec 15, 2010, 6:07:36 AM12/15/10
to ml-d...@googlegroups.com
Maybe I should just include a default magic.cfg in the release.

Deti

unread,
Dec 15, 2010, 6:17:36 AM12/15/10
to ml-d...@googlegroups.com
On 12/15/10 12:07 PM, Alex wrote:
> Maybe I should just include a default magic.cfg in the release.
Yes, maybe you should, but may it's also worth digging deeper into this
weird behavior as it could point to a memory corruption or something
similar.
Is there any way to find out if there is a difference in the hardware
between our cameras. So if there are different 550D models out there I
think displaying some kind of system signature could give the users and
developers a hint when facing such weird problems.

Deti

Alex

unread,
Dec 15, 2010, 6:48:23 AM12/15/10
to ml-d...@googlegroups.com
That's right; I've tried to look at the source code, but can't find
anything suspect by offline inspection.

In order to fix this, I (or other developers) have first to reproduce
the issue. Did anyone else try to look at this?

Alex

unread,
Dec 15, 2010, 7:49:36 AM12/15/10
to ml-d...@googlegroups.com
Latest source from the repo fixes the config startup message (i.e. if
cfg file is deleted, it says: "config: Magic.cfg: NO").

I don't think this has any influence on the power management problem,
but.. can you test it again?

jb

unread,
Dec 15, 2010, 9:13:35 AM12/15/10
to Magic Lantern firmware development
I have the same behavior with my 550d (1.0.8 and 1.0.9 prerelease), if
there is no config file, it can't be turned back on after sleep or
shutdown.
Maybe just adding in the manual that on some camera a config file is
needed for ML to work properly is enough...

On 15 déc, 13:49, Alex <broscutama...@gmail.com> wrote:
> Latest source from the repo fixes the config startup message (i.e. if
> cfg file is deleted, it says: "config: Magic.cfg: NO").
>
> I don't think this has any influence on the power management problem,
> but.. can you test it again?
>
> On Wed, Dec 15, 2010 at 1:48 PM, Alex <broscutama...@gmail.com> wrote:
> > That's right; I've tried to look at the source code, but can't find
> > anything suspect by offline inspection.
>
> > In order to fix this, I (or other developers) have first to reproduce
> > the issue. Did anyone else try to look at this?
>

de...@42u.de

unread,
Dec 15, 2010, 9:37:55 AM12/15/10
to ml-d...@googlegroups.com
On 12/15/2010 01:49 PM, Alex wrote:
> Latest source from the repo fixes the config startup message (i.e. if
> cfg file is deleted, it says: "config: Magic.cfg: NO").
>
> I don't think this has any influence on the power management problem,
> but.. can you test it again?
Back from the first debugging round: 550D vs. Deti still 1:0

The problem is that calling FIO_Open() at config_parse_file from within
the my_init_task() code. As soon as it returns an error (INVALID_PTR)
the camera is in this broken state.

Another thing: I cannot see the startup message "Magic Lantern v..."
when the camera performs a cold start. I only the message when switching
it on later or by half pressing the shutter button). All of my cameras
need a msleep(550) instead of 500ms.

Please apply the patch attached to this mail to fix the latter problem.

Still we have to investigate what happens when FIO_Open returns an error.

Deti

5d-hack.c.diff

Alex

unread,
Dec 15, 2010, 10:33:47 AM12/15/10
to ml-d...@googlegroups.com
Cold start = with the on/off switch, and hot start = half press shutter?

I can see startup message in all cases. Sometimes it gets overwritten
quickly by Canon drawing code (but I can still see some parts of it).

FIO_Open is a function from Canon file. Maybe the difference is
because I use FAT16 and you use FAT32. I can't install ML on my FAT32
card.

Maybe it's a good idea to check if the file exists before trying to
open it. No idea how to do that...

multimea

unread,
Dec 15, 2010, 9:31:11 AM12/15/10
to Magic Lantern firmware development
So Actually, I had the same issue, but!

I didn't knew ( still don't know ) what write MBR means so I just
clicked on it a few times and everything was okay.

The fourth or fifth time the function just didn't finish. So the
numbers and so on just didn't dissappear, turning off the Cam wasn't
possible, or to say correctly, when I turned it off, nothing happend,
the cam didn't shut down. And I also pressed every button but nothing
happend. So I decieded ( fearing to brick the cam ) to simply pull out
the batterie and put it in.

Everything was ok again, but the issue dissappeard and now ML works
fine.

And according to the discussion, I always had the cfg file on the
card, so I guess the cfg-issue had nothing to do with it

Alex

unread,
Dec 15, 2010, 10:47:04 AM12/15/10
to ml-d...@googlegroups.com
That function is supposed to make the card bootable. But the code
which writes them to the card is commented out. Maybe because it did
not worked.

So...
gui_stop_menu: just turns off the menu.
alloc_dma_memory => this could be something, but I don't think it
makes anything important unless you use that memory
user_block: reads a value with a mask
dm_set_store_level: sets the verbosity level of debug logs
cache: I don't think that changes anything to cam memory..

Therefore, it seems this function only prints debug info on the screen.
=> stil clueless...

void
bootflag_write_bootblock( void )
{
gui_stop_menu();

bmp_printf( FONT_SMALL, 0, 30, "cf=%08lx sd=%08lx",
(uint32_t)sd_device[0], (uint32_t) sd_device[1]);

struct cf_device * const dev = sd_device[1];


uint8_t *block = alloc_dma_memory( 0x200*0x40 );
uint8_t * user_block = (void*)((uintptr_t) block & ~0x40000000);
int i;
DebugMsg(DM_MAGIC, 3, "%s: buf=%08x", __func__, (uint32_t)block);
for(i=0 ; i<0x200 ; i++) block[i] = 0xAA;
bmp_printf( FONT_SMALL, 0, 40, "mem=%08lx read=%08lx",
(uint32_t)block, (uint32_t)dev->read_block );
bmp_hexdump( FONT_SMALL, 0, 250, sd_device[1], 0x100 );

dm_set_store_level(0x23, 0);
int rc = dev->read_block( dev, block, 0x0, 0x40 );
clean_d_cache();
flush_caches();


dm_set_store_level(0x23, 3);
DebugMsg(DM_MAGIC, 3, "%s: rc=%d %08x %08x", __func__,
rc,
*(uint32_t*) &user_block[0x47],
*(uint32_t*) &user_block[0x5C]
);
msleep( 100 );

bmp_printf( FONT_MED, 600, 40, "read=%d", rc );
bmp_hexdump( FONT_SMALL, 0, 60, user_block, 0x100 );

/*
// Update the first partition header to include the magic
// strings
my_memcpy( block + 0x47, (uint8_t*) "EOS_DEVELOP", 0xB );
my_memcpy( block + 0x5C, (uint8_t*) "BOOTDISK", 0x8 );

rc = dev->write_block( dev, 0x0, 1, block );
bmp_printf( FONT_MED, 600, 60, "write=%d", rc );
free_dma_memory( block );
*/
}

de...@42u.de

unread,
Dec 15, 2010, 12:33:12 PM12/15/10
to ml-d...@googlegroups.com
On 12/15/2010 04:33 PM, Alex wrote:
> Cold start = with the on/off switch, and hot start = half press shutter?
I think there is a little difference between starting initially after
putting in the battery and every other startup. For some reason the
timing differs in these two scenarios with my cameras.

> I can see startup message in all cases. Sometimes it gets overwritten
> quickly by Canon drawing code (but I can still see some parts of it).

Well, maybe it's just the difference between FAT16 and FAT32.

> FIO_Open is a function from Canon file. Maybe the difference is
> because I use FAT16 and you use FAT32. I can't install ML on my FAT32
> card.

Found a small 2GB card that could be formatted with FAT16. I can
confirm, that in this case the FIO_Open function works properly. Now
it's just a question why there is a difference.

> Maybe it's a good idea to check if the file exists before trying to
> open it. No idea how to do that...

I would include an empty magic.cfg file into the distribution which
fixes the issue for most users.

In the meantime I tried to use a Transcend 32GB Class 10 card which did
not work at all. The camera boots up only half (focus on half pressed
shutter works, display stays dark, nothing else seems to work). Should
try to write a logfile to the card to find out where boot process gets
stuck.

Deti

Alex

unread,
Dec 15, 2010, 12:42:51 PM12/15/10
to ml-d...@googlegroups.com
At least you've located the bug, and that's great!

I've already included a small magic.cfg in the zip archive.

Piers

unread,
Dec 15, 2010, 8:12:41 PM12/15/10
to ml-d...@googlegroups.com
Back when we didn't have menus (or an agreed upon name for magic.cfg), any failure to read the config file left my camera like that. Since then I've always had a magic.cfg and an mlantern.cfg on my testing card.

Alex

unread,
Dec 18, 2010, 1:30:25 PM12/18/10
to Magic Lantern firmware development
I was just able to install ML on my 16 GB card and confirm the issue.
It seems it's NOT due to opening an inexistent file. That's because,
with default config, ML tries to open "cropmark.bmp" which was not on
my card. And even with this file i/o error, power management works
well.

So, only starting ML without config file is problematic.

Alex

unread,
Dec 18, 2010, 4:09:18 PM12/18/10
to Magic Lantern firmware development
... I think I've just found the fix!

Now waiting for camera to enter standby mode...

Alex

unread,
Dec 18, 2010, 4:10:35 PM12/18/10
to Magic Lantern firmware development
Success! Deti, please test it.

On Dec 18, 8:30 pm, Alex <broscutama...@gmail.com> wrote:

Alex

unread,
Dec 18, 2010, 5:06:52 PM12/18/10
to Magic Lantern firmware development
... whoops... that broke the case when starting WITH config file.
What's going on here?!

Deti

unread,
Dec 18, 2010, 5:15:06 PM12/18/10
to ml-d...@googlegroups.com
Well for now it works here with or without a config file (32GB class 10
card). But it also shows that something is extremely timing sensitive or
even dependent on code location. If it's latter then we have to find out
if we face a memory corruption or something similar.

Deti

Reply all
Reply to author
Forward
0 new messages