Skip to content

Commit

Permalink
RT-Thread BSP v1.5.0 release for HPM6800EVK
Browse files Browse the repository at this point in the history
- integrated hpm_sdk v1.5.0
- added systemview component
- added support for preemptive & vectored interrupt mode
- optimized ethernet phy
- optimized pin(gpio)driver
- switched usb stack to cherryusb

Signed-off-by: Fan YANG <[email protected]>
  • Loading branch information
helloeagleyang committed Apr 29, 2024
1 parent f19e8cc commit d0a516e
Show file tree
Hide file tree
Showing 4,441 changed files with 831,803 additions and 585,598 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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.5.0

- Integrated hpm_sdk v1.5.0
- Updated:
- usb stack switched to cherryUSB for usb samples
- ETH PHY abstraction layer multi-instance support and optimization
- Fixed:
- MCAN sample read data error when enable RT_CAN_USING_HDR
- Added:
- added interrupt vector mode and preemptive mode
- systemView component
- rtt lcd driver

## 1.4.1
- Fixed:
- Transmission error while enabling DMA in I2C driver
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.5.0

- 整合了hpm_sdk v1.5.0
- 更新:
- USB相关sample协议栈切换为cherryUSB
- ETH PHY 抽象层多实例支持和优化
- 修复:
- MCAN sample开启硬件过滤器读取数据错误的问题
- 新增:
- 增加中断向量模式和可抢占模式
- systemView组件
- rtt lcd driver驱动

## v1.4.1
- 修复:
- I2C开启DMA后传输出错的问题
Expand Down
56 changes: 1 addition & 55 deletions HPMicro-HPM6800EVK.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ features_zh:

pkg_type: Board_Support_Packages
pkg_vendor: HPMicro
pkg_version: 1.4.1
pkg_version: 1.5.0

template_projects:
- project_name: blink_led
Expand Down Expand Up @@ -954,59 +954,5 @@ example_projects:
source_path_offset: ''
target_path_offset: ''
files_and_folders: []
- project_name: webnet_demo
project_description: create this project if user choose rt-thread project
project_type: rt-thread|@full|@5.0.2
builtin_files:
- source_path_offset: projects/webnet_demo
target_path_offset: ''
files_and_folders:
- .config
- .config.old
- .cproject
- .project
- .settings
- applications
- Kconfig
- makefile.targets
- packages
- README.md
- rtconfig.h
- rtconfig.py
- rtconfig_preinc.h
- SConscript
- SConstruct
- source_path_offset: 'common'
target_path_offset: ''
files_and_folders:
- libraries
- rt-thread
- startup
- source_path_offset: ''
target_path_offset: ''
files_and_folders:
- board
external_files:
- package_name: RISC-V-GCC-RV32
package_type: ToolChain_Support_Packages
package_vendor: RISC-V
package_version: '2022-04-12'
source_path_offset: ''
target_path_offset: ''
files_and_folders: []
- package_name: OpenOCD-HPMicro
package_type: Debugger_Support_Packages
package_vendor: HPMicro
package_version: '0.4.0'
source_path_offset: ''
target_path_offset: ''
files_and_folders: []
- package_name: J-Link
package_type: Debugger_Support_Packages
package_vendor: SEGGER
package_version: 'v7.94g'
source_path_offset: ''
target_path_offset: ''
files_and_folders: []

yaml_version: 3
60 changes: 30 additions & 30 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
BSD 3-Clause "New" or "Revised" License
https://spdx.org/licenses/BSD-3-Clause.html
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:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
BSD 3-Clause "New" or "Revised" License
https://spdx.org/licenses/BSD-3-Clause.html

Copyright (c) 2021-2024, 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:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ RT-Thread Studio BSP for HPM6800EVK Board
- uart_dma_demo
- usb_device_generic_hid
- usb_host_msc_udisk
- web_camera_demo
- webnet_demo
- web_camera_demo
3 changes: 1 addition & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ HPM6800EVK 开发板的 RT-Thread Studio 板级支持包
- uart_dma_demo
- usb_device_generic_hid
- usb_host_msc_udisk
- web_camera_demo
- webnet_demo
- web_camera_demo
40 changes: 40 additions & 0 deletions board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ menu "On-chip Peripheral Drivers"
menuconfig BSP_USING_LCD
bool "Enable LCD"
default n
if BSP_USING_LCD
config BSP_USING_LCD_ISR
bool "Enable LCD interrupt"
default n
endif

