support for the AT32F45X series#3442
Conversation
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in size
Changes <1% in size
No changes
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for the AT32F45X series of microcontrollers from ArteryTek. The implementation follows the existing pattern used for other AT32 family members and includes support for three board variants: AT-START-F455, AT-START-F456, and AT-START-F457.
Key changes:
- Added MCU option definition (OPT_MCU_AT32F45X = 2507) and USB controller configuration using DWC2 driver
- Included complete BSP implementation with clock configuration, interrupt handlers, and board initialization
- Added build system support for both Make and CMake
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/get_deps.py | Adds dependency entry for AT32F45x firmware library |
| src/tusb_option.h | Defines new MCU option constant for AT32F45X |
| src/common/tusb_mcu.h | Configures DWC2 USB IP and endpoint count for AT32F45X |
| src/portable/synopsys/dwc2/dwc2_at32.h | Adds AT32F45X hardware definitions (FIFO size, IRQ, register base) |
| hw/bsp/at32f45x/family.mk | Make build configuration for the family |
| hw/bsp/at32f45x/family.cmake | CMake build configuration for the family |
| hw/bsp/at32f45x/family.c | Main BSP implementation with board initialization and USB setup |
| hw/bsp/at32f45x/at32f45x_int.c/h | Interrupt service routine handlers |
| hw/bsp/at32f45x/at32f45x_conf.h | Peripheral module configuration header |
| hw/bsp/at32f45x/at32f45x_clock.c/h | System clock configuration (192MHz from 8MHz HEXT) |
| hw/bsp/at32f45x/boards//board. | Board-specific configurations for F455, F456, and F457 variants |
| hw/bsp/at32f45x/FreeRTOSConfig/FreeRTOSConfig.h | FreeRTOS configuration for AT32F45X |
| docs/reference/dependencies.rst | Documents the new firmware library dependency |
| docs/reference/boards.rst | Adds three new board entries to documentation |
| README.rst | Updates CPU support table to include F45x |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /* enable pwc periph clock */ | ||
| crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE); | ||
|
|
There was a problem hiding this comment.
Extra blank line creates inconsistent spacing - there should be no blank line between line 57 and line 59.
| //Vbus | ||
| static inline void board_vbus_sense_init(void) | ||
| { | ||
| *(int*)(0x50000038) |= (1<<21); |
There was a problem hiding this comment.
This magic number should be explained with a comment or defined as a named constant. It appears to be manipulating a bit in a USB OTG register to control VBUS sensing, but the purpose is unclear.
hathach
left a comment
There was a problem hiding this comment.
thank you, I have to fixed pre-commit and compile issue since it lack define for SystemCoreClock. But all other change is good
Thank you very much. The definition of SystemCoreClock was missing in the official support package. I consulted them and they will add the definition later. Therefore, I did not specifically modify it. Of course, it works fine as it is now. |
Support for the AT32F45X series.