cancel
Showing results for 
Search instead for 
Did you mean: 

SNK1M1 board project with azure threadX not working

ABasi.2
Associate III

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:

https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Sink#Configure_UCPD_monitor_firmware_responder_for_debug

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!

 

 

 

28 REPLIES 28

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.

ABasi.2
Associate III

Hi @FBL 

understood!

but where i have to click to open that page on cube monitor UCPD?

 

 

 

cubeMonitorUCPD.png

ABasi.2
Associate III

Founded @FBL 

 

i have added the symbol in the project properties MCU/MPU GCC Compiler -> preprocessor

 

the window is different from yours..  properties.png

i have tried but nothing changed.. always unable to see the com port in the cube monitor

 

 

@ABasi.2 

Can you tell us where you land when you break ?

Regards,

Nicolas

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

 

 

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.

STM32CubeH5/Projects/NUCLEO-H563ZI/Applications/USBPD/USBPD_SNK at main · STMicroelectronics/STM32CubeH5

 

(you will find where USBPD_DPM_TimerCounter() needs to be called in this example.)

 

Best regards

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

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

thank you @HFISTM ! 

i come back to you after all the test!

 

best reguards