menuconfig BSP_USING_LVGL
bool "Enable LVGL"
Expand Down Expand Up @@ -273,6 +278,7 @@ menu "On-chip Peripheral Drivers"
default n
config BSP_USING_USB_HOST
bool "Enable USB Host"
select RT_USING_CACHE
default n
endif

Expand Down Expand Up @@ -402,9 +408,43 @@ menu "On-chip Peripheral Drivers"
menuconfig BSP_USING_MIPI_DSI
bool "Enable MIPI DSI Driver"
default n
menuconfig BSP_USING_RTT_LCD_DRIVER
bool "Enable RTT LCD Driver"
select BSP_USING_LCD
default n
endmenu

menu "Segger SystemView Config"
config BSP_USING_SYSTEMVIEW
select RT_USING_SYSTEMVIEW
select RT_USING_LEGACY
bool "Enable Segger SystemView"
default n

if BSP_USING_SYSTEMVIEW
menuconfig BSP_SYSTEMVIEW_RTT_SECTION
bool "enable SystemView RTT section"
default y
if BSP_SYSTEMVIEW_RTT_SECTION
config SEGGER_RTT_SECTION
string "segger rtt section"
default ".noncacheable.bss"
config SEGGER_RTT_BUFFER_SECTION
string "segger rtt buffer section"
default ".noncacheable.bss"
config SEGGER_SYSVIEW_SECTION
string "segger sysview section"
default ".noncacheable.bss"
endif
source "$RTT_DIR/../libraries/misc/systemview/Kconfig"
endif
endmenu

menu "Hpmicro Interrupt Config"
config HPM_USING_VECTOR_PREEMPTED_MODE
bool "Enable Vector and Preempted Mode(experimental)"
default n
endmenu

endmenu

57 changes: 26 additions & 31 deletions board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ void board_init_console(void)
* uart rx pin when configuring pin function will cause a wrong data to be received.
* And a uart rx dma request will be generated by default uart fifo dma trigger level.
*/
init_uart_pins((UART_Type *) BOARD_CONSOLE_BASE);
init_uart_pins((UART_Type *) BOARD_CONSOLE_UART_BASE);

/* Configure the UART clock to 24MHz */
clock_set_source_divider(BOARD_CONSOLE_CLK_NAME, clk_src_osc24m, 1U);
clock_add_to_group(BOARD_CONSOLE_CLK_NAME, 0);
clock_set_source_divider(BOARD_CONSOLE_UART_CLK_NAME, clk_src_osc24m, 1U);
clock_add_to_group(BOARD_CONSOLE_UART_CLK_NAME, 0);

cfg.type = BOARD_CONSOLE_TYPE;
cfg.base = (uint32_t) BOARD_CONSOLE_BASE;
cfg.src_freq_in_hz = clock_get_frequency(BOARD_CONSOLE_CLK_NAME);
cfg.baudrate = BOARD_CONSOLE_BAUDRATE;
cfg.base = (uint32_t) BOARD_CONSOLE_UART_BASE;
cfg.src_freq_in_hz = clock_get_frequency(BOARD_CONSOLE_UART_CLK_NAME);
cfg.baudrate = BOARD_CONSOLE_UART_BAUDRATE;

