EOS M100 porting - page 3 - DryOS Development - CHDK Forum

EOS M100 porting

  • 199 Replies
  • 70919 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: EOS M100 porting
« Reply #20 on: 02 / October / 2020, 18:25:36 »
Advertisements
Attached is another source snapshot. I'm publishing it because it uses "ROM" modifications (currently two 64kB pages of ROM are replaced with a modified RAM copy). The conversion of platform code is only partially done, so much of the usual copied firmware code is still there.
I'm currently using a suspected free space that I found next to the "Lime" code blob that loads to 0x1040000. That space is between 0x11A0440 ... 0x1340000. "Lime" is the Xtensa CPU used for networking.
The port hasn't improved much over the last published version, so I'm still not posting binaries.

A few words about remapping ROM.
This happens at boot time, in platform/m100/sub/100a/boot.c, in the function setup_mmu_for_chdk(). A bunch of firmware functions (with rather lame names) are also used in that function, their purpose is to update CPU caches and branch predictor. The function addresses can be found in stubs_entry_2.S. Anybody looking for them can find them in a disassembly - the 0xdffxxxxx routines are in a copied blob, the blob can be found by looking at the "Detected address ranges" info in stubs_entry.S. A file named platform/m100/sub/mmuutils.c is a library with MMU-related routines and helper macros.

The ARM CPU related library routines are identical in DIGIC 7 and 8 cameras (PowerShot and EOS). A copy of 100a ROM can be found here.

edit:
added a source files only archive (for those not wishing to deal with patches or compiling the source)
« Last Edit: 03 / October / 2020, 16:02:56 by srsa_4c »

*

Offline c_joerg

  • *****
  • 1251
Re: EOS M100 porting
« Reply #21 on: 03 / October / 2020, 09:55:12 »
This happens at boot time, in platform/m100/sub/100a/boot.c, in the function setup_mmu_for_chdk().
Where can i find boot.c for m100?
Here is no m100 platform
https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/platform/
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline srsa_4c

  • ******
  • 4451
Re: EOS M100 porting
« Reply #22 on: 03 / October / 2020, 16:01:49 »
Where can i find boot.c for m100?
Here is no m100 platform
https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/platform/
Correct. I did not add the files to svn because the port is not "there" yet. I added an archive with loader and platform files to that post. If you do want to compile, you need to apply the patch to trunk source.

*

Offline c_joerg

  • *****
  • 1251
Re: EOS M100 porting
« Reply #23 on: 03 / October / 2020, 17:24:16 »
If you do want to compile, you need to apply the patch to trunk source.


I tried...


Code: [Select]
shooting.c:138:3: error: 'MODE_HDR_BACKLIGHT_CTRL' undeclared here (not in a function)
 { MODE_HDR_BACKLIGHT_CTRL   ,32846 }, // hdr backlight control
   ^
gmake[1]: *** [shooting.o] Error 1
gmake: *** [all-recursive] Error 1
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


*

Offline srsa_4c

  • ******
  • 4451
Re: EOS M100 porting
« Reply #24 on: 03 / October / 2020, 18:03:04 »
I tried...


Code: [Select]
shooting.c:138:3: error: 'MODE_HDR_BACKLIGHT_CTRL' undeclared here (not in a function)
 { MODE_HDR_BACKLIGHT_CTRL   ,32846 }, // hdr backlight control
   ^
gmake[1]: *** [shooting.o] Error 1
gmake: *** [all-recursive] Error 1
Patch == diff, the first file attached.
But you might be better off making the rest of changes by hand. Find the file indicated after "Index:", remove lines prefixed by -, add lines prefixed by +. Do not copy the prefix itself.
Code: [Select]
Index: core/conf.c
===================================================================
--- core/conf.c (revision 5575)
+++ core/conf.c (working copy)
@@ -1640,7 +1640,8 @@
        || (m == MODE_SPORTS)            // True if Sports mode (SX280HS, multiple issues with raw buffer; storing raw makes little sense in this mode anyway)
 #endif
 #if defined(CAM_DISABLE_RAW_IN_HDR)
-       || (m == MODE_HDR)            // True if HDR mode (G7X)
+       || (m == MODE_HDR)                // True if HDR mode (G7X)
+       || (m == MODE_HDR_BACKLIGHT_CTRL) // True if HDR backlight control mode (M100)
 #endif
     );
 }
Index: include/modelist.h
===================================================================
--- include/modelist.h (revision 5575)
+++ include/modelist.h (working copy)
@@ -123,6 +123,7 @@
     MODE_ZOOM_BLUR          , // ixus990_sd970 "The optical zoom operates automatically during shooting"
 
     MODE_PANNING            , // G7X2
+    MODE_HDR_BACKLIGHT_CTRL , // hdr backlight control, m100
 
 };

*

Offline c_joerg

  • *****
  • 1251
Re: EOS M100 porting
« Reply #25 on: 04 / October / 2020, 04:57:24 »
But you might be better off making the rest of changes by hand.
Many Thanks… :) :) :)
I got CHDK working on my M100. It really works a lot. I haven't had a crash yet. The M100 with its many limited features will benefit greatly from CHDK.Would it be risky to modify and run M3M10_Focus.lua?
Patch == diff, the first file attached.
I understood that in principle. I'm just not that familiar with the tool chain. Is there somewhere a description of how to create and use the diff?
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline srsa_4c

  • ******
  • 4451
