Compatibility check is active by default starting with CHDK 1.5 (current development trunk).
In case of problems, it can be disabled in the build by defining
OPT_DISABLE_COMPAT_CHECK=1 in
localbuildconf.inc or on the command line.
The following is mandatoryThe port's
bin_compat.h header (it's in the
platform/CAM/sub/FW/ directory) needs to be correct.
bin_compat.h is created automatically during build: see the lines following 'bin_compat.h:' in
platform/makefile_sub.inc. Since
bin_compat.h is not added to svn, its content can only be verified after building CHDK.
If - for some reason - it's not generated correctly, it can be overridden with a manually created file named
bin_comp_fix.h (this one has to be placed in
platform/CAM/sub/FW/ and added to svn).
bin_comp_fix.h is needed if any of the following is true:
-
stubs_entry.S is not created (missing sigfinder support or incomplete firmware dump)
- the port supports more than one camera model
an example (sx280 102c, supporting 3 models and 2 fw versions):
ver_sig_t ver_sigs[]={
{(const char *)0xfc142895, "GM1.02C"},
{(const char *)0xfc142895, "GM1.02D"},
};
pid_sig_t pid_sigs[]={
{(short *)0xfdf60040, 12895}, // sx280hs
{(short *)0xfdf60040, 12896}, // sx270hs
{(short *)0xfdf60040, 12899}, // sx275hs
};The entries in
ver_sigs[] are: firmware version string, ROM address of the fw version string
The entries in
pid_sigs[] are: camera model's "platform ID" and its location in ROM. Warning: the address used here has to be available on all models that use the same dancingbits encoding
and ARM architecture.
In the port's loader, following is required:
For DIGIC II, III, 4, 4+ and 5, the code in
loader/CAM/entry.S should start with these two instructions
LDR SP, =MEMBASEADDR
BL check_compatFor DIGIC 6, the
check_compat() function can instead be called in
loader/CAM/main.c, as in the sx280 port.
The rest is optional, but highly encouragedIncompatible builds can blink on the camera if the following information is available:
-
BLINK_LED_CONTROL is defined in
platform/CAM/makefile.inc (it can be commented out as it is harvested by a script)
This needs to be one of the constants listed after "LED control methods" in
loader/generic/check_compat.c .
Use a number, not one of the macros
-
BLINK_LED_GPIO is defined in
platform/CAM/makefile.inc (it can be commented out as it is harvested by a script)
This is the MMIO address of a known LED.
-
PLATFORMID @ address is defined in the port-specific
stubs_entry.S or
makefile.inc- Dancingbits encoding (
NEED_ENCODED_DISKBOOT) is defined in a port-specific
makefile.inc-
PLATFORMID is defined in a port-specific
makefile.inc (this is mandatory for a port anyway)
- The port has to be added to
camera_list.csv- If all above is done, '
make compat-table' needs to be executed to re-generate
loader/generic/compat_table.hAlso see this description.
edit:
typo