2024-11-11 10:55 PM - last edited on 2024-11-11 11:00 PM by SofLit
Hello,
I'm working with the STM32U575VGT6 as my primary MCU and need a USB-C DRP PD IC. I'm considering the TCPP03-M20 or STUSB1600AQTR. My question is, when the PD operates in sink mode (during charging), we intend to turn off all power supplies, including the MCU. Is it possible to use these ICs in sink mode without the MCU? Additionally, we need the PD to act as a source when external peripherals are connected to this board through USB-C.
Solved! Go to Solution.
2024-12-09 01:15 AM
I made some changes in your .ioc.
- I configure USART1 which is the one connected to the STLINK.
- I enabled "CAD Role Toggle" in the USBPD Middleware configuration
- I enabled X-cube-TCPP middleware, (may be disabled during the migration).
Let me know if it works well.
Best regards
Pascal
2024-12-09 07:53 AM - edited 2024-12-09 07:54 AM
Hi Pascal,
We tested the modified file (with Azure RTOS) that you shared, and it is working fine. We now have a better understanding of how dual role works.thanks.
As you know, our application involves USB data transfer and USBPD dual role with FreeRTOS. Could you please guide us on how to integrate FreeRTOS into this setup? If you could share a USBPD- FreeRTOS IOC file, it would be very helpful.
Additionally, I would like to learn more about the USB PD monitor software tools. Is there anything that needs to be changed in the UCPD monitor settings? If so, could you please provide instructions on how to do that?
Looking forward to your guidance.
Best regards,
Rajkumar
2024-12-09 10:48 PM
Hi Rajkumar24
Thanks for your video.
For STM32CubeMonitor UCPD, please refer to the documentation here
To switch your application to X-Cube-FreeRTOS
1- Copy files included in the ftl_u5.zip package attached to your folder :
C:\Users\YOUR_USER_NAME\AppData\Local\Programs\STM32CubeMX\db\templates\
2- in STM32CubeMX : Unselect ThreadX
3- in STM32CubeMX : In the Software Pack menu, Select components, Select the X-Cube-FREERTOS
Enable Core "TZ_Non_Supported", Heap : "Heap_4"
Back to the Middleware section, enable it : Default configuration is perfect, no need to change anything.
- Please find attached my .ioc for reference
4- In STM32CubeMX : Generate the Code
5-In your IDE add "_RTOS" preprocessor and "osCMSIS=0X20001U" preprocessor.
Best regards
Pascal
2024-12-10 04:48 AM
Hi Pascal,
Thank you for sharing the U5_DRP_FREERTOS_IAR.ioc file. The IOC file you provided does not have X-TCPP enabled and appears to be set for the U585 microcontroller.
Based on this reference, I created an IOC file for U575zi and tested two methods:
1. Using STM32CubeMX
When attempting to configure the project with FreeRTOS (instead of ThreadX) in CubeMX, I encountered errors, which are shown in the attached image. Additionally, a warning symbol appeared on X-TCPP.
I pasted the file inside of ftl_u5(there are 4 files in that folder) in C:\Users\YOUR_USER_NAME\AppData\Local\Programs\STM32CubeMX\db\templates\
it asks replace the file i give yes
2. Using STM32CubeIDE
After configuring the project with STM32CubeIDE and FreeRTOS, the project compiled successfully. However, the expected dual-role functionality was not achieved, unlike before.
Could you check if there are any mistakes in our IOC configuration? I have attached both the STM32CubeMX and STM32CubeIDE project files for your reference.
Looking forward to your guidance.
Best regards,
Rajkumar
2024-12-10 11:03 PM
Hi Rajkumar24
1-Using STM32CubeMX
No problem with the warning on X-CUBE-TCPP : this is because you are using X-CUBE-FREERTOS instead of ThreadX.
For the errors, I have no compilation issue on my side, maybe you can try the 3rd Code generation option (see Capture_H5_STM32CubeMX.jpg attached)
You need to add Preprocessor : "_RTOS" and "osCMSIS=0x20001U"
(see Capture_H5_STM32CubeIDE.jpg attached)
2-Using STM32CubeIDE
ou need Preprocessor : "_RTOS" and "osCMSIS=0x20001U"
(see Capture_H5_STM32CubeIDE.jpg attached)
Best regards
Pascal
2024-12-11 02:41 AM
Hi Pascal,
After Done what you said before, the compilation Error was fixed. but after upload the generated code the drp1m1 module not perform dual role as like we test before with threadx.
I attached my IOC and images for your reference.please verify our ioc file.
Looking forward to your guidance.
Best regards,
Rajkumar
2024-12-11 11:09 PM
Hi Rajkumar24
Please try this .ioc, it works on my side on a setup identical to yours.
Best regards
Pascal
2024-12-12 10:50 AM
Hi Pascal,
Thank you for the IOC file.it’s working perfectly with FreeRTOS. I have attached a video for your reference. Once again thank you.
As mentioned earlier, our final product includes power delivery, data transfer (USB CDC host), and code flashing via USB instead of ST-Link.
Initially, we tested only with the Nucleo U575 board, and both USB flashing and USB CDC host functionality were working fine.
(Note-Code flash via usb- Just connect ph0 pin to ground and put power via USB port instead of stm32,Instead of st link)
1. after adding the X-Nucleo Drp1m1 board to the Nucleo U575 board and following the same pin connection as you mentioned earlier and we added the D+ and D- pins with jumper wires.data transfer and code flashing are not working. Could you please guide me if there is any hardware connection Or any usbpd configuration we might have missed?
2. could you confirm if the battery on the X-Nucleo board needs to be connected to the sink (screw terminal) for charging?
Looking forward to your guidance.
Best regards,
Rajkumar
2024-12-12 11:07 PM
Hi Rajkumar24
Thank you for your video ! Happy to read that your application is working.well.
1- I suppose you connected D+/D- from X-NUCLEO-DRP1M1 CN10-12 and CN10-1.
If yes, this is correct, R19 and R20 are present.
The difficulty I see is that using free wires we don't respect anymore the 90Ohms differential pair.
2- I confirm, the battery charge has to be managed from the X-Nucleo-DRP1M1 sink (screw terminal).
Here is an application block diagram:
Best regards
Pascal
2024-12-13 07:54 PM
Hi Pascal,
Thanks now battery charging working.
Thanks for the circuit, we are following same connection. We also added the twisted wire (we take from external usb cable) and soldering to between the two boards.still usb host not working but usbpd dual role working.while debugging we came to know Issue with osKernelStart Triggering Automatically in UCPD Implementation.
While integration to usb host code ,UCPD functionality is working correctly, but I am facing an issue with osKernelStart. Despite not explicitly calling osKernelStart in my code, the function is still being executed, and it subsequently triggers vTaskStartScheduler(). I have verified and commented out all instances of osKernelStart in the code, but the issue persists—it appears that osKernelStart is being called from elsewhere, leading to the scheduler's start. This behavior is preventing me from taking control of my operating system.
could you please provide clarity on whether any UCPD-related software or driver could be invoking this function? For reference, I have attached an image for your review.
Looking forward to your guidance.
Best Regards
Rajkumar