You can do the following:
- Have two versions of the firmware, with the difference between the two as follows -- The firmware which boots from I2C should support a vendor command say 0xCD, while the firmware which loads from USB shouldn't. By doing this your Host App will get to know if the firmware boot from USB or I2C, then you can implement one more vendor command to let the firmware know the same.
We will also check if there any registers to do the job.
thank you for your answer!
We are looking for a way to find out in code how the FX3 booted and having only a single version of the firmware which could boot either via i2c or via USB fallback.
Looking at the example code we found that register GCTLAON_REGS_T->control (located at address 0xe0050000) could be helpful.
We found that it has the values
0xde240101 after firmware was booted via I2C
0xde201101 after firmware was booted via fallback USB
so we are now using bit 18 (CY_U3P_GCTL_ANALOG_SWITCH) to determine if the built-in bootloader actived USB while booting in fallback USB mode (bit 18 is cleared) or if the FX3 successfully booted via I2c (bit 18 is set)
Could you confirm that this is a reliable way to find out how the FX3 booted?
I can say that the method has the potential to give out the results you are expecting.
Could you please try that and then update me with the results or findings that you notice?