-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32H5 support #2203
Comments
I read that TinyUSB has support for H7-MCUs, so H5 shouldn't be a technical issue. |
From what I have seen in the datasheet, it looks like the USB peripheral from the H5 might be the same as that in the G0 family (at least register names seem to match) but I haven't looked in the details yet |
Related: #2275 Seems packet buffer is same size as G0 too (https://www.st.com/resource/en/application_note/an4879-introduction-to-usb-hardware-and-pcb-guidelines-using-stm32-mcus-stmicroelectronics.pdf) |
I have tried replacing G0 with H5 HAL just for a test and also changed:
Just by doing these changes, the code compiles and MCU runs. Windows 11 beeps when the USB device (tested on custom STM32H563 board, USB is verified to work in bootloader DFU mode using BOOT0) is inserted. Used msc_cdc_freertos example However, the following screen is shown: Here is a snippet from the device manager: I am quite new to the USB world so I don't know what to look for or what to check next but I am willing to try, help, and test. Using debugger, I can see "tud_descriptor_device_cb" being called, but not "tud_descriptor_configuration_cb" or "tud_descriptor_string_cb" |
Deleted previous comment; managed to make the same changes Klemen describes to get to a buildable codebase. I'll report back as things develop... |
Update: my changes work, the issue described above is due to #1018 as I use Keil (most callbacks don't work out of the box here it seems) |
I think I reached the same "built and run" state as Klemen, but nothing happens when I connect the USB cable to the host PC (Windows 10). The I've started a new discussion here in case I'm pulling this one too far off its original path. |
No, I do not use USB C |
I've reached the same "build and run" state as Klemen on the Nucleo-H563ZI. No USB enumeration. It is a type C. Might be the same board Lotharyx used. Edit: I solved my issue by adding Also, please see #2373 for a working PR with STM32H5. |
Hey gang, I got STM32H503 with TinyUSB working by removing MX_ICACHE_Init() from main.c Also I had to change the code in "dcd_stm32_fsdev_pvt_st.h" stm32h5xx_it.c /**
/* USER CODE END USB_DRD_FS_IRQn 0 / |
Hmm. However, changing that as well as commenting out |
/* USER CODE END USB_DRD_FS_IRQn 0 /
/* USER CODE BEGIN Header /
/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ PCD_HandleTypeDef hpcd_USB_DRD_FS; /* USB init function */ void MX_USB_PCD_Init(void) /* USER CODE BEGIN USB_Init 0 */ /* USER CODE END USB_Init 0 */ /* USER CODE BEGIN USB_Init 1 */ /* USER CODE END USB_Init 1 / /* USER CODE END USB_Init 2 */ } void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) GPIO_InitTypeDef GPIO_InitStruct = {0}; /* USER CODE END USB_DRD_FS_MspInit 0 */ /** Initializes the peripherals clock
/* USER CODE BEGIN USB_DRD_FS_MspInit 1 */ /* USER CODE END USB_DRD_FS_MspInit 1 */ void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) if(pcdHandle->Instance==USB_DRD_FS) /* USER CODE END USB_DRD_FS_MspDeInit 0 /
/* USER CODE BEGIN USB_DRD_FS_MspDeInit 1 */ /* USER CODE END USB_DRD_FS_MspDeInit 1 */ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ |
Contact me directly if you want me to walk you through getting this running |
That's an extremely generous offer. I am going to make an attempt to roll my own USB CDC implementation and eschew tinyusb; if that goes nowhere, I'll be in touch... |
Yes sir, I do think that tinyusb will work for you and happy to help.
I know how frustrating this can be 🙂
M
…________________________________
From: Brian ***@***.***>
Sent: Wednesday, January 24, 2024 12:30 PM
To: hathach/tinyusb ***@***.***>
Cc: Michael Margolese ***@***.***>; Comment ***@***.***>
Subject: Re: [hathach/tinyusb] STM32H5 support (Issue #2203)
That's an extremely generous offer. I am going to make an attempt to roll my own USB CDC implementation and eschew tinyusb; if that goes nowhere, I'll be in touch...
—
Reply to this email directly, view it on GitHub<#2203 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYMHAORNICMX4NQRCKOIO6TYQFVMZAVCNFSM6AAAAAA3COES7WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBYHA3DMNBYGE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Hi M, I'm not sure how to contact you directly. I followed the link from your profile and filled out the "contact us" form on that site. Is there a better way? |
Well, here I am again. It's been a while; the work to try to get this working was shelved for a while. Now it's back on my plate. What I've done most recently is do a I've gone through some example code that @sckid1108 very kindly provided, looking for differences between his and mine, and reconciled as many as I could find. Now I'm back to square one-and-a-half, it seems; Windows 10 eventually notices that a USB device was plugged in, but then pops up the error that @KlemenDEV screenshotted way back up the thread, along with the Device Manager stating "Device Descriptor Request Failed". (Side note: I have to "Disable" and "Enable" the unknown device entry in Device Manager after unplugging the USB cable to get Windows to realize it's gone.) The culprit continues to appear to be that the USB FS interrupt isn't firing; a breakpoint in the handler is never hit. Adding What do I need to look at to see why those interrupts aren't being generated? |
H563 is already supported, tested with stock example on H563 Nucleo. If it does not work for you specify your H5 variant also which board you are tested with. |
h563 and h503 are both supported, this can be closed |
Related area
Port
Hardware specification
STM32H5
Is your feature request related to a problem?
Is support for STM32H5 planned in future? Couldn't find any discussion in regards and would like to use TinyUSB in a project using that MCU
Describe the solution you'd like
Support for STM32H5, at least in device mode
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: