cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with USBPD

FIser.1
Associate

Hi,

i am trying to use USBPD for my project. We are using the STM32G474RET in combination with the TCPP01-M12. In our application the STM32G4 should work as sink.

I built a project for USBPD (with FreeRTOS), but the USBPD functions were just not called...

I put breakpoints in some Functions that should have been called in any way if a USBPD source is connected but nothing happened.

I built a new project with just USBPD in basic configuration without any new code in the functions.

Compilinng was ok without errors, but in debugger still no functions were called.

When I changed the USBPD Stack Configuration from PD3 Min Sink to PD3 Full Stack, I had errors after compiling:

c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: cannot find -l:USBPDCORE_PD3_FULL_CM4_wc32.a

c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: cannot find -l:USBPDCORE_PD3_FULL_CM4_wc32.a

Even when i changed the configuration back to Min Sink there was the same error for Min Sink...

So i think anything ist wrong there already at the beginning.

I also tried to build a project in CubeMX and open it in CubeIDE because the folder structure is different then. But i had the same problem.

I dont know what to do because first after compiling there is no error and after changing to other configuration and back, what should be the same like before, there are errors...

If you need more information for helping me with this just tell me what you need.

1 ACCEPTED SOLUTION

Accepted Solutions
Yohann M.
ST Employee

Dear @FIser.1​ 

The call of 'USBPD_DPM_TimerCounter' misses in the function 'HAL_TIM_PeriodElapsedCallback'.

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
  /* USER CODE BEGIN Callback 0 */
 
  /* USER CODE END Callback 0 */
  if (htim->Instance == TIM6) {
    HAL_IncTick();
  }
  /* USER CODE BEGIN Callback 1 */
  USBPD_DPM_TimerCounter();
#if defined(_GUI_INTERFACE)
  GUI_TimerCounter();
#endif /* _GUI_INTERFACE */
  /* USER CODE END Callback 1 */
}

I strongly advice you to enable TRACER_EMB module. You could use STM32CubeMonUCPD.

(further information in the wiki page)

For your compilation issue when you have changed the library, could you please check that the settings in CubeIDE is still valid like this:

0693W00000BcGBKQA3.jpg 

In the other hand, can you try the application available in the X-CUBE-TCPP:

https://github.com/STMicroelectronics/x-cube-tcpp/tree/main/Projects/NUCLEO-G474RE/Applications/USB_PD/SNK1M1_Sink

If you use a TCPP01, you need to enable VCC output of the TCPP01 (located on PC10 on X-NUCLEO-USBPM1 extension board)

Regards,

Yohann

View solution in original post

1 REPLY 1
Yohann M.
ST Employee

Dear @FIser.1​ 

The call of 'USBPD_DPM_TimerCounter' misses in the function 'HAL_TIM_PeriodElapsedCallback'.

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
  /* USER CODE BEGIN Callback 0 */
 
  /* USER CODE END Callback 0 */
  if (htim->Instance == TIM6) {
    HAL_IncTick();
  }
  /* USER CODE BEGIN Callback 1 */
  USBPD_DPM_TimerCounter();
#if defined(_GUI_INTERFACE)
  GUI_TimerCounter();
#endif /* _GUI_INTERFACE */
  /* USER CODE END Callback 1 */
}

I strongly advice you to enable TRACER_EMB module. You could use STM32CubeMonUCPD.

(further information in the wiki page)

For your compilation issue when you have changed the library, could you please check that the settings in CubeIDE is still valid like this:

0693W00000BcGBKQA3.jpg 

In the other hand, can you try the application available in the X-CUBE-TCPP:

https://github.com/STMicroelectronics/x-cube-tcpp/tree/main/Projects/NUCLEO-G474RE/Applications/USB_PD/SNK1M1_Sink

If you use a TCPP01, you need to enable VCC output of the TCPP01 (located on PC10 on X-NUCLEO-USBPM1 extension board)

Regards,

Yohann