HPMicro HPM SDK

repository·main·Indexed 42 days ago

https://github.com/hpmicro/hpm_sdk

A 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.

Tokens
331.8K
Snippets
726
Records
1.5K
Agent score
48%

What's inside HPM SDK

  1. Overview of MicroQuickJS (MQuickJS)

    main

    MicroQuickJS (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() or free(). 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.
  2. Overview of the SMBus component

    main

    The 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.
  3. What is eRPC (Embedded RPC)?

    main

    eRPC 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 erpcgen that processes .erpc IDL 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.
  4. Overview of ESP-Hosted MCU Slave firmware

    main

    The 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.

  5. Overview of SDM (Sigma-Delta Modulator) Peripheral

    main

    The 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.
  6. Overview of MCAN (Bosch M_CAN) Samples

    main

    The 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).
  7. Overview of SEGGER RTT middleware

    main
    SEGGER 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 like printf() to the RTT interface.