2020-05-27 05:55 AM
After following the instructions in AN5418 and the corresponding Youtube video I am still struggling to get a connection with my NUCLEO-G474RE board to the UCPD monitor.
When i am flashing the precompiled binary files, which i downloaded for the X-NUCLEO-USBPDM1, i can access the board via the UCPD monitor, so the connection between PC and NUCLEO board can be established.
Following the hints for using the STM32G4 series, instead of the STM32G0 series in AN5418 (e.g. using USART1, instead of LPUART1, and several other changes) and building my own code, i can get no connection to the UCPD monitor.
Has anyone a similar setup, or the possibility to get the original code, which is the source of the precompiled binary files? Or can me give some hints for this setup?
Thank you and best regards
Solved! Go to Solution.
2020-06-04 09:18 AM
Hello
Thanks for this constructive remark !
Then, we will integrate a modification in CubeMX (V6.0.0) to be able to call USBPD_DPM_Run in the main while loop (in NO RTOS Mode) and remove the do {} while(1) code in the function.
Something like this:
int main(void)
{
(...)
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* Start USBPD Processes*/
USBPD_DPM_Run();
/* USER CODE BEGIN 3 */
}
And
=> usbpd_dpm_core.c
void USBPD_DPM_Run(void)
{
//do
//{
(...)
//}
//while (1u == 1u);
}
2020-05-28 07:08 AM
2020-06-03 01:56 AM
Thank you for your reply! Apparently using an RTOS is essential to get the USBPD DPM working on the STM32G474RE. Now i have been succesful in getting a connection between the NUCLEO-G474RE and the STM32CubeMonitor-UCPD, BUT using the LPUART1 as tracing connection, instead of USART1.
2020-06-03 02:39 AM
I checked your comment and I confirm a pb during the generation in NRTOS mode.
Please try the following patch (after disabling FreeRTOS in your CubeMX environment):
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_USBPD_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* USBPD initialisation ---------------------------------*/
USBPD_DPM_Run(); /* Start the USBPD processes in NRTOS mode */
2020-06-03 03:03 AM
Thank you for your reply! I already tried this setup in NRTOS mode, but then i can not execute any code in the main loop, because the USBPD_DPM_Run() starts an infinite loop. So RTOS is required, if i want to do something in the main loop, right?
2020-06-04 09:18 AM
Hello
Thanks for this constructive remark !
Then, we will integrate a modification in CubeMX (V6.0.0) to be able to call USBPD_DPM_Run in the main while loop (in NO RTOS Mode) and remove the do {} while(1) code in the function.
Something like this:
int main(void)
{
(...)
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* Start USBPD Processes*/
USBPD_DPM_Run();
/* USER CODE BEGIN 3 */
}
And
=> usbpd_dpm_core.c
void USBPD_DPM_Run(void)
{
//do
//{
(...)
//}
//while (1u == 1u);
}