Change bootloader type from IIC to CC lines for CCG2

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SaZh_4163596
Level 1
Level 1

Hi,

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.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hi,

PFA updated project which can compile. I had to compile out lot of code to make the code fit within 32 KB flash.

Regards,

Muthu

View solution in original post

0 Likes
14 Replies
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi ,

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.

pastedImage_0.png

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.

Best Regards,

Lisa

0 Likes
lock attach
Attachments are accessible only for community members.

!I tried as you instructed in solution I, but I failed to pass linking phase.link.png

Please try to build my project on your side. The bootloader "cc_boot-pa.hex" is generated by the bootloader project whithin CYPD2134 power adapter project.

The exmaple project is attached, please dowload it and try.

0 Likes

Hi,

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.

Regards,

Muthu

0 Likes
lock attach
Attachments are accessible only for community members.

Excuse me, I don't know how to change "FW start location" in PSOC creator or file "cm0gcc.ld".

Please use the attached project to demonstrate how to me.

Your kind coaching will be highly appreciated.

0 Likes

Hi,

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.

Regards,

Muthu

0 Likes
lock attach
Attachments are accessible only for community members.

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.

pastedImage_0.png

Your kind advise would be highly appreciated by my team.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

PFA updated project which can compile. I had to compile out lot of code to make the code fit within 32 KB flash.

Regards,

Muthu

0 Likes

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.

Logs:

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")

#ifndef CCG_FW_NO_BOOT

#ifdef CCG_CONFIG_TABLE

    /* 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,

                                                              502)))

    {

        /* Jump back to the bootloader. */

        SW_Tx_UART_1_PutString("Jump to bootloader!\r\n");

       

        jump_to_boot(CY_PD_CONFIG_TABLE_INVALID_REASON);

    }

#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.

0 Likes

Hi,

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:

From:

#define CY_PD_BOOT_LOADER_LAST_ROW      (0x1F)

To:

#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.

Regards,

Muthu

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?

pastedImage_1.png

Thanks again.

0 Likes

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?

0 Likes

HI,

CY4501 Kit has these boards inside:

https://www.cypress.com/documentation/development-kitsboards/cy4501-ccg1-development-kit

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.

Regards,

Muthu

0 Likes

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?

0 Likes

Hi ,

CCG2 CC bootloader is supported by CY4501 or CY4531. CY4521 is not supported.

Best Regards,

Lisa