Skip to content

Commit

Permalink
RT-Thread BSP v1.2.0 for HPM6300EVK
Browse files Browse the repository at this point in the history
- Integrated hpm_sdk v1.2.0
- Migrated to RT-Thread v5.0.1
- Adapted RT-Thread v5.0.x driver framework
- Added `flash_release` and `ram_release` for most projects
- Added UART RXFIFO timeout interrupt support
- Added README for each project

Signed-off-by: Fan YANG <[email protected]>
  • Loading branch information
helloeagleyang committed Aug 12, 2023
1 parent 03954d1 commit 703d3e5
Show file tree
Hide file tree
Showing 1,876 changed files with 741,468 additions and 893,665 deletions.
13 changes: 13 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## v1.2.0
- Integrated hpm_sdk v1.2.0
- Note:
- the docs, middleware, scripts, samples folder in SDK root directory were removed
- Updated:
- Upgraded rt-thread to v5.0.1
- Added `README.md` for all samples
- Added UART RXFIFO timeout interrupt support
- Added `flash_release` build and `ram_release` build
- Fixed:
- SD card performance is slow
- Uart lost data when working in low baudrate

## v1.1.0
- Integrated hpm_sdk v1.1.0
- Note:
Expand Down
13 changes: 13 additions & 0 deletions ChangeLog_zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# 更新

## v1.2.0
- 整合了hpm_sdk v1.2.0
- 注:
- SDK根目录下的docs,middleware,samples, scripts等目录被移除
- 更新
- 迁移到rt-thread v5.0.1
- 增加了sample README
- 增加了 `flash_release``ram_release` 工程
- 增加了 UART RXFIFO timeout 中断支持
- 修复:
- sd card 性能慢
- uart 在低波特率下丢数据

## v1.1.0

- 整合了hpm_sdk v1.1.0
Expand Down
50 changes: 35 additions & 15 deletions HPMicro-HPM6300EVK.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ board:
vendor: HPMicro
version: Rev.2
chip:
chip_name: HPM6300
chip_name: HPM6360
clock_source: HSE
device_vendor: HPMicro
family_name: HPM6000
Expand Down Expand Up @@ -49,12 +49,12 @@ features_zh:
- '调试接口: 板载FT2232'
pkg_type: Board_Support_Packages
pkg_vendor: HPMicro
pkg_version: 1.1.0
pkg_version: 1.2.0

template_projects:
- project_name: blink_led
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/blink_led
target_path_offset: ''
Expand All @@ -70,6 +70,7 @@ template_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand All @@ -95,11 +96,18 @@ template_projects:
source_path_offset: ''
target_path_offset: ''
files_and_folders: []
- package_name: J-Link
package_type: Debugger_Support_Packages
package_vendor: 'SEGGER'
package_version: v7.92
source_path_offset: ''
target_path_offset: ''
files_and_folders: []

example_projects:
- project_name: blink_led
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/blink_led
target_path_offset: ''
Expand All @@ -115,6 +123,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -142,7 +151,7 @@ example_projects:
files_and_folders: []
- project_name: flashdb_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/flashdb_demo
target_path_offset: ''
Expand All @@ -159,6 +168,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -187,7 +197,7 @@ example_projects:

- project_name: timer_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/timer_demo
target_path_offset: ''
Expand All @@ -203,6 +213,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -231,7 +242,7 @@ example_projects:

- project_name: sdcard_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/sdcard_demo
target_path_offset: ''
Expand All @@ -247,6 +258,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -275,7 +287,7 @@ example_projects:

- project_name: can_example
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/can_example
target_path_offset: ''
Expand All @@ -291,6 +303,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -319,7 +332,7 @@ example_projects:

- project_name: uart_dma_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/uart_dma_demo
target_path_offset: ''
Expand All @@ -335,6 +348,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -363,7 +377,7 @@ example_projects:

- project_name: adc_example
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/adc_example
target_path_offset: ''
Expand All @@ -379,6 +393,7 @@ example_projects:
- makefile.targets
- .settings
- .config
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -407,7 +422,7 @@ example_projects:

- project_name: ethernet_ptp_master_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/ethernet_ptp_master_demo
target_path_offset: ''
Expand All @@ -424,6 +439,7 @@ example_projects:
- .settings
- .config
- packages
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -452,7 +468,7 @@ example_projects:

- project_name: ethernet_ptp_slave_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/ethernet_ptp_slave_demo
target_path_offset: ''
Expand All @@ -469,6 +485,7 @@ example_projects:
- .settings
- .config
- packages
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -497,7 +514,7 @@ example_projects:

- project_name: ethernet_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/ethernet_demo
target_path_offset: ''
Expand All @@ -514,6 +531,7 @@ example_projects:
- .settings
- .config
- packages
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -543,7 +561,7 @@ example_projects:

- project_name: usb_host_msc_udisk
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/usb_host_msc_udisk
target_path_offset: ''
Expand All @@ -560,6 +578,7 @@ example_projects:
- .settings
- .config
- packages
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
Expand Down Expand Up @@ -588,7 +607,7 @@ example_projects:

