Canon S120 CHDK? - General Discussion and Assistance - CHDK Forum supplierdeeply

Canon S120 CHDK?

  • 7 Replies
  • 279 Views
Canon S120 CHDK?
« on: 22 / May / 2019, 14:48:07 »
Advertisements
Hi,

I have second hand S120 that would be nice to use with CHDK due to its high quality sensor/lens. However CHDK now available for this camera - https://chdk.fandom.com/wiki/S120

Are there any workarounds to get it working or documentation on that? I would be willing to help with S120 port, unless there are some known blockages with it.

I'm also software engineer myself, have some experience with AVR programming, but never investigated how CHDK is being developed, moslty focused on LUA scripting.

Thanks

Re: Canon S120 CHDK?
« Reply #1 on: 22 / May / 2019, 14:52:16 »
I somehow missed older posts on this, but all of them are from 2014/2015, any news on DIGIC6 support for S120 or remaining work to be done?

*

Offline reyalp

  • ******
  • 11902
Re: Canon S120 CHDK?
« Reply #2 on: 22 / May / 2019, 18:18:00 »
I somehow missed older posts on this, but all of them are from 2014/2015, any news on DIGIC6 support for S120 or remaining work to be done?
No one has done an S120 port, but it should be pretty straightforward with the current tools and existing ports of similar generation cameras.

S120 is DryOS R52, like G16 and SX280, so those would be good references to start the port from.

I've had the S120 dump in my test set for the sig finder (https://chdk.fandom.com/wiki/Finsig_thumb2) for a long time, so it most of the matches should be good.
Don't forget what the H stands for.

Re: Canon S120 CHDK?
« Reply #3 on: 23 / May / 2019, 15:33:35 »
Is it something I (no idea on CHDK port process) could help/start or some more experienced CHDK dev is needed?


*

Offline srsa_4c

  • ******
  • 3907
Re: Canon S120 CHDK?
« Reply #4 on: 23 / May / 2019, 18:11:25 »
Is it something I (no idea on CHDK port process) could help/start or some more experienced CHDK dev is needed?
The process itself is simple: you make a copy of a port that is sufficiently close to your cam, then you adapt it to work on your camera.
Copy loader/g16 to loader/s120, platform/g16 to platform/s120. Inside platform/s120/sub, you keep one of the directories and rename it to match your firmware version. Put the firmware dump you got from the dumper script in platform/s120/sub/{your fw version}.
Now, you'll need to go through all files in the s120 directories and adapt their contents to your firmware. For assembly parts, you need to disassemble matching parts of your firmware and then make changes to them like it was done in the original port. You'll also need to get all function / variable addresses that are in stubs_entry_2.S and stubs_min.S files. To do that, you'll probably need a copy of one or more "reference" firmwares from here and disassemble them along with your firmware.

Before you start, you need to set up a toolchain and be able to compile CHDK (any of the existing ports). If you're on Windows, you can use this GUI, but you might need to use the command line if the GUI doesn't support some of the operations. Source is here.

If you're unsure about something, don't be afraid to ask.

Some links:
https://chdk.fandom.com/wiki/Adding_support_for_a_new_camera (more or less outdated)
https://chdk.fandom.com/wiki/Digic_6_Porting

Corrections / additions to above are welcome.

*

Offline reyalp

  • ******
  • 11902
Re: Canon S120 CHDK?
« Reply #5 on: 23 / May / 2019, 22:07:13 »
Is it something I (no idea on CHDK port process) could help/start or some more experienced CHDK dev is needed?
Like srsa_4c says, it's definitely something you can do if you have some development experience. Both the SX60 and SX700 ports were done by people with no prior CHDK development experience.

A few additional comments:
Unless you already own IDA and are familiar with it, I highly recommend Ghidra https://chdk.setepontos.com/index.php?topic=13718.0 for general reversing / hunting down stuff not found by the sig finder.

If you want real time advice, I'm often in the IRC channel #chdk on freenode evenings and weekends US/Pacific time.

Don't forget what the H stands for.

Re: Canon S120 CHDK?
« Reply #6 on: 27 / May / 2019, 08:58:40 »
Thanks.. will slowly start looking into what is this all about :)

Re: Canon S120 CHDK?
« Reply #7 on: 27 / May / 2019, 23:07:18 »
The process itself is simple: you make a copy of a port that is sufficiently close to your cam, then you adapt it to work on your camera.
Copy loader/g16 to loader/s120, platform/g16 to platform/s120. Inside platform/s120/sub, you keep one of the directories and rename it to match your firmware version. Put the firmware dump you got from the dumper script in platform/s120/sub/{your fw version}.
Now, you'll need to go through all files in the s120 directories and adapt their contents to your firmware. For assembly parts, you need to disassemble matching parts of your firmware and then make changes to them like it was done in the original port. You'll also need to get all function / variable addresses that are in stubs_entry_2.S and stubs_min.S files. To do that, you'll probably need a copy of one or more "reference" firmwares from here and disassemble them along with your firmware.
As the risk of shedding light where there is no darkness, what helps a lot is a reference port having comments in its code that tell you a bit about how the various #define values & routines were found. Sometimes there might be a note about how it matches a different port and sometimes a note about how it's different. The G16 port (and many others) was pretty much done that way so it's probably not a bad reference for an S120 port.

So .. as you do the S120 port, adding detailed comments about what you've found to help the next person will be most appreciated. At a minimum, please removed unrelated / unverified comments that show up as you c&p source.

TIA  8)
Ported :   A1200    SD940   G10    Powershot N    G16


 

Related Topics