Re: EOS M100 porting
« Reply #26 on: 04 / October / 2020, 18:16:06 »
I got CHDK working on my M100. It really works a lot. I haven't had a crash yet.
Cool. Let me know if that changes.
Quote
Would it be risky to modify and run M3M10_Focus.lua?
I made a modified one December last year, attached.
Quote
Is there somewhere a description of how to create and use the diff?
From command line, "svn diff" and "svn patch". Or you could install a GUI svn client (there's this for Windows). I don't have time for longer explanation, sorry.

I continued the transition to ROM-patch based source. At first, it crashed during boot. Then I realized I'm changing code/data inside CHDK core, so I put in an extra cache clean for that area too. Now it works, hopefully it will continue doing so. Combined archive attached.

*

Offline c_joerg

  • *****
  • 1251
Re: EOS M100 porting
« Reply #27 on: 05 / October / 2020, 02:09:23 »
I made a modified one December last year, attached.

Thanks.
You made the changes on version 0.4.
I have already posted version 0.5 here. But I can merge it.
https://chdk.setepontos.com/index.php?topic=13756.msg142784#msg142784

From command line, "svn diff" and "svn patch". Or you could install a GUI svn client (there's this for Windows). I don't have time for longer explanation, sorry.
It’s fine. Something to start with…

I've tried rawopint.lua and MDFB2013.lua. Works very well on the usual. The only thing that I notice is that the optical temperature is higher than that of the sensor. I guess they are reversed.
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: EOS M100 porting
« Reply #28 on: 06 / October / 2020, 13:38:13 »
 :)  :D  :-*
Code: [Select]
--- Modelist ---@ 0
PS12  PID:13009
0 0 IS0 ND0 (0)<1
m100-100a-CHDK_DE-1.5.0-5570
M5 SD5 Dm0 Mm2 F0 AF1L0
A/DCIM/204___10/Img_0972
:---=----=--+-=----=----
1 AUTO
2 P
3 TV
4 AV
5 M
12 CREATIVE_EFFECT
19 FISHEYE
21 HDR
26 LANDSCAPE
30 MINIATURE
31 MONOCHROME
33 NIGHT_SCENE
36 PORTRAIT
42 SOFTFOCUS
43 SPORTS
48 TOY_CAMERA
61 VIDEO_STD
63 VIDEO_TIME_LAPSE
64 HYBRID_AUTO
69 VIDEO_M
71 ART_BOLD
72 WATERPAINTING
73 CLOSEUP
74 FOOD
75 SELFIE
79 ??? Unknown ???
2020/10/6 # 17:35:20 ---
-26 ----- 2 Sec -----
Code: [Select]
---#Helperl ~ LOG_973.TXT
1@ PS12  PID:13009
m100-100a-CHDK_DE-1.5.0-5570
M5 SD5 Dm0 Mm2 F0 AF1L0
A/DCIM/204___10/Img_0972
0 IS0 ND0 (0)<1
2020/10/6 # 17:38:25 ---
°C Opt.37, CCD:31, Bat:30
700ms ((100003))1 5541mV$
972/ Bat:7650mV -74
With reloaded battery I´ll look again. (Ubasic-Voodoodetector, tiny variation...)
...happens together with gk.log.
Code: [Select]
Exception!! [data abort]
 -> Write Access (0x00000000)
Occured Time  2020:10:06 16:52:41
ISR : vector=27
< Exc Registers >
R 0  : 0x40F0403D
R 1  : 0x00000000
R 2  : 0x00001000
R 3  : 0x00000000
R 4  : 0x40F0403D
R 5  : 0x00000000
R 6  : 0x40F0403D
R 7  : 0x00000000
R 8  : 0x00000000
R 9  : 0xE05B0AB4
R10  : 0x00000000
R11  : 0x00000000
R12  : 0x00000000
R13  : 0x002B07A0
R14  : 0xE0028277
PC   : 0x40F534AC
CPSR : 0x000001F3
DFSR : 0x00000807
IFSR : 0x0000000F
FAR  : 0x00000000
IFAR : 0x50FD6D1F
< StackDump >

M100-100a-CHDK_DE-1.5.0-5570-13009
 
Exception!! [data abort]
 -> Write Access (0x0000023D)
Occured Time  2020:10:06 20:56:33
ISR : vector=6
< Exc Registers >
R 0  : 0x40F0403D
R 1  : 0x00000000
R 2  : 0x00001000
R 3  : 0x0000023D
R 4  : 0x40F0403D
R 5  : 0x00000000
R 6  : 0x40F0403D
R 7  : 0x00000020
R 8  : 0x00000000
R 9  : 0xE05B0AB4
R10  : 0x00000000
R11  : 0x00000000
R12  : 0x00000000
R13  : 0x002B07A0
R14  : 0xE0028277
PC   : 0x40F53706
CPSR : 0x200001F3
DFSR : 0x00000807
IFSR : 0x0000040F
FAR  : 0x0000023D
IFAR : 0x54FD6D17
< StackDump >

... zoom_keys not defined  :haha  I enjoy the wheel...
« Last Edit: 06 / October / 2020, 16:16:24 by Caefix »
All lifetime is a loan from eternity.

*

Offline c_joerg

  • *****
  • 1251
Re: EOS M100 porting
« Reply #29 on: 06 / October / 2020, 13:46:00 »
Two things that I notice…

1) The M100 changes its black level from 512 to 2048 at around ISO320. We know that from the G1x and S110

2) With the M100 there is a difference between ISO and sv96 value
The M100 has
ISO100 (sv) => sv96 = 480
All my other cameras have
ISO100 (sv) => sv96= 411
Code: [Select]
sv=sv96_to_iso(sv96_real_to_market(get_prop(props.SV)))
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal