Dear Cypress staff and Community genius:
Nice to talk to you.
I was trying to build my project based on CCG2 reference project "monitor" this morning.
Then I found the default bootloader is "IIC bootloader" which utilizes HPI ports to communicate with Host (PC or MCU).
However, we don't want to use IIC bootloader since we don't have MCU embedded in the device. The more ideal ways is to use CC bootloader.
Does anybody know how to change the bootloader type.
Solved! Go to Solution.
CCG2 firmware have supplied I2C bootloader project and CC bootloader project as example project. CYPD2122 notebook is i2C bootloader project and CYPD2134 is CC bootloader project.
1. One way: copy the CC bootloader project into the CYPD2122 project to change the bootloader of CYPD2122 project. (You'd better to new create a CYPD2122 notebook project and new create a CYPD2134 power adapter project.)
a. Change the part number of cc bootloader from CYPD2134 project with PSoC Creator 3.3. (C:\Program Files (x86)\Cypress\EZ-PD CCGx SDK\CCG2\Firmware\projects\CYPD2134-24LQXI_power_adapter\CYPD2134-24LQXI_power_adapter.cydsn\cc_boot-pa.cydsn). And then, build it again to generated .elf and .hex file.
b. Update the .elf and .hex file into bootloadable component of CYPD2122 project you have been new created.
2. The other way: New created CYPD2134 power adapter project. And then changed all of bootloader and application project to CYPD2122 if you need. Or use CYPD2134 directly if you just a power source design.
I2C bootloader is small in size compared to CC bootloader.
So, when you replace the bootloader from I2C to CC, bootloader and app FW overlaps.
You should move the app FW start location based on CC bootloader size.
You have to change CY_APPL_ORIGIN in scatter file (cm0mdk.scat) to change application fw start location based on CC bootloader.
However, I am not sure if you would be able to fit a monitor project (DRP stack) + CC bootloader (implements PD stack) within 32 KB flash.
Current monitor project (app fw + I2C bootloader) itself would have used up almost all 32 KB flash.
Please use attached project to find more.
I belive that I had reduced the app image size to enough small so that there won't exist flash size problem.
And I also changed app image address in PSOC creator to correct one.
However, the error occured again.
Your kind advise would be highly appreciated by my team.
Thank you for your hard work trying to help me with great passion.
It seems that there's only one stop toward the final success: "configSection" area seemed to be ruined whatever.
I got the conclusion this way:
1) When I run the final image on my board, according to the log information through UART, I find MCU jumped to bootloader because of configuration table verification failure.
Validate configuration table!
get_pd_conf()->table_sign = 6027
get_pd_conf()->table_checksum = 000A
cy_pd_calc_checksum = 00C1
Jump to bootloader!
Source code (in function "main")
/* Validate the configuration table. */
if ((get_pd_conf()->table_sign != CY_PD_CONFIG_TABLE_SIGN) ||
(get_pd_conf()->table_checksum != cy_pd_calc_checksum((uint8_t *)&get_pd_conf()->reserved0,
/* Jump back to the bootloader. */
SW_Tx_UART_1_PutString("Jump to bootloader!\r\n");
#endif /* CCG_CONFIG_TABLE. */
#endif /* CCG_FW_NO_BOOT */
Apparently both the "table_sign" and "table_checksum" are wrong.
Please help me to solve the issue and get the task perfectly done.
1. As the bootloader had grown, please change app FW to pick the correct config table by doing following change in usbpd_flash_config.h:
#define CY_PD_BOOT_LOADER_LAST_ROW (0x1F)
#define CY_PD_BOOT_LOADER_LAST_ROW (0x5F)
2. Config table is within the bootloader for CCG1 & CCG2 based devices. So, you should build bootloader hex & elf with modified config table which matches DP sink.
If you haven't done that, please rebuild bootloader project with modified config table in bootloader's usbpd_config.c file.
I'm very grateful for what you did with great efforts.
Now the project can generate workable firmware.
Then I'm gonna run firmware upgrading test via CC lines next step.
I have two questions:
1) Do you have to modify any source code files to enable bootloader support in PD VDM related modules?
2) As I know, in doc "EZ-PD configuration utility User Manual", at section 3.2.5 - Programming Type-C power adapters is written to guide user how to perform firmware upgrading via CC lines.
Should I follow the steps in this section to upgrade firmware for Klingon?
Excuse me, I can't find the boards facilitating CC lines upgrading: CY4504 CCG1 host board and CY4505 CCG1 EMCA board at Cypress website.
Would you please provide the web link for these boards?
CY4501 Kit has these boards inside:
Please refer https://www.cypress.com/file/175586/download
For the cable board, you can even use any Type-C to Type-C cable. If your design is plug-based, you can directly connect to host board.
BTW, monitor project will have I2C based jump to boot command. You should have CC based jump to boot. You can refer power adapter project for example code.
As a quick way to test is program bootloader only on CCG2 silicon and use the CC based FW update.
Thanks for your quick response.
Since I've already had a set of CY4521kit in hand, I wonder to know whether I can use this board to upgrade the firmware of Klingon via CC lines?
In another word, is this board comparable with CY4501 host board during firmware upgrading via CC lines?
CCG2 CC bootloader is supported by CY4501 or CY4531. CY4521 is not supported.