2020-08-19 04:17 PM
Hi,
I am following your guides for the simple USB-PD Sink from here:
and here:
https://www.youtube.com/watch?v=Z_Sn6CBbz-k&feature=youtu.be
However, once running, the trace shows only this when I plug in a USB-C source:
From the example video, it should be showing many traces of USB-C PD messaging etc.
Looking at the code, there's several functions in usbpd_pwr_user.c alongside this BSP_PWR_VBUSInit function that are empty (aside from a trace call to tell you so), but the example never shows these being populated.
Am I missing something, is there any examples of what should be put in these functions to get the basic functionality working as shown in the demo?
Thanks,
Iain.
2020-08-20 02:54 AM
Hi @IHend.1
Have you done code addition in usbpd_pwr_user.c file, as suggested in video and pdf chapter 5.6.4 ?
If you are using a Nucleo G071 + TCPP01 shield (X-Nucleo-USBPDM1 package), video and document highlighting how to build a SINK application that you mentioned, have been done using CubeMx 5.4.0. Maybe you are using a newer version of CubeMx ?
regards
2020-08-20 03:06 AM
Another suggestion is to have a look at FW package provided together with X-NUCLEO-USBPDM1 board (that you should be able to find at following address : https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-usbpdm1.html). In this package, you will find an example of a SNK PPS application running on NUCLEO G071 + USBPDM1 shield.
This package is based on newer version of USBPD middleware, and so, file organisation might be slightly different from your CubeMx generated project, but you should be able to find an example of BSP layer in charge of managing the USBPD PWR functions in a specific module that you could find in Drivers\BSP\P-NUCLEO-USBPDM1 directory, in this package.
This could help.
2020-08-20 07:08 AM
In usbpd_dpm_conf.h (in User folder) in DPM_setting global variable just change the following fields to USBPD_TRUE :
.PE_VDMSupport .PE_RespondsToDiscovSOP .PE_AttemptsDiscovSOP.
2020-08-20 05:33 PM
Hi Guenael, thanks for the response.
Yes, I have added the Vbus reading addition, as well as all the other additions provided.
I am not using a Nucleo board, rather a custom PCB for a power sink module on a new product being developed.
Ah, perhaps you are right about the Cube version - I am using CubeIDE, which I think used CubeMX version 6.
In any case, I have found that the issue is around the GUI - when I disable the GUI, the trace messages all seem to work fine, but with the GUI enabled, it shows only that one trace message I showed in my image. As well as this, the GUI does not seem to work and I cannot see the board in the list of attached boards.
2020-08-20 05:39 PM
Thanks for the suggestion - I've taken a look at this, and can compile this and flash it to my MCU. In this example, the GUI seems to work (different to when I enable it in my other application). However, I cannot establish PDO contracts etc with this example (only cable detect messages are shown) - I think because the ADC channel is different to that in my final application. However, when I change the Cube ioc file to reflect this and re-generate code, the entire project no longer compiles and lots of errors occur :( Probably due to Cube version mismatches as you say above. But I will look at this for reference, thanks.
2020-08-20 05:41 PM
Thanks Ravi - yep I have done this, no change to functionality but I believe that it was the GUI causing my lack of trace messages - when disabled I can see PD negotiation happening. Thanks again.