Skip to content

Commit

Permalink
hpm sdk release v1.1.0
Browse files Browse the repository at this point in the history
Main changes since 1.0.0

Tested Segger Embedded Studio Version: 7.10

- Changed:
  - docs: add new docs for rtd project.
  - soc: ip: enet: update the enet register file
  - soc: ip: adc16: update the adc16 header file
  - soc: hpm_romapi - Add APIs for configuring remapping, exip regions
  - drivers: enet: improve APIs related to PPS
  - drivers: adc: change adc bus blocking interface
  - drivers: adc: optimize getting oneshot result
  - drivers: src: update the default config for ADC12&ADC16
  - boards: rename board-level APIs related to enet
  - components: enet_phy: rtl8201: update the register file
  - middleware: hpm_math: update dsp version
  - middleware: erpc: update to v1.10.0
  - samples: uart: rename uart_dma_rx_idle to uart_software_rx_idle
  - samples: uart: add hardware rx idle detection sample
  - samples: multicore: erpc: core1 add sdk_compile_options(-O1)
  - samples: drivers: gptmr: update sample output.
  - samples: lwip: common: arch: ethernetif: update a calling function name
  - samples:drivers: adc: optimize oneshot handler

- Added:
  - arch: add FPU related APIs
  - soc/board: add HPM6280 support
  - soc: HPM6750: acmp: add ACMP section
  - components: add mt9m114 support
  - drivers: add raw8 pixel format support
  - drivers: csr - Implement CSR driver
  - drivers: adc: adc16: support resolution setting
  - drivers/samples: add SDM/PLA/CRC/MCAN
  - drivers: I2C: add new API
  - drivers: adc: adc16: support resolution setting
  - drivers: enet: add enet control config for transmission
  - middleware: cherryusb: audio: update class driver and demo template
  - middleware: add mbedtls lib files with SDP acceleration
  - freeRTOS: add support for static allocation
  - samples: drivers: enet: add a pps demo
  - samples: cherryusb: add audio samples
  - samples: add the resolution parameter in all demos with ADC16
  - samples: add rfft demo
  - sampels: i2c: add interrupt b2b samples
  - samples: drivers: i2s: add an i2s_master demo
  - samples: drivers: i2s: add an i2s_slave demo
  - samples : rom_api : add sw_gm_api filter
  - samples: add the resolution parameter in all demos with ADC16

- Fixed:
  - openocd: hpm6300evk: update sdram initialization.
  - drivers: trgmux: trigmux edge filter setting error
  - drivers: enet: fix register access error
  - drivers: adc16: fix the config error of ADC16_CONFIG1
  - drivers: i2c: fix i2c timing configuration
  - drivers: SPI: fix SPI status API
  - drivers: fix gptmr cmp value don't minus one
  - drivers: mcan: correct the mcan ext_id filter issue
  - drivers: I2C: fix issue in i2c_master_address_read API
  - drivers: Self_ACK cannot be set in CAN driver
  - drivers: rtc rtc_config_alarm always return error code
  - cmake: correct source code compilation
  - soc: toolchain: gcc: initialize heap for SES
  - soc: gcc linker files: add NOLOAD keyword to noncacheable.bss section
  - soc: HPM6360: gcc: ld: correct noncacheable region name.
  - drivers: qei: Fix speed display always zero
  - middleware: freertos: disable global irq before vTaskStartScheduler
  - freeRTOS: fix trap when enable float feature
  - freeRTOS: fix tick lost
  - freeRTOS: fix segger project build warning
  - samples: drivers: i2s: fix CFGR config
  - samples: drivers: fix acmp toggle error
  - samples: lwip: fix the DHCP issue
  - samples: uart: fix irq_id judgment
  - samples: fix the order of uart pin configuration and clock configuration
  - samples: update spi dma sample
  - samples: drivers: sysctl: correct reset enable approach.
  - samples: fix dma_general_transfer sample memory out of bounds
  - samples: drivers: wdog: Fix logic issue on finding the nearest interrupt interval
  - sample: audio_codec: decoder_wav: add '\0' to fatfs path

