cancel
Showing results for 
Search instead for 
Did you mean: 

H563/H573 - How to use the CC1,CC2 pins for GPIO and still get USB-MSC working

VT_Jim
Associate III

Folks,

 

I started off with the H573i discovery board demo as reference for the MSC + SD card (with ThreadX). 

I don't have the Discovery board since in my application I needed those CC1, CC2 USBPD pins for something else.  So I ran a board of my own (using the H563ZIT6).  I'm using just micro-USB B connector, not USB-C.

I set up the project in Cube and pulled in all the segments from the demo for H573I.

But in CubeMX I have to disable the UCPD in order to get access the two pins I need.

I just left the USB enabled.

But it seems that there is no USB library setup properly if the UCPD is disabled.

Can someone tell me how to get the demo from the H573 to work if the CC1, CC2 pins are disabled in Cube and assigned as GPIO? 

I don't have to have the ThreadX but figured it might be helpful as my product develops.  

Thanks!

J

 

23 REPLIES 23
VT_Jim
Associate III

@Nicolas P. @FBL I found the issue - one step further.  CubeMX defaults the IO Speed setting for the MCO1 pin to low speed when it is enabled within the pin config (chip map).  This is done in the MX_GPIO_Init.  But the setting for the SystemClock is done BEFORE this MX_GPIO_Init.  

So the fast IO pin type setting of the SystemClock_Config gets overwritten with a Slow output setting for the pin.

I just put into the user code space another call to set the GPIO very fast again after.  

But this is worth a look by ST that you may want the tool to determine for the user which IO speed mode the pin assignment should be in based on what clocking speed they have configured in the Clock setup tool, or the MCO should be left alone when you get to your MX_GPIO_Init. 

 

FBL
ST Employee

Thank you so much @Nicolas P. for the explanation.

@VT_Jim  Attached the updated IOC for reference.

You can configure MCO clock speed in this field.

FBL_0-1712563818593.png

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@VT_Jim  , if you decide to put out 100MHz on MCO, its up to you to set the pin speed matching , what you expect.

This is same with all other pins : YOU know, what you want to put out there and have to set the pin to pullup, fast or slow etc.

There is no AI , to tell you: oh, you seem to do it a bad way, i suppose you change settings to... 🙂

If you feel a post has answered your question, please click "Accept as Solution".

>Can these H563/573 chips be used with the older USB ports

try...see:

https://github.com/STMicroelectronics/stm32h5-classic-coremw-apps

 

If you feel a post has answered your question, please click "Accept as Solution".