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-06 06:04 AM
Hi @ABasi.2
USBPD_THREADX can be added as predefined symbol to be used by Cube Monitor UCPD to integrate code that is specific to the ThreadX. Then, using _TRACE and _GUI_INTERFACE, traces in UCPD monitor can be accessed.
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 06:09 AM
2024-11-06 06:22 AM
Founded @FBL
i have added the symbol in the project properties MCU/MPU GCC Compiler -> preprocessor
the window is different from yours..
2024-11-06 06:26 AM
i have tried but nothing changed.. always unable to see the com port in the cube monitor
2024-11-06 06:28 AM
2024-11-06 06:54 AM
of coarse @Nicolas P.
i have made two test
if i use TIM6 for hal timing i alway land here:
if (__get_ipsr_value() == 0)
row 334 tx_port.h -> row 253 tx_thread_schedule.S
if i use systick for hal timing i land always here:
row 209 usbpd_phy_hw_if.c
that is a hal_delay(1);
in this case i think that using systick the hal delay its not working
2024-11-06 07:08 AM
Hello @ABasi.2
Please keep your TIM config, using systick with a RTOS is not recommended and you will need to ensure the interrupt priorities are correct to avoid the issue you've sen.
It seems the scheduler is started. I've understood that you do not have a trace at all at startup ? (trace tab in cubemonitor, not the board name). I'll sugest you to run the initialisation phase of the stack step by step with the debugger and ensure that all the ThreadX APIs that create task returns a sucessfull status. Else you will have to ensure that you declare enough memory for your tasks.
Please have a look here to find a working USBPD application using threadX, especially the threadX config files.
(you will find where USBPD_DPM_TimerCounter() needs to be called in this example.)
Best regards
2024-11-06 07:15 AM
thank you @HFISTM !
i will try your suggestion!
so you confirm me that USBPD_DPM_TimerCounter() should be called by the user and its not a "cube code" ?
i actually have a NUCLEO-H563ZI , but i didn't know that the SNK1M1 is compatible due to the form factor , i will try!
thank you
2024-11-06 07:35 AM
Yes I confirm that. You will need to call this each ms in your systick / TIM handler. (like the HAL_IncTick function).
You don't need the SNK1M1 shield on H5, the nucleo board already have a TCPP03 and is actually able to be a Sink/Source and DRP. The link I gave you is a sink, with threadX, so it is equivalent to your application on G0 + SNK1M1 (code wise, not pinout wise). it works as is, with the Type-C port of the nucleo board.
it should be a great start to compare with your application, especially around the config/init path
2024-11-06 07:40 AM