Free memory, filesystem and bracketing on ML 550D

17 views
Skip to first unread message

nandoide

unread,
Oct 26, 2010, 11:18:26 AM10/26/10
to Magic Lantern firmware development
Hi, I've just joined to the group and firstly I want to send you my
congratulations for the job done to date. It's impressive.

Some days ago, I compiled the source trunk for 550D, and I was trying
to get the right behaviour of the graphics functions (zebra,
cropmaks, ...).

And bad news related to malloc. I try to get the cropmarks doing their
job and I see that it's not possible to allocate enough memory to
contain the bmp.

Nor the cropmarks.bmp (around 350 KB) , nor simply a few KB (around 50
KB = a ZX Spectrum :-( )

Really it's not a problem for the cropmarks, because it's posible to
implement that function by means of drawing lines (as CHDK does with
grids), but we have very few memory to deal
with from the whole Magic Lantern software and a possible source of
problems (integrate lua, python, more tasks, ...)

Last year I was working on CHDK port of Powershot SX200IS (tuning the
graphics routines, drawing primitives, zebra, edgeoverlay, grids, ...)
and designing a configurable bracketing lua script (not public yet),
and memory was one major concern to CHDK stability and one of my
biggest headaches (of course canon software doesn't known that ML or
CHDK are here).

Do you know it's possible that any of the memory regions that reboot.c
sets, has incorrect addresses?

Free memory on powershot SX200IS (with CHDK running) was about 100K to
300K.

Another bad news is the filesystem, from first experiments:

* Only 8 characters reserved to filename (yet know, and not a problem
really).
* Create file creates another file with the same name on the fs (?).
* Open file for write doesn't delete previous data (?).
* No append mode (or not known append mode, to me).

An the good news.

* It's pretty stable. ML seems less prone to interactions with canon
SW that CHDK has (menus vanishing, file descriptors vanishing, ... ).
Start is speedy and it's no necessary to write-protect the memory card
to autoboot (as in CHDK).

* I'm working on a new task that combines (configurable) interval
bracketing, focus bracketing and exposure bracketing. I have some
problems because I'm not getting the menus alive nor hooking any key,
but I'm on the way for don't need the ML menus ... I expect.

Regards:

nandoide

arm.indy

unread,
Oct 26, 2010, 3:33:43 PM10/26/10
to Magic Lantern firmware development
welcome Nandoide!

we are currently working on understanding menu, dialogs and events.
see gui.h and gui.c
for menu, Trammel / ML is not using DryOS dialogs, but directly write
into video ram.

you already visited AJ 2.0.4 page (which indexes most Wiki pages) and
children pages I suppose...

do you have IDA, a dump and the IDC database applied ?

Indy

Antony Newman

unread,
Oct 26, 2010, 7:10:40 PM10/26/10
to ml-d...@googlegroups.com
Yes - Welcome Nandoide.

As AI mentioned I've put links in the top of the AJ 2.0.4 page to most of what Indy and Alex are working on.

ML: Dryos.c:  cstart() replaces the Page configurations that (I believe) your current camers DryOs would setup.
If you camera has a different amount of RAM / ROM - you may need to modify this.

I wouldn't recommend writing to all locations just to see if you can ... as that may overwrite Non Volatile Memory.
Reading from the Memory locations should be safe - and help you confirm that all the memory in each segment Exists.

Regards,
Antony



arm.indy

unread,
Oct 27, 2010, 2:04:06 AM10/27/10
to Magic Lantern firmware development
Nandoide,

are you using FIO_* file functions ?

are you using malloc() or AllocMemmory() ?

could you give us more details about your experiments ?

See http://magiclantern.wikia.com/wiki/Memory_map for 7d and 5dm2
memory settings.
i'll take a look at 550d ones this evening.

Indy

arm.indy

unread,
Oct 27, 2010, 4:40:58 PM10/27/10
to Magic Lantern firmware development

nandoide

unread,
Nov 2, 2010, 2:37:57 PM11/2/10
to Magic Lantern firmware development
I will try AllocateMemory instead of malloc, as suggested by arm.indy.


Thanks.



Alex

unread,
Dec 6, 2010, 8:03:42 AM12/6/10
to Magic Lantern firmware development
AllocateMemory works, and cropmarks bmp is loaded. Log says:

[Magic] Cropmarks: 720x480 @ 8

Still trying to get it displayed on the screen...

On Nov 2, 8:37 pm, nandoide <nangdo...@gmail.com> wrote:
> I will tryAllocateMemoryinstead of malloc, as suggested by arm.indy.
>
> Thanks.

Alex

unread,
Dec 6, 2010, 8:28:21 AM12/6/10
to Magic Lantern firmware development
Cropmarks almost work, yay! It seems the palette is different from the
5D, though.

Soon we'll have a new experimental release for 550D :)

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

DSCF2685.JPG

Alex

unread,
Dec 6, 2010, 4:18:00 PM12/6/10
to Magic Lantern firmware development
Found the bug (it was in my testing code). Now I have to draw
cropmarks only when the camera is in Live View mode (because now it
overwrites Canon menus). Any ideas on how to detect that?

Alex

unread,
Dec 6, 2010, 5:10:41 PM12/6/10
to Magic Lantern firmware development
It seems that the pixels are square on 550D (they don't have the 0.9:1
aspect ratio like on 5D2). I've tested with my fisheye cropmarks
(http://magiclantern.wikia.com/wiki/Cropmarks), which were aligned
perfectly with straight lines (without any aspect ratio correction).

Also, I've been able to draw the entire cropmark, including scanlines
0-40 and 370-480. There's a small problem at scanline 0 (it displays
random pixels).

There was a variable, lv_drawn, which was true when camera was in live
view mode (and cropmarks should be drawn). It was computed correctly,
but was not used in the code. After enabling it, cropmarks are only
drawn in live view mode (it does not overwrite the menus or the main
display with shooting settings).

Alex

unread,
Dec 7, 2010, 12:50:40 PM12/7/10
to Magic Lantern firmware development
Here's my first experimental build of Magic Lantern for 550D/1.0.8:

https://bitbucket.org/a1ex/magic-lantern/

You can find both binary (zip) and source code. Make sure you have the
correct firmware version before running it!

This build has the following features (some of them are misfeatures):
- cropmarks work, are displayed full-screen and only in Live View mode
(do not overlap Canon menus)
- two cropmarks available for testing (in the zip file); select them
from magic.cfg, option "crop.file"
- camera does not freeze on restart
- it is possible to download photos with the USB cable; HDMI might
work, too (i.e. same behavior as original Canon firmware)
- audio meters are disabled
- Piers' audio tweaks are not included; I'll do that as soon as I'll
have his source code.

I've tested this build on my camera, but there's still a small risk,
so if it breaks, you get to keep both pieces.

Please test it and report the results here.

Enjoy!


On Dec 7, 12:10 am, Alex <broscutama...@gmail.com> wrote:
> It seems that the pixels are square on 550D (they don't have the 0.9:1
> aspect ratio like on 5D2). I've tested with my fisheye cropmarks
> (http://magiclantern.wikia.com/wiki/Cropmarks), which were aligned
> perfectly with straight lines (without any aspect ratio correction).
>
> Also, I've been able to draw the entire cropmark, including scanlines
> 0-40 and 370-480. There's a small problem at scanline 0 (it displays
> random pixels).
>
> There was a variable, lv_drawn, which was true when camera was in live
> view mode (and cropmarks should be drawn). It was computed correctly,
> but was not used in the code. After enabling it, cropmarks are only
> drawn in live view mode (it does not overwrite the menus or the main
> display with shooting settings).
>
> On Mon, Dec 6, 2010 at 11:18 PM, Alex <broscutama...@gmail.com> wrote:
> > Found the bug (it was in my testing code). Now I have to draw
> > cropmarks only when the camera is in Live View mode (because now it
> > overwrites Canon menus). Any ideas on how to detect that?
>
> > On Mon, Dec 6, 2010 at 3:28 PM, Alex <broscutama...@gmail.com> wrote:
> >> Cropmarks almost work, yay! It seems the palette is different from the
> >> 5D, though.
>
> >> Soon we'll have a new experimental release for 550D :)
>
Reply all
Reply to author
Forward
0 new messages