cancel
Showing results for 
Search instead for 
Did you mean: 

How To Run 2 UCPD ports on CMSIS V1

IOTkid
Associate II

Hey all

I am building an application using a STM32G071RB with a DRP1M1 as ucpd 0 and a USBDP1 (old SNK1M1) as ucpd 1 and new to the STM UCPD world

In an attempt to start from a working base, I used the DRP1M1_DRP example project as a starting point.

This works until I change the "USBPD_PORT_COUNT" in the .cproject file to "=2" at witch point the the running board stops being picked up by cubeMonitor

After that I created a blank project to see if I could get both ucpd's working. The system only seems to work when cmsis v2 is used.

The DemoUCPD example seems to run on cmsis v1, so my my question is there something I missed setting to get two ports on cmsis v1?

These are the changes to the DRP1M1_DRP example so far

-the additional PDO lists for port 1, in pdo_defs

-adition of an ADC channel for sink vbus

-setting "USBPD_PORT_COUNT=2" in the .cproject file

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
IOTkid
Associate II

This isn't necessarily a fix for the blank project side, but for the DRP1M1_DRP example I was missing: USBPD_PORT1_IRQHandler();

in the function UCPD1_2_IRQHandler(void),

in the file "stm32g0xx_it.c"

onto customizing the application (which Ill ask in a new post)

View solution in original post

3 REPLIES 3
USBPD Dan
Associate II

If you're running into problems with CMSIS versions I'd double check that the OS_PE_PRIORITY and OS_CAD_PRIORITY in usbpd_dpm_core.c resolve to priorities that are in the within the correct range supported b CMSIS v1. I seem to remember an overflow esque problem with CMSIS priorities and their integer size between versions. This advice applies more to the blank project, I'm not super familiar with the example projects and their failure causes.

IOTkid
Associate II

It looks like the priority range for cmsis v1 is 3 to -3 int's (I'm fairly new to cmsis)

forcing OS_PE_PRIORITY and OS_CAD_PRIORITY to +3 and +1 the two port selection still doesn't function.

Thanks @USBPD Dan​ for the thoughts!

IOTkid
Associate II

This isn't necessarily a fix for the blank project side, but for the DRP1M1_DRP example I was missing: USBPD_PORT1_IRQHandler();

in the function UCPD1_2_IRQHandler(void),

in the file "stm32g0xx_it.c"

onto customizing the application (which Ill ask in a new post)