🛠 HPM5100: First connection and advanced startup

HPMicro HPM5100: 400 MHz RISC-V MCU with Integrated Analog Peripherals · avance · Guide avancé pour initialiser correctement le HPM5100, gérer l'alimentation externe et configurer le débogage via USB OTG.

Objectives

This tutorial aims to master the critical startup of the HPM5100 microcontroller. Unlike basic MCUs, the HPM5100 offers high-performance modes (up to 480 MHz) requiring rigorous power and clock management. The goal is to configure the system for high-performance mode, initialize the USB 2.0 OTG interface for debugging, and verify the integrity of the 1 MB SiP flash. This process prepares the board for demanding applications like real-time motor control.

Required Hardware

Steps

  1. Hardware Verification: Before connecting, use a multimeter to confirm that the external supply voltage is stable at 3.3V. High-performance mode (480 MHz) requires clean and sufficient power; voltage drops can cause RISC-V core instability.
  2. USB Connection: Connect the board to the PC via the USB 2.0 OTG port. This port serves as both power supply (if external power is not used) and debug/console channel via virtual serial interface (CDC).
  3. SDK Configuration: Open a terminal, navigate to the HPMicro SDK directory. Configure the environment to target the HPM5100. Ensure environment variables point to version 1.13.0+, which includes native support for FreeRTOS and TinyUSB.
  4. Build Startup Project: Navigate to the hello_world example or a HPM5100-specific example in the SDK. Compile the project specifying the hpm5100 target. This step generates the binary loaded into SiP flash.
  5. Programming and Startup: Use the SDK's flashing utility to write the binary to the board. Once programmed, reset the board. The RISC-V core starts at 400 MHz by default. To reach 480 MHz, code must configure power control and PLL registers before activating high-performance mode.
  6. Serial Verification: Open the serial terminal. You should see SDK initialization messages. If no output appears, check debug pins (SWD/JTAG) or power supply.

Verification

Successful startup is indicated by a welcome message in the serial terminal. Verify that the core frequency is as expected (400 MHz by default). Use an oscilloscope on GPIO pins configured as outputs to measure system clock frequency if needed. Ensure USB is recognized as a device by the PC.

Further Reading

Explore the configuration of 16-bit SAR converters for high-speed analog reading. Test the CAN FD controller at 8 Mbps for embedded communication. Finally, enable Secure Boot to secure startup against firmware tampering.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials