2019-11-12 12:47 PM
I purchased a NUCLEO-G431KB to begin and test firmware development of my project, using the latest STM32CubeIDE with the STM32Cube_FW_G4_V1.1.0 library BSP.
Following several USBPD library examples of a sink application -- and some considerable configuration to FreeRTOS and the initial STM32Cube-generated code -- I am able to build the firmware, flash the target, and debug via ST-Link running on the little NUCLEO device.
I can verify the USBPD middleware thread and the TRACER_EMB utility thread are being created by FreeRTOS. But the main USBPD process that listens for USB Type-C cable attach/detach seems to hang and never return (and it never calls any of the installed callback functions). This function is part of the CAD module I believe and is named USBPD_CAD_Process().
Unfortunately this function is implemented in the library core USBPDCORE_PD3_FULL_CM4_wc32.a (binary distribution), so I don't have any visibility into why it is hanging or not calling my callback functions. And I can't find any good documentation on troubleshooting this area of USBPD library either.
Also a side note -- I'm not real certain how to actually use the TRACER_EMB utility, and the STM32CubeMon-UCPD application does not detect any boards present when I have the target running.
--
EDIT:
My hardware setup is as follows. Equipment:
Configuration:
With a digital multimeter attached to the open power and ground rails on the breadboard, I can verify that 5 V (default power profile per USB spec) is present when both the NUCLEO (1) is running my USBPD firmware, and the power adapter is plugged into the Type-C receptacle (2).
If I disconnect and reconnect the power adapter to (2) while (1) is NOT running my USBPD firmware, the 5 V supply is NOT present again until the NUCLEO (1) target resets and begins running the firmware again. Therefore, I am fairly certain the USBPD library is functioning correctly to some extent, it just doesn't seem to be communicating with the main application.
Solved! Go to Solution.
2019-11-18 12:11 PM
Yup, that's what I did to resolve it, everything seems stable now.
I have a new problem that I think is unrelated to this topic, so I will post a new question and refer here for traceability. Thanks!
2020-01-10 12:16 AM
Hello @ardnew ,
the Application Note "How to create a simple USBPD sink application with STM32CubeMX" has been published : AN5418