Signed-off-by: Ryan QIAN <[email protected]>
  • Loading branch information
jhqian committed Mar 31, 2023
1 parent 9425336 commit 0d007e1
Show file tree
Hide file tree
Showing 1,657 changed files with 541,623 additions and 61,667 deletions.
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,88 @@
# Change Log

## [1.1.0] - 2023-03-31:

Main changes since 1.0.0

Tested Segger Embedded Studio Version: 7.10

### Changed:
- docs: add new docs for rtd project.
- soc: ip: enet: update the enet register file
- soc: ip: adc16: update the adc16 header file
- soc: hpm_romapi - Add APIs for configuring remapping, exip regions
- drivers: enet: improve APIs related to PPS
- drivers: adc: change adc bus blocking interface
- drivers: adc: optimize getting oneshot result
- drivers: src: update the default config for ADC12&ADC16
- boards: rename board-level APIs related to enet
- components: enet_phy: rtl8201: update the register file
- middleware: hpm_math: update dsp version
- middleware: erpc: update to v1.10.0
- samples: uart: rename uart_dma_rx_idle to uart_software_rx_idle
- samples: uart: add hardware rx idle detection sample
- samples: multicore: erpc: core1 add sdk_compile_options(-O1)
- samples: drivers: gptmr: update sample output.
- samples: lwip: common: arch: ethernetif: update a calling function name
- samples:drivers: adc: optimize oneshot handler

### Added:
- arch: add FPU related APIs
- soc/board: add HPM6280 support
- soc: HPM6750: acmp: add ACMP section
- components: add mt9m114 support
- drivers: add raw8 pixel format support
- drivers: csr - Implement CSR driver
- drivers: adc: adc16: support resolution setting
- drivers/samples: add SDM/PLA/CRC/MCAN
- drivers: I2C: add new API
- drivers: adc: adc16: support resolution setting
- drivers: enet: add enet control config for transmission
- middleware: cherryusb: audio: update class driver and demo template
- middleware: add mbedtls lib files with SDP acceleration
- freeRTOS: add support for static allocation
- samples: drivers: enet: add a pps demo
- samples: cherryusb: add audio samples
- samples: add the resolution parameter in all demos with ADC16
- samples: add rfft demo
- sampels: i2c: add interrupt b2b samples
- samples: drivers: i2s: add an i2s_master demo
- samples: drivers: i2s: add an i2s_slave demo
- samples : rom_api : add sw_gm_api filter
- samples: add the resolution parameter in all demos with ADC16

### Fixed:
- openocd: hpm6300evk: update sdram initialization.
- drivers: trgmux: trigmux edge filter setting error
- drivers: enet: fix register access error
- drivers: adc16: fix the config error of ADC16_CONFIG1
- drivers: i2c: fix i2c timing configuration
- drivers: SPI: fix SPI status API
- drivers: fix gptmr cmp value don't minus one
- drivers: mcan: correct the mcan ext_id filter issue
- drivers: I2C: fix issue in i2c_master_address_read API
- drivers: Self_ACK cannot be set in CAN driver
- drivers: rtc rtc_config_alarm always return error code
- cmake: correct source code compilation
- soc: toolchain: gcc: initialize heap for SES
- soc: gcc linker files: add NOLOAD keyword to noncacheable.bss section
- soc: HPM6360: gcc: ld: correct noncacheable region name.
- drivers: qei: Fix speed display always zero
- middleware: freertos: disable global irq before vTaskStartScheduler
- freeRTOS: fix trap when enable float feature
- freeRTOS: fix tick lost
- freeRTOS: fix segger project build warning
- samples: drivers: i2s: fix CFGR config
- samples: drivers: fix acmp toggle error
- samples: lwip: fix the DHCP issue
- samples: uart: fix irq_id judgment
- samples: fix the order of uart pin configuration and clock configuration
- samples: update spi dma sample
- samples: drivers: sysctl: correct reset enable approach.
- samples: fix dma_general_transfer sample memory out of bounds
- samples: drivers: wdog: Fix logic issue on finding the nearest interrupt interval
- sample: audio_codec: decoder_wav: add '\0' to fatfs path

