cancel
Showing results for 
Search instead for 
Did you mean: 

How to control stusb1602 using stm32f103

MLee.14
Associate

I wanna to implement USBPD with stusb1602 and stm32f103.

have 3 USBPD Port and implement control and operation with stm32f103.

but i could not find any related information.

According to document, that need to use stm32f072 to implement USBPD. ans so is the example source.

I want to implement stusb1602 by communication and control directly from MCU without usb stack provided by ST.

Stusb1602 datasheet does not know a document the register information in detail. Where is the document, where register information is available? Also, where is the document on BMC communications? It seems to be confirmed only on the example source.

​​

Is it possible to implement it in a way that directly control in MCU?​

Should I change the MCU to stm32f072 and use the stack?

plz. advice any related documents and comments.

3 REPLIES 3
Gregory Go.
Senior II

Hello,

If you have multiple ports, note that you need 1x USB PD controller per USB-C port.

The STUSB1602 is supported on the following microcontrollers.

- STM32F072 (ARM Cortex-M0 core)

- STM32F446 (ARM Cortex-M4 core)

- STM32G474 (ARM Cortex-M4 core)

- STM32L4R5 (ARM Cortex-M4 core)

The USB-PD stack is available for free here:

https://www.st.com/en/interfaces-and-transceivers/stusb1602.html#tools-software

  • I want to implement stusb1602 by communication and control directly from MCU without usb stack provided by ST.

The STUSB1602 is not a standalone USB-PD controller. So it requires a software USB-PD stack.

And the USB-PD stack provided by ST has been fully certified by the USB-IF consortium (i.e. it passed successfully the hundreds of tests required for the USB PD certification).

  • I wanna to implement USBPD with stusb1602 and stm32f103.

The STUSB1602 USB-PD stack is not available for STM32F103.

So you may try to port the stack from one of the other ARM core to STM32F103. But it is simpler and faster to use instead a STM32 where the software is already available.

  • USB-C power role

The STUSB1602 is useful if you want to implement a Dual Role Port.

If you just need a USB-C port as Source only or Sink only, it is recommended to use another USB-PD controller to simplify the implementation:

- STUSB4500 for USB PD Power Sink

- STUSB4700 for USB PD Power Source

These USB PD controllers are standalone, so they don't need any software to work.

But you can still connect these USB PD controllers to a microcontroller to be able to manage their default behavior.

Rgds

Thank you for your answer.

​I Changed the mcu from stm32f103 to stm32f072.

Currently, we are working on an example that supports two USB PD ports without RTOS.

There is a difference in structure between the sample source code and the source generated in STM32CUBEIDE, which makes it difficult to work on.

But, I'm working on....

Why does the MCU( STM32F072 ) support only up two ports?

If i use 3 USB PD port, do I need 2 MCU ?

Gregory Go.
Senior II
  • Why does the MCU( STM32F072 ) support only up two ports?

The MCU itself like STM32F072 is not the limiting factor in the maximum number of ports. The limit is more about the memory available and the number of GPIOs available for interfacing with the USB-C chips (SPI, I2C, …)

STM32F072 could support more than 2 ports, but it is not the case today : the ST library only support 2 ports.

The more common use case is to use STUSB1602 with 1 or 2 USB-C ports. That’s why the ST USB-PD library has been developed for 2 ports.

  • If i use 3 USB PD port, do I need 2 MCU ?

Not necessarily. You could use 1 MCU with 3 USB PD ports. But today the STUSB1602 library doesn’t support 3 ports.

  • Alternative solutions:

For 2 ports DRP, ST has the following solutions:

-       Solution1:          1x STM32F0 (with 2x SPI interface) + 2x STUSB1602

-       Solution2:          1x STM32G0 + 2x TCPP03

Note that the STM32G0 can directly manage 2 USB-C ports with 1 chip.

For 3 ports DRP, we could suggest a combination of both:

-       Solution 3-ports: 1 x STM32G0 + 2x TCPP03 + 1x STUSB1602

  • There is a difference in structure between the sample source code and the source generated in STM32CUBEIDE, which makes it difficult to work on.

Indeed there has been a fork between the different version of the USB PD stack.

The code generated by STM32CubeMX for USB-PD is only available for the new family of STM32: STM32G0, STM32G4, STM32M5.

If you want to use the STUSB1602 with STM32, you need to use instead a more up-to-date version of STUSB1602 USB-PD stack available here:

https://www.st.com/content/st_com/en/products/interfaces-and-transceivers/usb/usb-type-c-and-power-delivery-controllers/stusb1602.html#tools-software