2021-10-27 07:23 PM
I purchased a NUCLEO-G071RB and X-NUCLEO-USBPDM1 to development of my project.
Then I wrote a sample program according to application note AN5418, but it doesn't recognize it as a connectable port to the UCPD monitor.
Is it related to HWBoardVersionName or PDTypename of GUI_INTERFACE?
I can see the message on the trace pane when you connect the USB cable.
Solved! Go to Solution.
2021-11-05 07:14 AM
Hello @Sodag.1.
Your ioc file is good. The only difference with AN5418 is that you used CMSIS V2 instead of V1.
The fact that it doesn't work with V2 is due to a bug on our side, and we are raising a ticket to fix it.
Meanwhile, you can apply the fix yourself directly by replacing theses few lines of code in the file gui_os_port.h, under Utilities\GUI_INTERFACE in the firmware package (wich can be found by default in C:\Users\<YOUR USER>\STM32Cube\Repository).
/**
* @brief macro definition used to read a queue message
*/
#if defined(USBPD_THREADX)
#define GUIOS_GETMESSAGE_QUEUE(_ID_, _TIME_,_VALUE_) \
do { \
tx_queue_receive(&(_ID_), (void*)&(_VALUE_), (_TIME_)); \
} while(0)
#else
#if (osCMSIS < 0x20000U)
#define GUIOS_GETMESSAGE_QUEUE(_ID_, _TIME_,_VALUE_) \
do { \
osEvent evt = osMessageGet((_ID_),(_TIME_)); \
(_VALUE_) = evt.value.v; \
} while(0);
#else
#define GUIOS_GETMESSAGE_QUEUE(_ID_, _TIME_,_VALUE_) do { \
(void)osMessageQueueGet((_ID_),&(_VALUE_),NULL,(_TIME_)); \
} while(0)
#endif /* (osCMSIS < 0x20000U) */
#endif /* USBPD_THREADX */
You could also use CMSIS V1 if you don't need the V2 functionalities.
Thank you for your help on this bug, it will be taken into account in the next release.
Best regards
2021-11-02 07:44 AM
hello @Sodag.1
If you see the protocol trace, it is a first good step : you have the TX working from your Nucleo.
Then if you want your Nucleo to reply to the the UCPD monitor, as you were guessing, you need to activate the RX part. And for that the GUI_INTERFACE part is necessary (= UCPD monitor responder). Did you follow chapter 5.2.3: "Activation of UCPD monitor firmware responder" of the AN5418 ?
See also our wiki, or the github G0 application
2021-11-03 10:09 PM
Thank you for your answer.
I followed chapter 5.2.3 to activate UCPD monitor firmware responder, but it doesn't recognize connectable port.
Indicates that I have done the following on the GUI_INTERFACE.
・Check the mode "enable"
・Add the name of HWBoardVersionName:G0_TCPP01 or NUCLEO-G0
・Add the name of PDTypeName:MB1360 or Sink
Is there anything else I should check?
2021-11-04 01:18 AM
Hello @Sodag.1 .
this is really strange. The names are just references to differentiate the boards when you have multiple ones connected. So this is not the blocking point.
Have you pressed the button refresh ? Or restarted STM32CubeMonitor-UCPD ? There is no auto refresh or auto board polling.
Could you share your .cpd file (see the wiki )
2021-11-04 01:54 AM
2021-11-04 02:55 AM
Everything looks good.
Could you share the .ioc file ? To check is you have mapped the LPUART1 RX pin on PA3.
2021-11-04 05:39 PM
2021-11-05 07:14 AM
Hello @Sodag.1.
Your ioc file is good. The only difference with AN5418 is that you used CMSIS V2 instead of V1.
The fact that it doesn't work with V2 is due to a bug on our side, and we are raising a ticket to fix it.
Meanwhile, you can apply the fix yourself directly by replacing theses few lines of code in the file gui_os_port.h, under Utilities\GUI_INTERFACE in the firmware package (wich can be found by default in C:\Users\<YOUR USER>\STM32Cube\Repository).
/**
* @brief macro definition used to read a queue message
*/
#if defined(USBPD_THREADX)
#define GUIOS_GETMESSAGE_QUEUE(_ID_, _TIME_,_VALUE_) \
do { \
tx_queue_receive(&(_ID_), (void*)&(_VALUE_), (_TIME_)); \
} while(0)
#else
#if (osCMSIS < 0x20000U)
#define GUIOS_GETMESSAGE_QUEUE(_ID_, _TIME_,_VALUE_) \
do { \
osEvent evt = osMessageGet((_ID_),(_TIME_)); \
(_VALUE_) = evt.value.v; \
} while(0);
#else
#define GUIOS_GETMESSAGE_QUEUE(_ID_, _TIME_,_VALUE_) do { \
(void)osMessageQueueGet((_ID_),&(_VALUE_),NULL,(_TIME_)); \
} while(0)
#endif /* (osCMSIS < 0x20000U) */
#endif /* USBPD_THREADX */
You could also use CMSIS V1 if you don't need the V2 functionalities.
Thank you for your help on this bug, it will be taken into account in the next release.
Best regards
2021-11-09 12:36 AM
I was able to recognize the port by rewriting the file as pointed out.
Thank you for your cooperation.