## [1.00.0] - 2022-12-31:

Main changes since 0.14.0
Expand Down
38 changes: 23 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.20)
endif()
cmake_policy(SET CMP0079 NEW)

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
if(flash_size)
sdk_linker_global_symbols("_flash_size=${flash_size}")
endif()

if(extram_size)
sdk_linker_global_symbols("_extram_size=${extram_size}")
endif()

sdk_linker_global_symbols("_flash_size=${flash_size}")
sdk_linker_global_symbols("_extram_size=${extram_size}")
sdk_linker_global_symbols("_heap_size=${HEAP_SIZE}")
sdk_linker_global_symbols("_stack_size=${STACK_SIZE}")

Expand Down Expand Up @@ -108,7 +111,7 @@ endif()

if(DEFINED CUSTOM_SES_STARTUP_FILE)
set(USE_CUSTOM_STARTUP 1)
sdk_gcc_src(${CUSTOM_SES_STARTUP_FILE})
sdk_ses_src(${CUSTOM_SES_STARTUP_FILE})
endif()

sdk_sys_inc(${SYSROOT_DIR}/include)
Expand Down Expand Up @@ -151,44 +154,49 @@ endif()

sdk_ld_options("-T ${LINKER_SCRIPT}")

set(generated_file_path "${PROJECT_BINARY_DIR}/generated")
# prepare dummy file
set(EMPTY_FILE ${PROJECT_BINARY_DIR}/misc/empty.c)
set(EMPTY_FILE ${generated_file_path}/misc/empty.c)
file(WRITE ${EMPTY_FILE} "")

add_executable(${APP_ELF_NAME} ${EMPTY_FILE})

# generate SDK version file
execute_process(
COMMAND ${CMAKE_COMMAND} -DHPM_SDK_BASE=${HPM_SDK_BASE}
-DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/hpm_sdk_version.h
-DOUT_FILE=${generated_file_path}/include/hpm_sdk_version.h
-P ${HPM_SDK_BASE}/cmake/gen_version_h.cmake
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
sdk_inc(${PROJECT_BINARY_DIR}/include/generated/)
sdk_inc(${generated_file_path}/include)

set_target_properties(${APP_ELF_NAME} PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})

if("${TOOLCHAIN_VARIANT}" STREQUAL "nds-gcc")
target_link_libraries(${APP_ELF_NAME}
"-Wl,-Map=${PROJECT_BINARY_DIR}/${APP_MAP_NAME}"
"-Wl,-Map=${EXECUTABLE_OUTPUT_PATH}/${APP_MAP_NAME}"
"-Wl,--whole-archive"
${HPM_SDK_NDSGCC_LIB_ITF}
${HPM_SDK_GCC_LIB} ${HPM_SDK_GCC_LIB_ITF}
${HPM_SDK_LIB} ${HPM_SDK_LIB_ITF} app)
${HPM_SDK_LIB} ${HPM_SDK_LIB_ITF} app
"-Wl,--no-whole-archive")
else()
target_link_libraries(${APP_ELF_NAME}
"-Wl,-Map=${PROJECT_BINARY_DIR}/${APP_MAP_NAME}"
${HPM_SDK_GCC_LIB} ${HPM_SDK_GCC_LIB_ITF}
${HPM_SDK_LIB} ${HPM_SDK_LIB_ITF} app)
"-Wl,-Map=${EXECUTABLE_OUTPUT_PATH}/${APP_MAP_NAME}"
"-Wl,--whole-archive"
${HPM_SDK_GCC_LIB} ${HPM_SDK_GCC_LIB_ITF}
${HPM_SDK_LIB} ${HPM_SDK_LIB_ITF} app
"-Wl,--no-whole-archive")
endif()