if (status_success != console_init(&cfg)) {
/* failed to initialize debug console */
Expand Down Expand Up @@ -495,13 +495,15 @@ void board_init_clock(void)
clock_add_to_group(clock_eth0, 0);
clock_add_to_group(clock_ffa, 0);

clock_add_to_group(clock_tsns, 0);

board_init_display_system_clock();

/* Connect Group0 to CPU0 */
clock_connect_group_to_cpu(0, 0);

/* Bump up DCDC voltage to 1250mv */
pcfg_dcdc_set_voltage(HPM_PCFG, 1.250);
/* Bump up DCDC voltage to 1150mv */
pcfg_dcdc_set_voltage(HPM_PCFG, 1150);

/* Configure PLL1_CLK0 Post Divider to 1 */
pllctlv2_set_postdiv(HPM_PLLCTLV2, 0, 0, 0);
Expand Down Expand Up @@ -1005,7 +1007,7 @@ void init_ddr2_800(void)
| (15UL << 12)
| (50UL << 16)
| (10UL << 22)
| (60 << 26);
| (60UL << 26);
HPM_DDRPHY->DTPR1 = (2UL << 0)
| (31UL << 5)
| (80UL << 11)
Expand Down Expand Up @@ -1164,6 +1166,8 @@ void board_init_usb_pins(void)
{
init_usb_pins();
usb_hcd_set_power_ctrl_polarity(BOARD_USB, true);
/* Wait USB_PWR pin control vbus power stable. Time depend on decoupling capacitor, you can decrease or increase this time */
board_delay_ms(100);
}

void board_usb_vbus_ctrl(uint8_t usb_index, uint8_t level)
Expand Down Expand Up @@ -1323,7 +1327,8 @@ hpm_stat_t board_init_enet_pins(ENET_Type *ptr)
init_enet_pins(ptr);

if (ptr == HPM_ENET0) {
gpio_set_pin_output_with_initial(BOARD_ENET0_RST_GPIO, BOARD_ENET0_RST_GPIO_INDEX, BOARD_ENET0_RST_GPIO_PIN, 0);
gpio_set_pin_output_with_initial(BOARD_ENET_RGMII_RST_GPIO, BOARD_ENET_RGMII_RST_GPIO_INDEX,
BOARD_ENET_RGMII_RST_GPIO_PIN, 0);
} else {
return status_invalid_argument;
}
Expand All @@ -1334,9 +1339,9 @@ hpm_stat_t board_init_enet_pins(ENET_Type *ptr)
hpm_stat_t board_reset_enet_phy(ENET_Type *ptr)
{
if (ptr == HPM_ENET0) {
gpio_write_pin(BOARD_ENET0_RST_GPIO, BOARD_ENET0_RST_GPIO_INDEX, BOARD_ENET0_RST_GPIO_PIN, 0);
gpio_write_pin(BOARD_ENET_RGMII_RST_GPIO, BOARD_ENET_RGMII_RST_GPIO_INDEX, BOARD_ENET_RGMII_RST_GPIO_PIN, 0);
board_delay_ms(1);
gpio_write_pin(BOARD_ENET0_RST_GPIO, BOARD_ENET0_RST_GPIO_INDEX, BOARD_ENET0_RST_GPIO_PIN, 1);
gpio_write_pin(BOARD_ENET_RGMII_RST_GPIO, BOARD_ENET_RGMII_RST_GPIO_INDEX, BOARD_ENET_RGMII_RST_GPIO_PIN, 1);
} else {
return status_invalid_argument;
}
Expand Down Expand Up @@ -1398,6 +1403,15 @@ hpm_stat_t board_init_enet_rmii_reference_clock(ENET_Type *ptr, bool internal)
return status_success;
}

hpm_stat_t board_init_enet_rgmii_clock_delay(ENET_Type *ptr)
{
if (ptr == HPM_ENET0) {
return enet_rgmii_set_clock_delay(ptr, BOARD_ENET_RGMII_TX_DLY, BOARD_ENET_RGMII_RX_DLY);
}

return status_invalid_argument;
}

void board_init_adc16_pins(void)
{
init_adc_pins();
Expand All @@ -1423,25 +1437,6 @@ uint32_t board_init_adc16_clock(ADC16_Type *ptr, bool clk_src_ahb)
return freq;
}

uint32_t board_init_sadc_clock(SDADC_Type *ptr, bool clk_src_ahb)
{
uint32_t freq = 0;

if (ptr == HPM_ADC1) {
if (clk_src_ahb) {
/* Configure the ADC clock from AXI (@200MHz by default)*/
clock_set_adc_source(clock_adc1, clk_adc_src_ahb0);
} else {
/* Configure the ADC clock from pll1_clk1 divided by 2 (@200MHz by default) */
clock_set_adc_source(clock_adc1, clk_adc_src_ana1);
clock_set_source_divider(clock_ana1, clk_src_pll1_clk0, 4U);
}

freq = clock_get_frequency(clock_adc1);
}

return freq;
}

uint32_t board_init_gptmr_clock(GPTMR_Type *ptr)
{
Expand Down
Loading

0 comments on commit d0a516e

Please sign in to comment.