🛠 HPM5100: First connection and advanced startup
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
- HPM5100 development board (QFN or LQFP package).
- Stable external power supply (3.3V) capable of providing sufficient current for 480 MHz mode.
- USB-C or micro-USB cable (depending on the OTG connector).
- PC with HPMicro SDK version 1.13.0 or higher installed.
- Serial terminal (minicom, Putty) configured at 115200 baud.
- Multimeter to check supply voltages before powering on.
Steps
- 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.
- 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).
- 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.
- Build Startup Project: Navigate to the
hello_worldexample or a HPM5100-specific example in the SDK. Compile the project specifying thehpm5100target. This step generates the binary loaded into SiP flash. - 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.
- 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.