🛠 HPM5100: Advanced Power-up and Secure Boot
Objectifs
This tutorial covers advanced initialization of the HPM5100 microcontroller via its SDK. We will configure Secure Boot, enable high-frequency clocks, and verify critical peripherals (ADC, PWM). Unlike beginner guides, we address thermal constraints for 480 MHz mode.
Matériel nécessaire
- HPM5100 development board (HPM5151)
- USB Type-C cable for power and debugging
- PC with HPM SDK v1.13.0 installed
- Oscilloscope (recommended for PWM signal verification)
- External 3.3V power supply (for standalone tests)
Étapes
Ensure RISC-V compilation tools are installed. Clone SDK v1.13.0 and set environment variables. ``bash source hpm_sdk_env.sh ``
- Environment Setup
The HPM5100 supports hardware secure boot. Enable it in the bootloader config to ensure only signed firmware runs. ``c // Configuration example in main.c hpm_sysctl_t *sysctl = hpm_sysctl; hpm_sysctl_secure_boot_enable(sysctl, true); ``
- Secure Boot Configuration
The RISC-V core can reach 480 MHz. Warning: This requires strict thermal management. Configure the main PLL. ``c // PLL configuration for 480 MHz hpm_sysctl_clock_config_t clock_config = { .cpu_clock = hpm_sysctl_clock_cpu_480mhz, .bus_clock = hpm_sysctl_clock_bus_120mhz, }; hpm_sysctl_clock_setup(sysctl, &clock_config); ``
- 480 MHz Clock Initialization
Initialize the 16-bit SAR ADC and check UART communication to confirm bus functionality. ``c // UART initialization for logs hpm_uart_init(hpm_uart0, 115200); printf("HPM5100 Secure Boot Active. CPU: %d MHz\n", 480); ``
- Critical Peripheral Verification
Compile for HPM5151 target and flash via USB OTG interface. ``bash make -j4 hpm_flash_programmer -p /dev/ttyUSB0 -f build/output.elf ``
- Compilation and Flashing
Vérification
- Use an oscilloscope to verify PWM signals (32 channels) are active at the configured frequency.
- Check serial output to confirm the secure boot message appears.
- Measure QFN/LQFP package temperature to ensure it stays below 105°C under load.
- Test SAR ADC latency (2 MSPS) with a known sinusoidal signal.
Pour aller plus loin
Explore the XPI interface for external memory connection. Study AES-128 encryption for data protection. Compare CoreMark performance at 400 MHz vs 480 MHz to optimize power/performance trade-offs.