Attached is a patch against the trunk r5708 which cleans up some of these things:
enable bss initialization in main.c
correct NULL_SUB
remove auto-identified stubs from stubs_entry_2.S and stubs_min.S
generate firmware_crc_data.h
OK, I have applied your patch to my current changes and it doesn't seem to change much of the behavior. I still do not see a "CHDK" logo on start and the camera only boots to preview mode. The camera also seems to crash after 10+ seconds when switching to shooting mode.
To find the remaining unknown functions and variables, I highly recommend the Ghidra version tracking tool: https://chdk.fandom.com/wiki/Ghidra_Version_Tracking_workflow_for_porting
Thanks for the help with this, I will take a closer look at the version tracking tool.
What I'd be interested it at moment would be to have full exposure control in video mode and to have a liveview (clean) output via hdmi. Are those possible directly from CHDK ? or if not, is it possible to have them with lua scripts?
It looks like full exposure control is indeed a feature of CHDK (
https://chdk.fandom.com/wiki/Manual_Exposure_Control_for_Video_Recording). However, we have yet to get any of the features full working on the G1X2 other than some basic bootloading and code injection.
Regarding the clean HDMI output of live view, since this camera doesn't support any form of live view HDMI output, I suspect that this would be very unlikely to be supported on this or any camera right now. Someone with more insight into the features and roadmap might know for certain if this is an existing feature, planned feature or if it's even possible.
Is the code at this state testable on camera? if yes, where I can find some tips on what to do with your patches and mount it on camera?
Currently, we are able to inject custom firmware and code to take control of the camera, which is very exciting, but so far the build is very unstable and functionally unusable. Until we can get some of the core features to load properly, the build is useless. Keep your eyes peeled on this thread for updates on the status of the development. You can even help down the road with more in-depth QA and user testing to ensure stability when certain features are used.
One way you can help right now is by trying to identify the current firmware version your camera is on, there are several ways to do this but I think this was the guide I followed:
https://chdk.fandom.com/wiki/CHDK_for_Dummies#How_to_check_the_firmware_version_of_a_Canon_P.26S_cameraThanks for reaching out and letting me know you are interested in the port, it helps knowing that there are others out there who would benefit from this work!