Skip to content

Conversation

@chenzhihong007
Copy link

add hpmicro chips and hpm6750evk2 board

@chenzhihong007 chenzhihong007 marked this pull request as draft December 9, 2025 11:12
@chenzhihong007 chenzhihong007 marked this pull request as ready for review December 9, 2025 11:13
@chenzhihong007 chenzhihong007 marked this pull request as draft December 9, 2025 11:13
@chenzhihong007 chenzhihong007 reopened this Dec 9, 2025
@HiFiPhile
Copy link
Collaborator

Hi, think you, I think HP Micro use Chipidea HS controller, could you add the port to /src/portable/chipidea/ci_hs instead of creating a new ?

@chenzhihong007 chenzhihong007 force-pushed the feature/support_hpmicro_chips branch from 220d601 to ff10f3e Compare December 10, 2025 08:55
@chenzhihong007
Copy link
Author

Hi, think you, I think HP Micro use Chipidea HS controller, could you add the port to /src/portable/chipidea/ci_hs instead of creating a new ?

Yes, I update my port files by using Chipidea HS controller to support HPMicro chips. Thank you!

@chenzhihong007 chenzhihong007 marked this pull request as ready for review December 10, 2025 09:08
@chenzhihong007 chenzhihong007 force-pushed the feature/support_hpmicro_chips branch from ff10f3e to 5a1e8a0 Compare December 11, 2025 02:26
@hathach
Copy link
Owner

hathach commented Dec 12, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for HPMicro chips (specifically HPM6750) and the hpm6750evk2 development board to TinyUSB. The implementation includes BSP files, USB driver integration with ChipIdea HS controller, and RISC-V toolchain updates.

Key changes:

  • Integration of HPM6750 MCU with ChipIdea HS USB controller and EHCI support
  • Complete BSP implementation for hpm6750evk2 board with dual USB port support
  • RISC-V toolchain update to include zifencei extension for GCC compatibility

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/get_deps.py Adds HPM SDK dependency entry for building HPMicro targets
src/tusb_option.h Defines OPT_MCU_HPM (2600) MCU identifier
src/common/tusb_mcu.h Configures HPM MCU with ChipIdea HS, EHCI, 16 endpoints, high-speed support
src/portable/ehci/ehci.c Adds HPM-specific USB PHY line state handling in port reset
src/portable/chipidea/ci_hs/hcd_ci_hs.c Integrates HPM USB PHY initialization for host mode
src/portable/chipidea/ci_hs/dcd_ci_hs.c Integrates HPM USB PHY initialization and STS configuration for device mode
src/portable/chipidea/ci_hs/ci_hs_hpm.h New header defining HPM controller registers and interrupt macros
hw/bsp/hpmicro/family.mk Makefile build configuration for HPMicro family
hw/bsp/hpmicro/family.cmake CMake build configuration for HPMicro family
hw/bsp/hpmicro/family.c BSP implementation with USB interrupt handlers and board API
hw/bsp/hpmicro/boards/hpm6750evk2/board.mk Board-specific Makefile variables and device settings
hw/bsp/hpmicro/boards/hpm6750evk2/board.cmake Board-specific CMake configuration
hw/bsp/hpmicro/boards/hpm6750evk2/board.h Board hardware definitions and peripheral mappings
hw/bsp/hpmicro/boards/hpm6750evk2/board.c Board initialization including clock, PMP, UART, GPIO, USB
hw/bsp/hpmicro/boards/hpm6750evk2/pinmux.h Pin multiplexing function declarations (auto-generated)
hw/bsp/hpmicro/boards/hpm6750evk2/pinmux.c Pin multiplexing implementations (auto-generated)
hw/bsp/BoardPresets.json Adds hpm6750evk2 presets; removes unrelated board entries
examples/build_system/make/cpu/rv32imac-ilp32.mk Updates RISC-V march flags to include zifencei extension
examples/build_system/cmake/cpu/rv32imac-ilp32.cmake Updates RISC-V march flags to include zifencei extension
examples/host/*/only.txt Enables host examples for hpmicro family
examples/device/*_freertos/skip.txt Skips FreeRTOS device examples for hpmicro
README.rst Documents HPM6750 support in CPU compatibility table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


#if !TUD_OPT_HIGH_SPEED
dcd_reg->PORTSC1 = PORTSC1_FORCE_FULL_SPEED;
dcd_reg->PORTSC1 |= PORTSC1_FORCE_FULL_SPEED;
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from assignment (=) to bitwise OR (|=) modifies the behavior for all MCUs, not just HPM. This could potentially preserve unwanted bits that were previously cleared. If this change is necessary for HPM compatibility, consider making it conditional with #if TU_CHECK_MCU(OPT_MCU_HPM) or document why this change is safe for all supported MCUs.

Suggested change
dcd_reg->PORTSC1 |= PORTSC1_FORCE_FULL_SPEED;
#if TU_CHECK_MCU(OPT_MCU_HPM)
dcd_reg->PORTSC1 |= PORTSC1_FORCE_FULL_SPEED;
#else
dcd_reg->PORTSC1 = PORTSC1_FORCE_FULL_SPEED;
#endif

Copilot uses AI. Check for mistakes.
endif ()
set(CMAKE_TOOLCHAIN_FILE ${TOP}/examples/build_system/cmake/toolchain/riscv_${TOOLCHAIN}.cmake)

set(FAMILY_MCUS HPMIRCO CACHE INTERNAL "")
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the family name. "HPMIRCO" should be "HPMICRO".

Suggested change
set(FAMILY_MCUS HPMIRCO CACHE INTERNAL "")
set(FAMILY_MCUS HPMICRO CACHE INTERNAL "")

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: Zixun LI <[email protected]>
Signed-off-by: HiFiPhile <[email protected]>
@HiFiPhile HiFiPhile force-pushed the feature/support_hpmicro_chips branch from 4028edd to 6f90a4f Compare December 12, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants