Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

USB EZ-PD Type-C

apfel
New Contributor II

Hi to all,

I try to compile a bootloader for a CCG5C, namely the CYPD 5126. This bootloader, however, won't ACK the Bootloader host read command after the "go to bootloader" (hex 01 38 00 00 C7 FF 17) while the pre-compiled version CYPD5126-40LQXI_i2c_boot_3_2_1_56_0_0_0_nb works.
Here are my config.h settings (shortened):

/* Select target device family. */
#define CCG5C

/* Enable all boot loader specific code. */
#define CCG_BOOT (1u)

/* Select target silicon ID for CYPD5126-40LQXI. */
#define CCG_DEV_SILICON_ID (0x2A01)
#define CCG_DEV_FAMILY_ID (0x11BA)

/*System Macros*/
#define NO_OF_TYPEC_PORTS (1u)
#define TYPEC_PORT_0_IDX (0u)
#define TYPEC_PORT_1_IDX (1u)

#define HPI_SCB_INDEX (0u)

/* Disable I2C Address configuration based on SWD_CLK. */
/* NOTE: fixed slave address of 0x08 in the design */
#define DISABLE_I2C_ADDR_CONFIG (1u)


#define CCG_HPI_ENABLE (1u)


#define CCG_HPI_PD_ENABLE (0u)


#define APP_PRIORITY_FEATURE_ENABLE (0u)


#define SECURE_FW_UPDATE (0u)

#define FLASHING_MODE_HPI_ENABLE (1u)

#define CCG_DUALAPP_DISABLE (0u)

#if CCG_DUALAPP_DISABLE
/* Stub definitions in case dual-app bootloading is disabled. */
#define Bootloader_1_MD_BTLDB_ACTIVE_1 (0x01u)
#define Bootloader_1_MD_BTLDB_ACTIVE_NONE (0x02u)

extern volatile uint8_t Bootloader_1_activeApp;
#endif /* CCG_DUALAPP_DISABLE */


#define APP_FW_LED_ENABLE (1u)


#define LED_TIMER_ID (0xB0)


#define LED_TIMER_PERIOD (500)


#define FW_LED_GPIO_PORT_PIN (GPIO_PORT_2_PIN_0)
#define FW_LED_GPIO_PORT_PIN2 (GPIO_PORT_3_PIN_0)


#define TIMER_TYPE_SYSTICK (1)


#define TIMER_TYPE_WDT (2)


#define TIMER_TYPE (TIMER_TYPE_SYSTICK)


#define TIMER_TICKLESS_ENABLE (0)


#define TIMER_NUM_INSTANCES (1)


#define BL_TIMER_INSTANCE (0)

#define BOOTWAIT_ENABLE (1)

#define BL_BOOT_WAIT_TIMER_ID (0xC0)

/*EOF*/

What am I missing?

0 Likes
1 Solution
PranavaYN
Moderator
Moderator

Hi,

