ST意法半导体
直播中

刘浩

7年用户 1017经验值
私信 关注
[问答]

如何在stm32g4中使用ucpd_cc引脚呢

我买了 B-G474E-DPOW1 并且有一个 typec 接口,它 cc 连接 ucpd_dbcc 引脚。我需要另一个 typec 接口来发送 pd 消息,我可以为此使用 ucpd_cc 引脚吗?
我尝试更改演示代码“USB-PD_Consumer_1port”,设置 USBPD_PORT_COUNT=2,同时在 pd init 时出错,在 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



回帖(1)

李霞

2022-12-6 10:42:35
您好,您在 CC 线上看到的电压是多少?我建议你也参考我们的用户手册UM2552并检查图 11 中描述的源连接过程:




并且还提醒你可以添加自己的traces,同样在同一个文档(3.6.4 TRACE系统)中有描述:


  • 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);
  • }
举报

更多回帖

发帖
×
20
完善资料,
赚取积分