- project_name: usb_device_generic_hid
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@4.1.0
project_type: rt-thread|@full|@5.0.1
builtin_files:
- source_path_offset: projects/usb_device_generic_hid
target_path_offset: ''
Expand All @@ -605,6 +624,7 @@ example_projects:
- .settings
- .config
- packages
- README.md
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ RT-Thread Studio BSP for HPM6300EVK Board
- ethernet_ptp_slave_demo
- usb_device_generic_hid
- usb_host_msc_udisk

## Environment Setup

### Toolchain setup

- After installing the BSP package, users need to set the `RTT_RISCV_TOOLCHAIN` environment variable before creating any examples/projects
- Assuming that the toolchain is installed in `C:\DevTools\RT-ThreadStudio\repo\Extract\ToolChain_Support_Packages\RISC-V\RISC-V-GCC-RV32\2022-04-12\bin`, User can set the `RTT_RISCV_TOOLCHAIN` environment variable referring below figure:

![Set RTT_RISCV_TOOLCHAIN environment variable](documents/images/set_rtt_riscv_toolchain_env.png)
10 changes: 8 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ HPM6300EVK 开板的 RT-Thread Studio 板级支持包
- flashdb_demo
- can_example
- adc_example
- demo运行前需要给ADC1 IN7引脚(插件J26 Pin5)一个输入电压,adc demo会通过控制台打印采样到的电压值
- 输入电压范围0-3.3v,超出范围可能会损坏芯片
- ethernet_demo
- ethernet_ptp_master_demo
- ethernet_ptp_slave_demo
- usb_device_generic_hid
- usb_host_msc_udisk


## 环境设置

## 工具链环境设置
- 安装好BSP包后, 用户在创建示例/工程前需要 设置 `RTT_RISCV_TOOLCHAIN` 环境变量。
- 假定RISC-V工具链安装于目录: `C:\DevTools\RT-ThreadStudio\repo\Extract\ToolChain_Support_Packages\RISC-V\RISC-V-GCC-RV32\2022-04-12\bin`, 用户可参考下图,配置`RTT_RISCV_TOOLCHAIN`环境变量
![设置 RTT_RISCV_TOOLCHAIN 环境变量](documents/images/set_rtt_riscv_toolchain_env.png)
2 changes: 1 addition & 1 deletion board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ menu "On-chip Peripheral Drivers"
if BSP_USING_SPI
config BSP_USING_SPI1
bool "Enable SPI1"
default y
default n
config BSP_USING_SPI2
bool "Enable SPI2"
default n
Expand Down
8 changes: 2 additions & 6 deletions board/board.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 HPMicro
* Copyright (c) 2022-2023 HPMicro
* SPDX-License-Identifier: BSD-3-Clause
*
*/
Expand Down Expand Up @@ -415,7 +415,7 @@ void board_init_clock(void)
clock_set_source_divider(clock_aud1, clk_src_pll2_clk0, 46); /* config clock_aud1 for 44100*n sample rate */
}

uint32_t board_init_adc12_clock(ADC16_Type *ptr)
uint32_t board_init_adc16_clock(ADC16_Type *ptr)
{
uint32_t freq = 0;
switch ((uint32_t) ptr) {
Expand Down Expand Up @@ -460,10 +460,6 @@ uint32_t board_init_i2s_clock(I2S_Type *ptr)
return 0;
}

uint32_t board_init_adc16_clock(ADC16_Type *ptr)
{
return 0;
}

uint32_t board_init_dac_clock(DAC_Type *ptr, bool clk_src_ahb)
{
Expand Down
2 changes: 1 addition & 1 deletion board/eth_phy_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void phy_poll_status(void *parameter)
{
int ret;
phy_info_t phy_info;
rt_uint32_t status;
rt_bool_t status;
rt_device_t dev;
rt_phy_msg_t msg;
rt_uint32_t speed, duplex;
Expand Down
6 changes: 3 additions & 3 deletions board/fal_cfg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 hpmicro
* Copyright (c) 2022-2023 HPMicro
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand All @@ -17,7 +17,6 @@
#define NOR_FLASH_SIZE_IN_BYTES 0x1000000UL

/* ===================== Flash device Configuration ========================= */
extern const struct fal_flash_dev stm32f2_onchip_flash;
extern struct fal_flash_dev nor_flash0;

/* flash device table */
Expand All @@ -32,7 +31,8 @@ extern struct fal_flash_dev nor_flash0;
{ \
{FAL_PART_MAGIC_WORD, "app", NOR_FLASH_DEV_NAME, 0, 4*1024*1024, 0}, \
{FAL_PART_MAGIC_WORD, "easyflash", NOR_FLASH_DEV_NAME, 4*1024*1024, 3*1024*1024, 0}, \
{FAL_PART_MAGIC_WORD, "download", NOR_FLASH_DEV_NAME, 7*1024*1024, 9*1024*1024, 0}, \
{FAL_PART_MAGIC_WORD, "download", NOR_FLASH_DEV_NAME, 7*1024*1024, 8*1024*1024, 0}, \
{FAL_PART_MAGIC_WORD, "flashdb", NOR_FLASH_DEV_NAME, 15*1024*1024, 1*1024*1024, 0}, \
}
#endif /* FAL_PART_HAS_TABLE_CFG */
#endif /* RT_USING_FAL */
Expand Down
Loading

0 comments on commit 703d3e5

Please sign in to comment.