1 2 Previous Next 15 Replies Latest reply on Jun 28, 2019 2:46 AM by ShifangZ_26

    Read TYPE-C cable E-marker IC VDM data on CY4541

    WiCh_3149431

      We are work on read TYPE-C cable E-marker IC VDM data on CY4541, the read out put on UART of CYPD4225 pin1,

      uart1.jpg

      CYPD4225.jpg

      The source code is :

         SW_Tx_UART_1_PutString("start");

      but we get garbled on terminal, the baud rate is set on 115200,N,8,1, we also try 9600,N,8,1, it is also.

      ACCESSPORT.jpg

       

      Could Cypress help us fix this problem or please give us hint to fix this problem?

        • 1. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
          ShifangZ_26

          Hi,

           

          Have you comments out all of FW_LED code in CYPD4225 firmware?

           

          @file config.h

           

          #define APP_FW_LED_ENABLE                          (0u)  >> Set to 0

           

           

          /*

          * Select CCG4 GPIO to be used as Activity Indication. This should be set to a

          * valid value if APP_FW_LED_ENABLE is non-zero.

          */

          // #define FW_LED_GPIO_PORT_PIN                        (GPIO_PORT_1_PIN_1) >> Comment out directly.

           

          Best Regards,

          Lisa

          • 2. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
            WiCh_3149431

            Hi, Lisa:

            We also try SW_Tx_UART_1 on pin 6, it is also.

            SW_Tx_UART_1 on pin6.jpg

            • 3. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
              WiCh_3149431

              We connect a I2C OLED display on I2C bus to display VDM data, but OLED all show 00000000 even we plug with E-marker or not with E-marker. Source code list at below, please help how correct read E-marker VDM data on CY4541.

              OLED.jpg

              void get_cable_vdo (uint8_t port)

              {   

                  char temp[64];

                  unsigned int  *ptr;

                  const dpm_status_t *dpm_stat;

                 

                  SW_Tx_UART_1_PutChar('M');

                 

                  //if (dpm_stat->emca_present != false)

                  if (app_is_cbl_disc_done(0))

                  {

                      dpm_stat = dpm_get_info (port);

                      cbl_vdo_get.std_cbl_vdo.cbl_fw_ver = dpm_stat->cbl_vdo.std_cbl_vdo.cbl_fw_ver;

                      cbl_vdo_get.std_cbl_vdo.vbus_cur = dpm_stat->cbl_vdo.std_cbl_vdo.vbus_cur;

                     

                      ptr = (unsigned int*)&dpm_stat->cbl_vdo.std_vdm_hdr;

                      to_hex(*ptr, temp);

                      //SW_Tx_UART_1_PutString("\nstd_vdm_hdr = ");

                      //SW_Tx_UART_1_PutString(temp);

                      OLED_Fill(0x00);

                      OLED_ShowStr(0, 0, temp, 2);

                     

                      ptr = (unsigned int*)&dpm_stat->cbl_vdo.ustd_vdm_hdr;

                      to_hex(*ptr, temp);

                      //SW_Tx_UART_1_PutString("\nustd_vdm_hdr = ");

                      //SW_Tx_UART_1_PutString(temp);

                      OLED_ShowStr(0, 2, temp, 2);

               

                      ptr = (unsigned int*)&dpm_stat->cbl_vdo.std_id_hdr;

                      to_hex(*ptr, temp);

                      //SW_Tx_UART_1_PutString("\nstd_id_hdr = ");

                      //SW_Tx_UART_1_PutString(temp);

                      OLED_ShowStr(0, 4, temp, 2);

                     

                      ptr = (unsigned int*)&dpm_stat->cbl_vdo.std_cert_vdo;

                      to_hex(*ptr, temp);

                      //SW_Tx_UART_1_PutString("\nstd_cert_vdo = ");

                      //SW_Tx_UART_1_PutString(temp);

                      OLED_ShowStr(0, 6, temp, 2);

                     

                      ptr = (unsigned int*)&dpm_stat->cbl_vdo.std_prod_vdo;

                      to_hex(*ptr, temp);

                      //SW_Tx_UART_1_PutString("\nstd_prod_vdo = ");

                      //SW_Tx_UART_1_PutString(temp);

                      OLED_ShowStr(0, 16, temp, 2);

                     

                      is_emca_present = 1;

                  }

              }

              • 4. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                WiCh_3149431

                We modify get_cable_vdo() in the main.c

                void get_cable_vdo (uint8_t port)

                {   

                    char temp[64];

                    unsigned int  *ptr;

                    const dpm_status_t *dpm_stat;

                   

                    SW_Tx_UART_1_PutChar('M');

                   

                    //if (dpm_stat->emca_present != false)

                    if (app_is_cbl_disc_done(0))

                    {

                        dpm_stat = dpm_get_info (port);

                        cbl_vdo_get.std_cbl_vdo.cbl_fw_ver = dpm_stat->cbl_vdo.std_cbl_vdo.cbl_fw_ver;

                        cbl_vdo_get.std_cbl_vdo.vbus_cur = dpm_stat->cbl_vdo.std_cbl_vdo.vbus_cur;

                       

                        ptr = (unsigned int*)&(dpm_stat->cbl_vdo.std_vdm_hdr);

                        to_hex(*ptr, temp);

                        //SW_Tx_UART_1_PutString("\nstd_vdm_hdr = ");

                        //SW_Tx_UART_1_PutString(temp);

                        OLED_Fill(0x00);

                    OLED_ShowStr(0, 0, temp, 2);

                       

                        ptr = (unsigned int*)&(dpm_stat->cbl_vdo.ustd_vdm_hdr);

                        to_hex(*ptr, temp);

                        //SW_Tx_UART_1_PutString("\nustd_vdm_hdr = ");

                        //SW_Tx_UART_1_PutString(temp);

                        OLED_ShowStr(0, 2, temp, 2);

                 

                        ptr = (unsigned int*)&(dpm_stat->cbl_vdo.std_id_hdr);

                        to_hex(*ptr, temp);

                        //SW_Tx_UART_1_PutString("\nstd_id_hdr = ");

                        //SW_Tx_UART_1_PutString(temp);

                        OLED_ShowStr(0, 4, temp, 2);

                       

                        ptr = (unsigned int*)&(dpm_stat->cbl_vdo.std_cert_vdo);

                        to_hex(*ptr, temp);

                        //SW_Tx_UART_1_PutString("\nstd_cert_vdo = ");

                        //SW_Tx_UART_1_PutString(temp);

                        OLED_ShowStr(0, 6, temp, 2);

                       

                        ptr = (unsigned int*)&(dpm_stat->cbl_vdo.std_prod_vdo);

                        to_hex(*ptr, temp);

                        //SW_Tx_UART_1_PutString("\nstd_prod_vdo = ");

                        //SW_Tx_UART_1_PutString(temp);

                        OLED_ShowStr(0, 16, temp, 2);

                       

                        is_emca_present = 1;

                    }

                }

                 

                the OLED display show as below, there are not correct E-marker VDM data, please Cypress help us or give us instructions on how to read the other E-marker data on CY4521 correctly.

                OLED-20190520.jpg

                • 5. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                  ShifangZ_26

                  Hi William Chen,

                   

                  1. As per the discussion on the threads CY4521 Read TYPE-C cable E-marker IC VDM data , you have noticed below

                   

                  CCG2 receives all the VDOs of SOP prime Discover ID from cable. However, the PD stack does not expose all information outside. It just exposes cable VDO & cable id header VDO.

                   

                  2. If you could like to start this project with CCG4 (CYPD4136, CCG4 on CY4532 board), we could share more example code to you.

                   

                  Best Regards,

                  Lisa

                  • 6. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                    WiCh_3149431

                    Hi, Lisa:

                    Yes, we also has CY4532, it is CYPD4126-40LQXIT on the board, if it can read all E-marker (include VDM Header, ID Header VDO, Cert Stat VDO, Product VDO and Cable VDO), please support us more example code, we can start this project immediately.

                     

                    Thanks

                    William

                    • 7. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                      WiCh_3149431

                      Hi Lisa:

                      Is the project on CYPD4126-40LQXI_notebook of EZ-PD CCGx SDK?

                      • 8. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                        ShifangZ_26

                        Hi ,

                         

                        Yes. The project on CYPD4126-40LQXI_notebook of EZ-PD CCGx SDK is the correct example code for beginning of development. Since we have been shared a MTK firmware example code to our distributor, you could get it as reference if you could like to.

                         

                        Best Regards,

                        Lisa

                        • 9. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                          WiCh_3149431

                          Hi, Lisa:

                          Because Arrow - Gary Chien is off this week, I did not get MTK firmware example code so far. Could you direct email to me? My email is roin.william@gmail.com.

                          • 10. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                            ShifangZ_26

                            Hi William,

                             

                            You could begin to with YPD4126-40LQXI_notebook of EZ-PD CCGx SDK if you do not get reply from our DFAE, we could support you from here.

                             

                            Best Regards,

                            Lisa

                            • 11. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                              WiCh_3149431

                              Hi, Lisa:

                              I contact with Arrow contact window - Gary Chien and Kevin Tsai, they did not receive MTK example code, would you direct release to me.

                              • 12. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                                ShifangZ_26

                                Hi William,

                                 

                                 

                                Okay. I see. Since you cannot get any additional example project, you can get start from YPD4126-40LQXI_notebook of EZ-PD CCGx HOST SDK (https://www.cypress.com/documentation/software-and-drivers/ez-pd-host-software-development-kit ), I will support you step by step.

                                 

                                Best Regards,

                                Lisa

                                • 13. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                                  WiCh_3149431

                                  Hi, Lisa:

                                  Would you please guide us how & when to send & receive discover_id on CYPD4126-40LQXI_notebook project?

                                  • 14. Re: Read TYPE-C cable E-marker IC VDM data on CY4541
                                    WiCh_3149431

                                    Hi, Lisa:

                                    Did not got your reply, please guide us step by step.

                                    1 2 Previous Next