- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We use an FX3 with Bootmode "I2C; on failure, USB Boot is enabled"
We would like to have one firmware which can load either from an I2C EEprom or via USB.
Is it possible to detect in the firmware after boot has finished, if the firmware booted via I2C or via USB?
Are there any registers on the FX3 which indicate boot status or are threre I2C or USB registers which could be read to determine if the firmware bootet
from I2C or USB?
Thanks!
Peter
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hemanth,
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?
Thanks
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Peter,
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.
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hemanth,
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?
Thanks
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Peter,
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?
Regards,
Yashwant