Apologies for the delay. May I know the Host application you are using in your PC to update firmware using this bootloader. I2C Bootloader in CCG5C implements HPI specification and therefore EZ-PD Configuration Utility (https://www.cypress.com/documentation/software-and-drivers/ez-pd-configuration-utility) must be used.

Best regards,
Pranava

View solution in original post

0 Likes
9 Replies
PranavaYN
Moderator
Moderator

Hi,

 

Config.h of the bootloader shared looks fine. Can you please share the entire bootloader project? Did you modify anything apart from setting DISABLE_I2C_ADDR_CONFIG macro?

Also please do verify that the pins assigned in the bootloader matches with that of the application firmware.

Best regards,
Pranava
0 Likes
apfel
New Contributor II

I don't see any problem with sharing the project other than I don't know how to add the plethora of files which make up the bootloader. So I've zipped the main folder and hope you're ok with it.
As to the bootloader vs. firmware pin assignement: this would be the next thing but right now there is nothing but the bootloader in the chip and the bootloader itself won't ACK the read request of the  bootloader host program after it ought to have been sent into the bootloader.  However, if I point the I2C address pointer of the chip to an address around zero, for example by writing <start> 08 00 00 <stop> and reading afterwards by <start> 09 ... the read requests are ACK'd by the chip. So it looks as if the chip somehow doesn't accepts the call to the bootloader or some address range within the bootloader is missing.

EDIT: The I2C bootloader included as hex file in the notebook.. example works well (at least better than the self-compiled code) but I can't use it because we cannot use the I2C address selection scheme of the precompiled BL.

0 Likes
PranavaYN
Moderator
Moderator

Hi,

It looks like you have modified the Bootloader component on the TopDesign.cysch file. Can you please try building the i2c_boot project as is and check if it works.

Best regards,
Pranava
0 Likes
apfel
New Contributor II

Hi, I tried, but without success. Here's a detailed list what I did:
- Started PSoC Creator 4.4 (4.4.0.80)

- Used a brand new code example (File -> Code Example):

    CYPD5126-40LQXI_notebook.cywrk (ok, with a suffix 02 but nevermind)

- closed the workspace

- opened the I2c-boot.cyprj within the folder

- set code generation to "release"

- compiled code

- flashed code into the chip

- started the Bootloader Host

- tried to write a FW into the chip by I2C; address 0x42 - failed with 'Unable to read data from the target device'.

I've attached both the generated .hex, .map, .elf and .a file from the bootloader and a screenshot from a I2C bus sniffer. So again it looks as if a communication by itself is possible but the chip rejects the read from the address. Maybe it helps.

EDIT: If you need other files as well please just tell me and I will provide them.

Greetings

Holger

0 Likes
PranavaYN
Moderator
Moderator

Hi,

Apologies for the delay. May I know the Host application you are using in your PC to update firmware using this bootloader. I2C Bootloader in CCG5C implements HPI specification and therefore EZ-PD Configuration Utility (https://www.cypress.com/documentation/software-and-drivers/ez-pd-configuration-utility) must be used.

Best regards,
Pranava

View solution in original post

0 Likes
apfel
New Contributor II

Hi Pranava,

I used the "Bootloader Host" application. Ok, If I need to use the EZ-PD Configuration Utility this might explain quite a lot. ...
but this means I cannot use the Cypress MiniProg4 as programming tool, right? Because the EZ-PD Utility won't detect it as a USB-I2C bridge?
Hm. Is there a documentation of the communication between EZ-PD Utility and the CYPD5126? Because we might want to update the devices in the field but there is no way to use the EZ-PD Utility as it will be a Linux-Based system.

Greetings

 

Holger

0 Likes
apfel
New Contributor II

Addittional Question: would a CYUSBS234 DVK work as USB-I2C bridge?

0 Likes
PranavaYN
Moderator
Moderator

Hi,

but this means I cannot use the Cypress MiniProg4 as programming tool, right? 

>> Yes, you are correct. Miniprog4 cannot be used to program CYPD5126. It can only be used to program via SWD interface.

 Is there a documentation of the communication between EZ-PD Utility and the CYPD5126? Because we might want to update the devices in the field but there is no way to use the EZ-PD Utility as it will be a Linux-Based system.

>> The HPI specification is covered under NDA. Please contact local Sales/FAE to sign the NDA and get the specification.

would a CYUSBS234 DVK work as USB-I2C bridge?

Yes, CYUSBS234 can be used as the USB-I2C bridge. You should configure CYUSBS234 as USB-I2C bridge using USB-Serial Configuration Utility. (https://www.cypress.com/documentation/software-and-drivers/usb-serial-software-development-kit)

Best regards,
Pranava
0 Likes
apfel
New Contributor II

Thank you very much. If the communication protocol is somewhere in the HPI specs I should be able to find it. As to the CYUSBS234 DVK I will order one right now and report after it has arrived.

0 Likes