HPMicro HPM SDK
repository·main·Indexed 42 days ago
https://github.com/hpmicro/hpm_sdkA comprehensive BSD-licensed software development kit for HPMicro MCUs. It provides drivers, RTOS support (such as FreeRTOS), and middleware including lwIP, TinyUSB, the hardware-agnostic Agile Modbus protocol stack (supporting RTU and TCP), and the CANopenNode protocol stack for embedded control systems.
What's inside HPM SDK
- This project demonstrates the Modbus TCP Master functionality. In this demonstration, one board acts as the TCP Master and another board acts as the TCP Slave. The Master is configured to send a 'read holding register' request and waits for the Slave to respond with the requested data.
Overview of MicroQuickJS (MQuickJS)
mainMicroQuickJS (MQuickJS) is a JavaScript engine specifically designed for embedded systems. It is highly resource-efficient, requiring only 10 kB RAM to run and approximately 100 kB ROM (ARM Thumb-2 code) for the entire engine, including the C standard library.
Key characteristics:
- Performance: Runs at speeds comparable to QuickJS.
- JavaScript Subset: Supports a subset of ES5 with a "Strict Mode" philosophy that disables error-prone or inefficient constructs.
- Memory Management: Uses a tracing compressor garbage collector and does not rely on
malloc()orfree(). Strings are stored in UTF-8 format. - Architecture: The VM does not use the CPU stack, and the engine uses its own internal memory allocator.
Overview of the SMBus component
mainThe SMBus (System Management Bus) component is an extension of the I2C bus protocol, providing interfaces compliant with the SMBus 2.0 specification. It is designed for system management and supports both 7-bit and 10-bit device addressing.
Key Capabilities:
- Protocol Support: Standard SMBus 2.0 formats, including automatic Packet Error Checking (PEC) using CRC.
- Transfer Modes: Supports single/dual-byte operations and command-code based transfers (Byte, Word, and Block transfers) in master mode. It supports Normal (100kHz), Fast (400kHz), and High-speed (1MHz) modes.
- Data Integrity: Features hardware-automated PEC checksum calculation and end-to-end data protection for multi-byte transfers.
Overview of USB Serial Host Example
mainThe USB Serial Host example demonstrates how to implement a USB host using a unified serial framework. This framework is compatible with various device types, including:
- CDC ACM
- CH340
- CP210x
- FTDI
- PL2303
- GSM modems
Overview of the SEGMENT LED KEY example
mainTheSEGMENT LED KEYexample project demonstrates the integration of 5 LEDs and a 2x3 key matrix. It utilizes thecomponents/segment_ledcomponent, which provides an easy way to control the blinking of individual segments within a digital tube (segment LED).What is eRPC (Embedded RPC)?
maineRPC is an open-source Remote Procedure Call (RPC) system designed specifically for tightly coupled multichip embedded systems and heterogeneous multicore SoCs.
Key characteristics:
- Small Footprint: Designed for embedded use with a code size typically under 5kB.
- Language Support: Uses plain C for remote functions, allowing you to export existing C functions without changing their prototypes.
- Code Generation: Uses a tool called
erpcgenthat processes.erpcIDL files to generate serialization and invocation shim code for C/C++ or Python. - Transport Agnostic: Supports various transports including CMSIS UART, NXP Kinetis SPI/DSPI, POSIX/Windows serial ports, TCP/IP, NXP RPMsg-Lite, USB CDC, and more.
Overview of ESP-Hosted MCU Slave firmware
mainThe ESP-Hosted MCU Slave Example provides slave firmware that enables host MCUs to access Wi-Fi and Bluetooth capabilities via an ESP32 series co-processor.
Connectivity is established through one of three transport interfaces:
- SDIO
- SPI
- UART
While the default example focuses on basic connectivity, it supports advanced features such as Network Split and Host Power Save for optimized network traffic and power management.
Overview of tsn_lwip_iperf example
mainThe
tsn_lwip_iperfexample demonstrates TCP/UDP throughput performance testing using theiperftool. It supports four distinct operational modes to test communication between the MCU and a PC:- MCU as TCP Server / PC as TCP Client
- MCU as TCP Client / PC as TCP Server
- MCU as UDP Server / PC as UDP Client
- MCU as UDP Client / PC as UDP Server
Overview of SDM (Sigma-Delta Modulator) Peripheral
mainThe SDM peripheral performs data sampling and amplitude detection for data streams output by a Sigma-Delta modulator. It supports 4 independent CLK/DAT signal pairs, each with configurable sampling modes.
Key Features
- Signal Input Interface: 4 independent CLK and DAT pairs. Each pair can be configured for various sampling modes (e.g., rising edge, falling edge, Manchester encoding).
- Data Filter (PCM_CIC): Supports Sinc1, Sinc2, Sinc3, and SincFast filter types with configurable oversampling rates (1-256) and a 16-depth 32-bit FIFO.
- Amplitude Detector (AMP_CIC): Provides independent amplitude monitoring with high/low threshold detection, zero-crossing detection, and real-time amplitude output.
- Interrupts: Supports FIFO threshold, data overflow, data saturation, and amplitude limit interrupts.
- Synchronization: Supports TRGMUX trigger input and output for synchronous sampling.
Overview of the BLDC SMC project
mainThebldc_smcproject implements sensorless speed control for DC brushless motors. It utilizes the FOC (Field Oriented Control) algorithm combined with a sensorless control algorithm specifically designed for SMC.Overview of MCAN (Bosch M_CAN) Samples
mainThe MCAN samples demonstrate the features of the Bosch M_CAN peripheral on HPMicro SoCs. All demos utilize a shared infrastructure (
mcan_app_common.c/.h) and are accessed via an interactive serial menu. Each menu option is self-contained: it initializes the CAN peripheral, executes a specific test, prints the results, and returns to the main menu.Core Infrastructure Components:
main()and interactive menu management.- Unified ISR dispatcher (
board_can_isr). - CAN instance table (
s_can_info[]). - AHB-RAM message-buffer helpers (
mcan_setup_msg_buf). - Utility functions for error handling (
handle_can_error), timestamping (get_timestamp_hex_string), and message display (show_received_can_message).
Overview of SEGGER RTT middleware
mainSEGGER RTT (Real Time Transfer) is a middleware component that allows for high-speed, non-intrusive data transfer between a target microcontroller and a host computer via a debug probe (like J-Link). It provides mechanisms for logging, bi-directional communication, and retargeting standard C library functions likeprintf()to the RTT interface.