2019-10-10 02:06 AM
I bought B-G474E-DPOW1 and had one typec interface, which cc connect ucpd_dbcc pins. I need another typec interface to send pd message, could I use the ucpd_cc pins for this?
And I try to change the demo code "USB-PD_Consumer_1port", set USBPD_PORT_COUNT=2, while got error when pd init, error in USBPD_PE_Init.
/* PE SET UP : Port 0 */
CHECK_PE_FUNCTION_CALL(USBPD_PE_Init(USBPD_PORT_0, (USBPD_SettingsTypeDef *)&DPM_Settings[USBPD_PORT_0], &DPM_Params[USBPD_PORT_0], &dpmCallbacks));
#if USBPD_PORT_COUNT == 2
Solved! Go to Solution.
2019-10-10 11:58 PM
Hello, what is the voltages you see on CC lines? I suggest you also to refer on our User Manual UM2552 and check the source connection procedure described in Figure11:
And also remind that you can add your own traces, also described in the same document (3.6.4 TRACE system):
This USB-PD trace can be used by the end user for two purposes:
• Debug the USB-PD stack behavior (e.g. exchange of messages, notifications,
attachment events), Use CubeMonitor-UCPD (see documentation about how to
decode the trace)
• Put its own debug trace (see an example of how to add a trace in the code below)
void xxxxx_yyyy(uint8_t PortNum, …)
{
...
/* trace function exit */
USB-PD_TRACE_Add(USB-PD_TRACE_DEBUG, PortNum, 0, “EXIT function
xxxxx_yyyy�?, 24);
}
2019-10-10 02:17 AM
Hello,
STM32G4 has only one UCPD instance then it is not possible to set USBPD_PORT_COUNT to 2. If you want to use 2 instances, I advice you to switch on STM32G0. You could use CubeMX to regenerate another applications with 2 ports.
Regards
Yohann
2019-10-10 02:24 AM
Hello , can you precise the role of the second port (Sink, source or DRP ?) and power profiles you want to support , and if you need USB data too?
Some idea that should
2019-10-10 02:43 AM
hello, thank you, I need to use two port to achieve a usb pd message monitor between source and sink devices.
2019-10-10 04:25 AM
Hello, I have another board nucleo-g431rb, and I use the demo project "USB-PD_Provider_1port" from STM32G474E-EVAL, and set the marco to STM32G431xx. and then connect ucpd_cc1 and ucpd_cc2 in a typec board, which connect to a sink device. However, g431rb don't send any pd message?
Is the project error or the hardware error? thanks.
2019-10-10 06:39 AM
in the projects we deliver, the internal trace is enabled. It is possible to see if you have communication between 2 boards.
Trace is done through USART pins connected to ST link. You should use Cubemonitor-UCPD and use the functionality described in the following image:
2019-10-10 05:55 PM
Hello, I used logic analyzer to moniter ucpd pin(UCPD_CC1, UCPD_CC2), but got nothing. I'm not sure it's the project error or the connect error.
btw, I debug the project and "MX_USBPD_Init" and other function in the "main" function all excute right.
2019-10-10 11:58 PM
Hello, what is the voltages you see on CC lines? I suggest you also to refer on our User Manual UM2552 and check the source connection procedure described in Figure11:
And also remind that you can add your own traces, also described in the same document (3.6.4 TRACE system):
This USB-PD trace can be used by the end user for two purposes:
• Debug the USB-PD stack behavior (e.g. exchange of messages, notifications,
attachment events), Use CubeMonitor-UCPD (see documentation about how to
decode the trace)
• Put its own debug trace (see an example of how to add a trace in the code below)
void xxxxx_yyyy(uint8_t PortNum, …)
{
...
/* trace function exit */
USB-PD_TRACE_Add(USB-PD_TRACE_DEBUG, PortNum, 0, “EXIT function
xxxxx_yyyy�?, 24);
}
2019-10-11 12:08 AM
The G0 discovery board demonstration firwmare demonstrates this use case : spy messages between two devices. You can have a look at :
in the G0 firmware package : c:\Users\your_login\STM32Cube\Repository\STM32Cube_FW_G0_V1.3.0\Projects\STM32G071B-DISCO\Demonstrations\USBPD_Analyzer\