2024-11-05 04:55 AM
hello!
i'm trying to make a project with the board SNK1M1 coupled with the NUCLEO-G071RB using azure ThreadX instead of FreeRTOS.
i'm able to replicate the example provided here:
or the video on youtube:
https://www.youtube.com/watch?v=cbdFHmMOMwk
and all work fine like in the video
BUT
if i change the Rtos with azure ThreadX nothing work anymore!
the code is compiled without problem, it seems to run (no hardfault error) but i can't find the board in the cube monitor UCPD
there is some additional step to use azure threadX instead FreeRTOS?
there is a tutorial of how to use with threadX?
thank you in advance!
Solved! Go to Solution.
2024-11-29 12:58 AM
Hello !
Glad to ear the example works for you and is able to demonstrate what you want.
For your first question, the first PDO is always fixed type 5V. This is a requirement of the PowerDelivery spec. If you change it to 15V, it wont work.
You will need to keep the first PDO at 5V and create a second one at 15v.
Now for the voltage selection: on the H5 example linked, you will always ask for the first PDO of the source, so it will always be 5V. This is due to the simple code in USBPD_DPM_SNK_EvaluateCapabilities function.
For your second question, and linked to your first one, we do have additional code that you can put in this function to be able to have more advance control on the PDO choice. I'll advise you to look at the dpm_user file in this github : more advanced dpm_user file example
As you can see, you can modify the USER_SERV_PDO_Sel_Method variable to change what is your preferred PDO choice method (ask for the maximum power, maximum voltage, etc).
Now for the current aspect that you will request, this is not linked to the PDO current declaration (it is the maximum that you can draw, but not automatically what you will ask to the source). To change the current asked in the PDO request, you can change the DPM_SNKRequestedPower fields, inside the DPM_USER_Settings structure.
And of course, your source will need to be able to supply what you ask for (same voltage, enought current), and will need to accept your PDO request for you to effectively have 15V. You can see this negotiation in the trace using CubemonitorUCPD.
Please let me know if you were able to make this work for you.
Best regards
2024-11-29 01:08 AM
hello!
You will need to keep the first PDO at 5V and create a second one at 15v.
yes is what i have did, i have added a second PDO via cube ide Gui interface with 15V 1000Ma
in the wiky we can see that the source device message in green the capabilities of the source
i don't have that messages.. i think becaus my computer maybe don't have any capabilities other the 5V..
i'm searching for a source device that i can use to test the code (ST maybe have a board like that ?)
for your second answer thank you for the link ! i will give a look!
my first try would be to have a very simple approach, at start the sink request the classic 5V, i press a button and it will ask for a different voltage (PDO 1 selected)
thank you
2024-11-29 01:58 AM
Oh yes, your computer is very likely to only provide 5V.
You can use a type C charger if you have one (for your phone maybe?), theses are more likely to have more than 5V capabilities. The charger must be type-C, not type A though (it must be a type-c to type-c cable, or it wont be power delivery and be stuck to 5V)
Regards
2024-11-29 02:01 AM
yes of course i tryed the output type C on my computer!
maybe is a type-C without power delivery option (i see a SS usb and a thunder symbol near the connector but maybe is meaning is different)
i will try to find a wall charger to by that specify the voltage available
thank you
2024-12-05 11:43 PM
Hello! you were right!
i purchased a USB C PD 3.0 charger and now i see his output option in the trace in cube monitor UCPD
one last question, i see there is the fixed 12V option but i don't have 12V in the PDO configuration in cubeIDE , why?
i have the option of variable supply, if i enter for example 3.3V - 7V which voltage the charger give to me? i imagine there is a standard behaviour that a charger have to be
There is a tutorial from ST of how to use the USBPD module other the video on youtube? maybe a explanation about how to use the module for multiple voltage?
thank you!
2024-12-06 12:24 AM
Hello,
Regarding the documentation, you can find different resources at the bottom of this page: STM32 solutions for USB Type-C and Power Delivery - STMicroelectronics.
The SRC_capabilities in your trace are what your charger is capable of. Your STM32 acts as a sink and so the PDO configuration you make in cube IDE is effectively what your sink is capable of. These are two different things, but to have a 12V contract between the two, you must need both device to have a 12V capability.
If you want to select the PDO number 6 or 7 from your charger, then you must change the PDO type in the sink, it is a programmable PDO instead of a fixed one.
Which voltage the charger will give you in this case is dependent on what you ask. The Sink PDO is not the request, it is the min/max capabilities. The request itself is called a "RDO", it is built in USBPD_DPM_RequestMessageRequest function, there you will need to build the proper RDO to request the right voltage from the source.
Regards
2024-12-06 12:32 AM
thank you for the document!
The SRC_capabilities in your trace are what your charger is capable of. Your STM32 acts as a sink and so the PDO configuration you make in cube IDE is effectively what your sink is capable of. These are two different things, but to have a 12V contract between the two, you must need both device to have a 12V capability.
i understand that, for me is "strange" that i cant with cube select a 12V sink capability , its a "stadard voltage" 12V, why is not an option? i was thinking is out of psecification but many charger have the 12V capability
If you want to select the PDO number 6 or 7 from your charger, then you must change the PDO type in the sink, it is a programmable PDO instead of a fixed one.
ok, i see the option in the cubeide configuration
Which voltage the charger will give you in this case is dependent on what you ask. The Sink PDO is not the request, it is the min/max capabilities. The request itself is called a "RDO", it is built in USBPD_DPM_RequestMessageRequest function, there you will need to build the proper RDO to request the right voltage from the source.
OK, i have to search in the examples, thank you!
best reguards
2024-12-06 12:44 AM
Ok, I understand your question now. In fact, 12V is out of spec. See this extract from PD 3.1 spec:
That is why you cant select 12V from CubeMX. But anyway you can still put 12V in the usbpd_pdo_defs.h file "by hand" if you want, it will not be in line with the spec, but I will most likely work.
Regards
2024-12-06 01:01 AM
thank you for the clarification!
best reguards