SD 4000 IS / IXUS 300 HS / IXY 30S porting thread - page 2 - DryOS Development - CHDK Forum

SD 4000 IS / IXUS 300 HS / IXY 30S porting thread

  • 322 Replies
  • 180925 Views
*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #10 on: 24 / August / 2010, 19:21:07 »
Advertisements
Some Progress:

Camera does start with CHDK loader and disabled Task Hooks but crashes about 3 seconds later while complaining about Card write protected (because of diskboot).

If Task Hooks (SpyTask) is enabled, depends an combination on regular firmware stuff enabled, CreateTask_spytask and CreateTask_PhySw camera does not show anything on screen and restarts or crash.

If somebody want to join the "fun" and help me with this port i'll give access to my git repository.
« Last Edit: 24 / August / 2010, 19:46:33 by pixeldoc2000 »

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #11 on: 25 / August / 2010, 20:12:55 »
I've played around with Canon Basic and created RomLog script to save Camera ROM log to romlog.txt . This will maybe usefull for every DryOs developer / porter.

With my port  (now with SpyTask enabled) camera does start without chdk logo, flash green led once and shutdown 3 seconds after.
Looks like the problem is related to Mounter.c (possible SD-Card Stuff).

This is romlog.txt created with RomLog after the shutdown.
Code: [Select]
ASSERT!! Mounter.c Line 2516
Occured Time  2010:08:26 01:23:36
Task ID: 17825831
Task name: SpyTask
SP: 0x0038F0E0
StackDump:
0x00000000
0xFF8714C4
0x000009D4
0xFFFFFFFF
0x00000001
0x000001FF
0xFFFFFFFF
0x19980218
0x19980218
0x19980218
0x0038F144
0xFF871F24
0x00020000
0x0019025C
0x000001FF
0xFF86F164
0x00000514
0x000000A7
0x19980218
0x19980218
0x19980218
0x001629A0
0x19980218
0x0038F148
0x00166F31
0x001629A0
0x00162E28
0x00000500
0x00000514
0x000000A7
0x19980218
0x19980218
0x00153F59
0x00154155
0x00000191
0x00000001
0x00154215
0x60000013
0xFFFFFFFE
0x80000013
0x00000000
0x60000013
0x00000032
0x00000001
0x19980218
0x80000013
0x00000000
0x80000013
0x0089543F
0x0088D9FC
0x00000191
0x00000001
0x19980218
0x19980218
0x19980218
0x19980218
0x00000191
0x00000001
0x19980218
0x19980218
0x0014B4CD
0x00373230
0x19980218
0xFF816AEC
0x19980218
0x19980218
0x00001008
ShootConDump:
0f 0f 0f 0f 0f 0f 0f 0f 0f 0f
CameraConDump:
07 0a 02 0f 0f 0f 0f 0f 0f 0f
00000160: *** Camera Log Start ***

00000210: UI:LogicalEvent:0x5006:adr:0,Para:0

00000220: UI:LogicalEvent:0x5001:adr:0,Para:0

00000260: SS:S-Imag

00000260: UI:ScreenLock

00000260: UI:ScreenUnLock

00000270: UI:LogicalEvent:0x300a:adr:0,Para:0

00000270: UI:HDMIConnectCnt

00000270: UI:PB.Create

00000270: UI:DispSwCon_TurnOnBackLight

00000270: UI:TurnOnBackLight

00000430: UI:DispSwCon_MuteOffPhysicalScreen

00000430: UI:MuteOffPhysicalScreen

00000430: UI:LogicalEvent:0x3138:adr:0,Para:0

00000440: UI:LogicalEvent:0x112c:adr:0,Para:0

00000460: UI:ScreenLock

00000460: UI:ScreenUnLock

00000480: UI:PB.CreateE

00000480: UI:AC:StartPB

00000480: UI:DispSwCon_TurnOnDisplayDevice

00000480: UI:AC:EBtn

00000480: UI:PB.Start

00000480: UI:DSIC:47,0

00000480: UI:CC_CompFlhJpg

00000480: UI:_CompFlhJpg

00000480: UI:PB.Flash

00000480: UI:ScreenLock

00000480: UI:LogicalEvent:0x321f:adr:0,Para:0

00000480: UI:DSIC:47,0

00000480: UI:ScreenUnLock

00000490: UI:LogicalEvent:0x320a:adr:0,Para:0

00000990: UI:ScreenLock

00001000: UI:ScreenUnLock

00001000: UI:LogicalEvent:0x3201:adr:0,Para:0

00001000: UI:ScreenLock

00001000: UI:ScreenUnLock

00001010: UI:ScreenLock

00001010: UI:ScreenUnLock

00001010: UI:PB.StartE

00001010: UI:PB.CTG

00001020: UI:PB.DPOF

00001020: UI:DSIC:48,0

00001020: UI:DispSw: Unlock

00001020: UI:DispSwCon:Unlock

00001020: UI:DispSwCon_TurnOnBackLight

00001020: UI:DispSwCon_MuteOffPhysicalScreen

00001020: UI:MuteOffPhysicalScreen