add_custom_command(
TARGET ${APP_ELF_NAME}
COMMAND "${CROSS_COMPILE}objcopy" -O binary -S ${PROJECT_BINARY_DIR}/${APP_ELF_NAME} ${PROJECT_BINARY_DIR}/${APP_BIN_NAME}
COMMAND "${CROSS_COMPILE}objcopy" -O binary -S ${EXECUTABLE_OUTPUT_PATH}/${APP_ELF_NAME} ${EXECUTABLE_OUTPUT_PATH}/${APP_BIN_NAME}
)

add_custom_command(
TARGET ${APP_ELF_NAME}
COMMAND "${CROSS_COMPILE}objdump" -S -d ${PROJECT_BINARY_DIR}/${APP_ELF_NAME} > ${PROJECT_BINARY_DIR}/${APP_ASM_NAME}
COMMAND "${CROSS_COMPILE}objdump" -S -d ${EXECUTABLE_OUTPUT_PATH}/${APP_ELF_NAME} > ${EXECUTABLE_OUTPUT_PATH}/${APP_ASM_NAME}
)


Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BSD 3-Clause "New" or "Revised" License
https://spdx.org/licenses/BSD-3-Clause.html

Copyright (c) 2021-2022, HPMicro. All rights reserved.
Copyright (c) 2021-2023, HPMicro. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
``` mermaid
gantt
title HPM SDK Release Plan
dateFormat YYYY-MM-DD
section Mainline Release
v1.1.0 :a1, 2023-01-01, 2023-03-31
v1.2.0 :a2, 2023-04-01, 2023-06-30
v1.3.0 :a3, 2023-07-01, 2023-09-30
v1.4.0 :a4, 2023-10-01, 2023-12-31
```

[中文](README_zh.md)

# HPM SDK Overview
The HPM SDK Project is a software development kit based on HPMicro's MCUs, which supports a wide range of MCUs, based on the BSD license, including drivers, middleware and RTOS, such as littlevgl/ lwIP/ TinyUSB/ FreeRTOS, etc. It supports a large number of Boards.

## SDK directory
## SDK Directory Structure

| Name | Description |
|--------|--------|
| <HPM_SDK_BASE>/arch | cpu architecture |
| <HPM_SDK_BASE>/boards | board support files |
| <HPM_SDK_BASE>/cmake | cmake extensions |
| <HPM_SDK_BASE>/components | software components |
| <HPM_SDK_BASE>/doc | documentation |
| <HPM_SDK_BASE>/docs | documentation |
| <HPM_SDK_BASE>/drivers | low level driver files |
| <HPM_SDK_BASE>/middleware | middleware files |
| <HPM_SDK_BASE>/samples | sample source for drivers, middleware, components |
| <HPM_SDK_BASE>/scripts | util scripts |
| <HPM_SDK_BASE>/soc | SoC specific source |
| <HPM_SDK_BASE>/utils | util source |

## SDK Documentation
- Local:
SDK documentation can be built locally, once it's done, it can be accessed with the following entries:
- <HPM_SDK_BASE>>/docs/index.html
- <HPM_SDK_BASE>>/docs/index_zh.html
> Please refer to <HPM_SDK_BASE>/docs/README.md for more details about documentation building.
- Online:
- http://hpm-sdk.readthedocs.io/
- http://hpm-sdk-zh.readthedocs.io/

## HPM SDK Quick Start Guide

### Minimum required version of dependencies are:
Expand Down
29 changes: 26 additions & 3 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
``` mermaid
gantt
title HPM SDK Release Plan
dateFormat YYYY-MM-DD
section Mainline Release
v1.1.0 :a1, 2023-01-01, 2023-03-31
v1.2.0 :a2, 2023-04-01, 2023-06-30
v1.3.0 :a3, 2023-07-01, 2023-09-30
v1.4.0 :a4, 2023-10-01, 2023-12-31
```

[English](README.md)

# HPM SDK 概述
HPM SDK项目是基于HPMicro 公司的MCU编写的软件开发包,支持多种MCU。基于BSD许可证,包含了底层驱动,中间件和RTOS,例如littlevgl/ lwIP/ TinyUSB/ FreeRTOS等,支持大量评估板。

