2020-08-17 01:07 AM
Hey there,
since a few weeks i am setting up a USB-PD sink with the Nuc-USBPDM1 and Nuc-G474.
In this special case i want to:
1. Read out charger PDOs
2. Set up Fixed PDOs (e.g. 15V@3A) and switching during runtime
3. Set up APDOs according to PPS (variable voltage and current) and switching during runtime
My project files are generated by CubeMX with firmware package 1.2.0 for the G4 series (with 1.3.0 i couldn't get this work). I am using non RTOS mode.
For now it is possible for me to select fixed PDOs and switching them during runtime (by USBPD_DPM_RequestMessageRequest). But when i want to set up an APDO (by requesting continuously every 100ms) i can't get this work.
Only the first request is sent by the stack (proved with Cypres USB-PD protocol analyser) and after this i only get a "USBPD_BUSY" or "USBPD_ERROR" by the request function and the stack goes crazy (hard resetting every few seconds). The whole board has to be reset, that USB-PD stack works stable again.
Is there any possibility to get PPS working properly with my setup. Or do i have to make special changes in CubeMX, "usbpd_dpm_user" or "usbpd_dpm_core"?
Best regards
Solved! Go to Solution.
2020-08-27 12:30 AM
Dear @Guenael Cadier ,
i'm happy that my code seems right! I checked your code snippet and this code is executed correctly in my setup.
On my X-NUCLEO-USBPDM1 i checked the jumper settings of JP2 and recognized, that i configured [VCC-3.3V] and [DB-3.3V] because i don't want low power mode. So i disabled USBPDM1_VCC_FEATURE_ENABLED and USBPDM1_DB_OUT_FEATURE_ENABLED in usbpdm1_usbpd_pwr.h.
But the same error is still occurring. Is there any possibility to debug why the stack on my sink sends the HardReset? Or do you have any idea how to detect the fault?
Again i attached my log file; but it's similar to the previous file. Best regards
2020-08-27 09:16 AM
Dear @S.Cross ,
Just a question on your last log : time spent between 2 REQUEST from Sink, in PPS mode, is expected to be around 9 sec (max is 10 sec). You mentioned it is what you observe. But looking at counter, it looks like around 18000 units occurred between 2 requests. I would have expected to see something around 9000.
Do you confirm time between Requests is around 9 seconds ?
Guenael
2020-08-30 11:35 PM
Dear @Guenael Cadier ,
the request was sent in the right time delta of 9-10 seconds. I just recognized, that an HAL_IncTick() is already executed by the interrupt handler of TIM20. So i removed my inserted HAL_IncTick() and the timebase is correct now . But error is still the same.
2020-08-31 01:56 AM
OK, Thanks for clarification.
By the way, is the Hard Reset always occurring after the 3rd Request or is it sometimes after the 4th, 5th, ... ?
2020-09-17 03:52 AM
Dear @Guenael Cadier ,
after doing some tests i still have the same problem with selecting PPS profiles. The reset seems to relate to the charger i connect my sink with. So in some cases i get an HardReset after the 3rd request, and sometimes already after the 2nd request. If i select an APDO and there is a HardReset caused by the sink i get sometimes up to 10 HardResets after this before the regular 5V profile is selected correctly by the sink. This behaviour is shown in the attached file. But every time the sink goes to status "POWER_EXPLICIT_CONTRACT". I also checked the voltage level of VBus, if something changes, which causes the sink to do an HardReset, but everything was stable. So i assume, that the HardReset is caused by the stack, which i can't monitor.
2020-09-18 12:50 AM
Dear @S.Cross
In order to try to investigate, could you, if possible :
Thanks
Guenael
2020-09-18 03:04 AM
2020-09-18 03:16 AM
Dear @Guenael Cadier_O (ST Employee) ,
my IDE i am using is Keil v5.20.0.0 with "USBPDCORE_PD3_FULL_CM4_Keil.lib".
The IOC file and libraries are within the archive attached.
Thanks
2020-09-21 05:40 AM
Dear @Guenael Cadier ,
ich checked the entries in the forum and found this question:
which seems to point to the same problem. In my case i have activated the CRC module and use it for validation in my communication. Could this result in that trouble i have with the USB-PD stack?
Thank you and best regards
2020-09-22 03:31 AM
Dear @S.Cross
Thanks for your attachments.
Libraries provided in USBPD Middleware could be used on several targets. Depending on Cortex M core used inside the STM32xx device, several libs for same IDE/USBPD feature configuration, exist. For STM32G4xx, libs with ***_CM4*** are ok.
Regarding the Hard Reset issue, could you try to use updated lib (as attached to this post, please remove"_update" suffix), rebuild you binary, and check if issue still present ?
Thanks
Guenael