00001020: UI:AC:EnryPB

00001020: UI:AP:ChkCnctUSB

00003010: UI:ScreenLock

00003010: UI:ScreenUnLock

00003010: UI:ScreenLock

00003010: UI:ScreenUnLock
« Last Edit: 25 / August / 2010, 20:43:23 by pixeldoc2000 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #12 on: 26 / August / 2010, 01:12:07 »
Hi pixeldoc2000 ,

I would like to have access to your repository,

I', working on the sx200, and due to the timeline they will probably share stuff, I don't have a repository created, but you can look at my advances here: http://chdk.setepontos.com/index.php/topic,5045.135.html

I have quite adavanced the boot.c and other stuff, but If I enable the CreateTask_spytask it reboots, looks like the same as you

what usefull info can you get from romlog.txt ?
« Last Edit: 26 / August / 2010, 01:16:13 by asm1989 »

Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #13 on: 26 / August / 2010, 05:41:57 »
Hi pixeldoc2000,
I would like to have access to your repository, I want to unite source code for my A3100 and other new cameras in 1 place.
I'm working now with A3100 and already started (restarted) my camera with SpyTask enabled, and had the same problem as you: after 3 seconds camera just crashes. But I think the problem in funcs like gui_redraw(); gui_init(); conf_restore(); ect because of wrong addresses in stubs_<>.s. I comment that funcs, and camera does not crash and works well as with original firmware with spytask. I think first thing we need to do is to find vid_buf addresses at platform/<camera>/sub/<firm ver>/lib.c to enable draw_txt_string() for debugging and "Hello, World!" program and start to check funcs from stubs


*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #14 on: 26 / August / 2010, 06:16:22 »
Ameglin,

I have the same behaivour with sx210, still unfinished, but you can download the platform files here:

http://chdk.setepontos.com/index.php/topic,5045.msg54241.html#msg54241

In my case if I comment  //    conf_restore(); //    gui_init();, it dosnt reboots, donst respond to keybord input, except for playback and it shut it down.
« Last Edit: 26 / August / 2010, 07:08:46 by asm1989 »

Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #15 on: 26 / August / 2010, 07:48:14 »
Try to comment also all things beginning from:
Code: [Select]
if (conf.script_startup==1) script_autostart(); // remote autostartand make while(1) cycle with msleep(20) (for example) at the end of main() (like commented cycle that are going after script_autostart()). May be it help.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #16 on: 26 / August / 2010, 08:49:19 »
Thanks I'm following the aproach of issolating the issue commenting, steep by steep
For example starting with the gui thing:

main.c ->  gui_init(); -> gui.c -> gui_lang_init(); -> gui_lang.c lang_init(GUI_LANG_ITEMS); -> lang.c .....

This way I trace back that one of reestart reasons was the function umalloc(...
I solved this one  finding the right address for NHSTUB(AllocateUncacheableMemory,

« Last Edit: 26 / August / 2010, 09:00:28 by asm1989 »

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #17 on: 26 / August / 2010, 13:18:15 »
Wow, all of a sudden theres some action  ;)

Source is on git://github.com/pixeldoc2000/chdk.git
branch: ixus300_sd4000 and ixus900_sd900 .

I'm using A720 and SD990 as referenz firmware atm. But other ports are usefull too like sx10.

My current status is:
  • spytask() enabled
  • core_spytask_can_start() disabled (if enabled camera crash immediately before Display gets enabled, no CHDK GUI stuff)
  • boot.c is not finished
  • stubs_entry_2.S didn't find all stuff yet

Thanks for all your comments, i'm doing the same thing like disable stuff in core/main.c , platform/<camera>/sub/<firmware>/boot.c .
You can have a look at my source. I've try to comment every finding at the source.

Maybe we should exchange ida.db (please contact me with pm).

Together we might be able to crack it.
« Last Edit: 26 / August / 2010, 13:25:15 by pixeldoc2000 »


*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #18 on: 26 / August / 2010, 13:27:26 »
what usefull info can you get from romlog.txt ?
It depents on your problem. But you can get a ruff idea where its coming from. Look at here for example.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #19 on: 26 / August / 2010, 14:30:40 »
I dont know it it helps but:

 I disabled in core/main.c  -> core_spytask()
//    conf_restore();
In core/gui.c ->void gui_init()
//    load_bad_pixels_list("A/CHDK/badpixel");
//    load_bad_pixels_list("A/CHDK/badpixel.txt");


In core/lang.c
Included a custom strlen function, it fails with found one.
Code: [Select]
int strlen2(const char*);

int strlen2(const char *s)
{
    int x=0;
    while (*s++)
        x++;
    return(x);
}

And replaced     p = strings[num] = umalloc(strlen2(str)+1);
in static void lang_add_string(int num, const char *str) {.......

Also include the correct address in stubs for
NHSTUB(AllocateUncacheableMemory, 0xFF83A658)  //umalloc In sx200 was: FF82780C
NHSTUB(FreeUncacheableMemory, 0xFF83A698)  //ufree sx20 was: FF838E28

It dosnt reboot now.

 

Related Topics