## HPM SDK directory
## HPM SDK 目录结构

| 目录名称 | 描述 |
|--------|--------|
| <HPM_SDK_BASE>/arch | cpu架构相关文件 |
| <HPM_SDK_BASE>/boards | 板级文件 |
| <HPM_SDK_BASE>/cmake | cmake扩展 |
| <HPM_SDK_BASE>/components | 软件组件 |
| <HPM_SDK_BASE>/doc | 文档 |
| <HPM_SDK_BASE>/docs | 文档 |
| <HPM_SDK_BASE>/drivers | 底层驱动文件|
| <HPM_SDK_BASE>/middleware | 中间件 |
| <HPM_SDK_BASE>/samples | 驱动、中间件以及软件组件示例代码 |
| <HPM_SDK_BASE>/scripts | 辅助脚本 |
| <HPM_SDK_BASE>/soc | SoC相关文件 |
| <HPM_SDK_BASE>/utils | 辅助文件 |

## SDK文档
- 本地文档:
SDK文档可以进行本地编译,成功编译之后可以通过以下入口访问本地文档:
- <HPM_SDK_BASE>>/docs/index.html
- <HPM_SDK_BASE>>/docs/index_zh.html
> 文档编译方式请参考<HPM_SDK_BASE>/docs/README.md
- 在线文档:
- http://hpm-sdk.readthedocs.io/
- http://hpm-sdk-zh.readthedocs.io/

## HPM SDK使用说明

### 依赖软件最低版本要求
Expand Down Expand Up @@ -274,4 +297,4 @@ HPM SDK项目是基于HPMicro 公司的MCU编写的软件开发包,支持多
## 社区支持
- github page: https://hpmicro.github.io
- github: https://github.com/hpmicro/hpm_sdk
- gitee: https://gitee.com/hpmicro/hpm_sdk
- gitee: https://gitee.com/hpmicro/hpm_sdk
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_MINOR = 1
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION = 0
27 changes: 26 additions & 1 deletion arch/riscv/riscv_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ extern "C" {
*
* @return csr value before cleared
*/
#define read_clear_csr(csr_num, bit) ({ uint32_t v; __asm volatile("csrrc %0, %1, %2" : "=r"(v) : "i"(csr_num), "r"(bit)); v; })
#define read_clear_csr(csr_num, bit) ({ volatile uint32_t v = 0; __asm volatile("csrrc %0, %1, %2" : "=r"(v) : "i"(csr_num), "r"(bit)); v; })

/**
* @brief read and set bits in csr
*
* @param csr_num specific csr
* @param bit bits to be set
*
* @return csr value before set
*/
#define read_set_csr(csr_num, bit) ({ volatile uint32_t v = 0; __asm volatile("csrrs %0, %1, %2" : "=r"(v) : "i"(csr_num), "r"(bit)); v; })

/**
* @brief set bits in csr
Expand Down Expand Up @@ -77,6 +87,21 @@ extern "C" {
*/
#define fencei() __asm volatile("fence.i")

/**
* @brief enable fpu
*/
#define enable_fpu() read_set_csr(CSR_MSTATUS, CSR_MSTATUS_FS_MASK)

/**
* @brief disable fpu
*/
#define disable_fpu() read_clear_csr(CSR_MSTATUS, CSR_MSTATUS_FS_MASK)

/**
* @brief clear fcsr
*/
#define clear_fcsr() write_fcsr(0)

#ifdef __cplusplus
}
#endif
Expand Down
8 changes: 8 additions & 0 deletions boards/hpm6200evk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2022 hpmicro
# SPDX-License-Identifier: BSD-3-Clause

sdk_compile_definitions_ifdef(BUILD_FOR_SECONDARY_CORE BOARD_RUNNING_CORE=HPM_CORE1)

sdk_inc(.)
sdk_src(pinmux.c)
sdk_src(board.c)
Loading

0 comments on commit 0d007e1

Please sign in to comment.