supplierdeeply

EOS M3 porting

  • 497 Replies
  • 175424 Views
*

Offline srsa_4c

  • ******
  • 3728
Re: EOS M3 porting
« Reply #10 on: 07 / September / 2015, 17:40:26 »
Advertisements
But I can't find analog of sub_fc060338_my function, that is called from sub_fc04f72a_my = [email protected] There is a loopback on [email protected]
Correct, the routine we usually call "startupchecks" simply returns 1 here. Therefore, remove the C code from the start of sub_fc062f48().
Waterwingz is right: you need to boot the camera with minimal changes to the build boot process.
That means:
- remove the CreateTask replacement
- you need the Canon heap related modification, so those lines should stay
- the last modified piece of code should be sub_fc06347d_my, where the only change that should stay is the removal of the startdiskboot routine sub_fc0637b2. Remove the physw modification and don't start spytask.

If the camera boots and doesn't halt and doesn't crash with the above modification, you can continue.

This camera is substantially different from the sx280, because
- it has a "subcpu", most likely a tx19
- there is code copied to and executed from the memory range above 0xbfe10800. For example, CreateTask seems to live there. This comes in addition to the usual DryOS kernel area which starts at 0x10e1000 here.
I still see 3 DryOS images in the ROM, so I suspect the 2 ARM cores still run separate operating systems.

You may want to execute the cpuinfo_get_info() function you can find here: https://www.assembla.com/spaces/chdk-s1/subversion-11/source/HEAD/trunk/modules/cpuinfo_v7.c from an AdditionAgentTask-based little program, save the returned block of memory to file and evaluate it by hand or by using the other cpuinfo routines. Would be interesting to see the differences to sx280.
« Last Edit: 07 / September / 2015, 17:49:26 by srsa_4c »

*

Offline Ant

  • ****
  • 369
Re: EOS M3 porting
« Reply #11 on: 07 / September / 2015, 18:10:05 »
I commented calls of exp_drv_task, CreateTask_spytask, mykbd_task.
Now camera turns on, but with "Memory card locked" message. Orange LED turns on when I switch camera from shooting to playback mode.
It's enough  for today...

Re: EOS M3 porting
« Reply #12 on: 07 / September / 2015, 18:19:09 »
Now camera turns on, but with "Memory card locked" message.
Assuming you are booting via SD card lock,  that message stays until you get the keyboard task to run and mask the SD card lock switch.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: EOS M3 porting
« Reply #13 on: 08 / September / 2015, 03:22:33 »
@Ant: I would be happy to help for the port, please let me know.


*

Offline Ant

  • ****
  • 369
Re: EOS M3 porting
« Reply #14 on: 09 / September / 2015, 16:42:21 »
I've commented kbd_process call in kbd_update_key_state function and now mykbd_task works. SD card lock switch is already masked.

Now I am trying to call LCDMsg_Create and LCDMsg_SetStr functions from mykbd_task for debugging purposes - it does not work.
Can anybody post here examples of using these functions from C code?

Re: EOS M3 porting
« Reply #15 on: 09 / September / 2015, 17:29:58 »
Now I am trying to call LCDMsg_Create and LCDMsg_SetStr functions from mykbd_task for debugging purposes - it does not work.
Can anybody post here examples of using these functions from C code?
If you look down at the bottom of main.c,  there is a little bit of code for printing out debug messages on the screen that is #defined out.    If you enable that,  you should get what you need ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Ant

  • ****
  • 369
Re: EOS M3 porting
« Reply #16 on: 09 / September / 2015, 17:48:09 »
To use it I need to make core_spytask working. Now it crashes my camera.
Previously I was calling LCDMsg functions from binary loaded by function AdditionAgentRAM() in script.

*

Offline srsa_4c

  • ******
  • 3728
Re: EOS M3 porting
« Reply #17 on: 09 / September / 2015, 19:26:46 »
Previously I was calling LCDMsg functions from binary loaded by function AdditionAgentRAM() in script.
The very same method should work. If it doesn't, you might be encountering the same issue other DIGIC 6 porters appear to be experiencing: something corrupts RAM. Since I don't appear to suffer from that, some of you will have to find out what's going on.
My recommendation is that you should try to load the CHDK core somewhere else, not at the start of the original Canon heap. If the core's size fits in 0x22000 bytes, you could set MEMISOSTART in the port's makefile.inc to the start of the AdditionAgent RAM area.
Since I don't see your source, make sure you call sub_fc1300b2 in the loader for the area occupied by the CHDK core (this is what I call "caching related function" in my notes).


*

Offline Ant

  • ****
  • 369
Re: EOS M3 porting
« Reply #18 on: 11 / September / 2015, 12:33:19 »
I still trying to make LCDMsg works:

Code: [Select]
void save_romlog2(void)
{
    unsigned args[3];
unsigned message;
    args[0] = (unsigned)"SystemEventInit";
call_func_ptr(_ExecuteEventProcedure,args,1);
args[0] = (unsigned)"UI.CreatePublic";
call_func_ptr(_ExecuteEventProcedure,args,1);
args[0] = (unsigned)"System.Create";
call_func_ptr(_ExecuteEventProcedure,args,1);
args[0] = (unsigned)"Driver.Create";
call_func_ptr(_ExecuteEventProcedure,args,1);

args[0] = (unsigned)"BeepDrive";
args[1] = (unsigned) 0x02;
call_func_ptr(_ExecuteEventProcedure,args,2);

args[0] = (unsigned)"LCDMsg_Create";
message = call_func_ptr(_ExecuteEventProcedure,args,1);

args[0] = message;
args[1] = (unsigned)"Hello World";
call_func_ptr(_ExecuteEventProcedure,args,2);

    args[0] = (unsigned)"GetLogToFile";
    args[1] = (unsigned)"A/ROMLOG.LOG";
    args[2] = 1;
    if (call_func_ptr(_ExecuteEventProcedure,args,3) != -1)
    {
  *(int*)0xd20b0810  = 0x4d0002; // Orange Led = on
    }
}

BeepDrive and GetLogToFile procedures work fine, but there is no messages on LCD
« Last Edit: 11 / September / 2015, 12:36:25 by Ant »

*

Offline srsa_4c

  • ******
  • 3728
Re: EOS M3 porting
« Reply #19 on: 11 / September / 2015, 12:51:20 »
I still trying to make LCDMsg works:

Code: [Select]
args[0] = (unsigned)"LCDMsg_Create";
message = call_func_ptr(_ExecuteEventProcedure,args,1);

args[0] = message;
args[1] = (unsigned)"Hello World";
call_func_ptr(_ExecuteEventProcedure,args,2);
That isn't correct. You have already seen this page: http://chdk.wikia.com/wiki/User:Srsa_4c/Event_procedure_research, please take another look.
- LCDMsg_Create needs arguments, you can even pass a string to it
- the second ExecuteEventProcedure call above makes no sense: you're trying to pass an integer to it for execution  :blink:
The first argument of ExecuteEventProcedure is a string (the event procedure's name).

 

Related Topics