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-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-11-05 09:24 AM
Hi @ABasi.2
I suggest you refer to this example to create a thread and tonsure that all necessary ThreadX components are included. Check memory management generation for UCPD in app_azure_rtos.c. If still having issues, don't hesitate to share your project via Github link.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-11-05 11:58 PM
hello FBL
i see your example, but i think is a gerneric example about threadX, not a specific example about UCPD with threadX
i cheked the memory menagement generationin app_azure_rtos.c and i think its ok
from app_azure_rtos.c and app_azure_rtos_config.h we have
#define USBPD_APP_MEM_POOL_SIZE 6144
static UCHAR usbpd_byte_pool_buffer[USBPD_APP_MEM_POOL_SIZE];
static TX_BYTE_POOL usbpd_app_byte_pool;
tx_byte_pool_create(&usbpd_app_byte_pool, "USBPD App memory pool", usbpd_byte_pool_buffer, USBPD_APP_MEM_POOL_SIZE)
the fact is that i have a perfectly functioning project with FreeRtos, i swap Rtos via Cube MX and noting work anymore
i have also tried of course to make a new fresh project with threadX but same result.. nothing work
ST have a functioning example of SNK1M1 board using threadX? like the example provided with freeRtos
thank you
2024-11-06 01:50 AM - edited 2024-11-06 02:01 AM
Hello @ABasi.2
Have a look at all published examples on the USBPD wiki here.
You will see that STM32H5 and STM32U5 have ThreadX USB and power delivery examples.
Regards,
Nicolas.
(Edit : link corrected)
2024-11-06 01:58 AM - edited 2024-11-06 01:59 AM
Hi @ABasi.2
Unfortunately, we don't provide direct example for your case!
Did you check USBPD_THREADX symbol to enable in ThreadX support for CubeMonitor API?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-11-06 01:59 AM
Hello Nicolas
thank you for your answer
but the link point to this page, if i click on the link a duplicate of this page is opened
thank you
2024-11-06 02:03 AM
hello FBL
actually no!
but i'mconfused, where is the page you are showing to me?
is in cube ide or cube monitor ucpd?
thank you
2024-11-06 02:04 AM
Hello @ABasi.2
You are right, link was wrong. I corrected: Wiki.
Direct link to sink application with Threadx here.
Regards,
Nicolas
2024-11-06 05:35 AM
Hello @ABasi.2
Can you check quickly how much you have for TX_TIMER_TICKS_PER_SECOND in your tx_user.h ?
You should have : #define TX_TIMER_TICKS_PER_SECOND 1000
(Similar example on H5 here)
Do you see the systick counter updates ?
Check this wiki : is USBPD_DPM_TimerCounter(); called ?
Regards,
Nicolas
2024-11-06 05:45 AM
hello @Nicolas P.
i have 100 !
is this the problem?
i have searched the
USBPD_DPM_TimerCounter()
is defined in usbpd_dpm_core.h but is never called in the code!
where have to be called?
it is supposed to be called frome "cubemx code" or by the user?
also can you clarify to me where is the USBPD_THREADX symbol enabled? i didn't recognize the page posted by FBL
thank you!