Skip to content

Commit

Permalink
RT-Thread BSP v1.1.0 for HPM6300EVK
Browse files Browse the repository at this point in the history
- Integrated hpm_sdk v1.1.0
- Bugfixes for drivers and samples

Signed-off-by: Fan YANG <[email protected]>
  • Loading branch information
helloeagleyang committed May 12, 2023
1 parent 6d8137a commit 03954d1
Show file tree
Hide file tree
Showing 1,563 changed files with 253,465 additions and 39,904 deletions.
8 changes: 0 additions & 8 deletions .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prerequisites
*.d

.sconsign.dblite
# Object files
*.o
*.ko
Expand Down
15 changes: 15 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Change Log

## v1.1.0
- Integrated hpm_sdk v1.1.0
- Note:
- the docs, middleware, scripts, samples folder in SDK root directory were removed
- Fixed:
- typos in the drv_i2c.c
- hw_timer cannot work due to SDK driver update
- RT-Thread Studio project compiling error after enabling C++ support
- iperf performance is low if working as client mode
- ethernet throughput is not optimized
- adc driver may return incorrect value
- pwm channel may not work as expected
- uart_dma_demo doesn't work
- eMMC to TF card doesn't work

## v1.0.0
- Integrated the SDK v1.0.0 release
- Note:
Expand Down
20 changes: 18 additions & 2 deletions ChangeLog_zh.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# 更新

## v1.1.0

## 1.0.0
- 整合了hpm_sdk v1.1.0
- 注:
- SDK根目录下的docs,middleware,samples, scripts等目录被移除
- 修复:
- drv_i2c.c 中的拼写错误
- hw_timer 工作异常
- 开启C++支持后RT-Thread Studio工程编译失败
- iperf 作为客户端时性能低下
- 网络性能未优化
- ADC 驱动可能会返回错误的数据
- PWM 通道可能会工作不正常
- uart_dma_demo示例不工作
- eMMC转TF卡不工作


## v1.0.0
- 整合了SDK v1.0.0
- 注:
- SDK根目录下的doc, middleware,samples,cmake目录被删除
Expand All @@ -18,7 +34,7 @@
- usb_host_msc_udisk


## 0.7.0
## v0.7.0
- 整合了SDK v0.12.1
- 注:
- SDK根目录下的doc, middleware,samples,cmake 目录被删除
Expand Down
2 changes: 1 addition & 1 deletion HPMicro-HPM6300EVK.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ features_zh:
- '调试接口: 板载FT2232'
pkg_type: Board_Support_Packages
pkg_vendor: HPMicro
pkg_version: 1.0.0
pkg_version: 1.1.0

template_projects:
- project_name: blink_led
Expand Down
15 changes: 10 additions & 5 deletions board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ATTR_PLACE_AT(".uf2_signature") const uint32_t uf2_signature = BOARD_UF2_SIGNATU

void board_init_console(void)
{
#if BOARD_CONSOLE_TYPE == console_type_uart
#if BOARD_CONSOLE_TYPE == CONSOLE_TYPE_UART
console_config_t cfg;

/* Configure the UART clock to 24MHz */
Expand Down Expand Up @@ -350,10 +350,6 @@ void board_init_clock(void)
clock_add_to_group(clock_gptmr1, 0);
clock_add_to_group(clock_gptmr2, 0);
clock_add_to_group(clock_gptmr3, 0);
clock_add_to_group(clock_uart0, 0);
clock_add_to_group(clock_uart1, 0);
clock_add_to_group(clock_uart2, 0);
clock_add_to_group(clock_uart3, 0);
clock_add_to_group(clock_i2c0, 0);
clock_add_to_group(clock_i2c1, 0);
clock_add_to_group(clock_i2c2, 0);
Expand Down Expand Up @@ -592,6 +588,7 @@ void _init_ext_ram(void)
void board_init_sd_pins(SDXC_Type *ptr)
{
init_sdxc_pins(ptr, false);
init_sdxc_card_detection_pin(ptr);
}

uint32_t board_sd_configure_clock(SDXC_Type *ptr, uint32_t freq)
Expand Down Expand Up @@ -643,6 +640,11 @@ void board_sd_switch_pins_to_1v8(SDXC_Type *ptr)
/* This feature is not supported */
}

void board_sd_power_switch(SDXC_Type *ptr, bool on_off)
{
/* This feature is not supported */
}

bool board_sd_detect_card(SDXC_Type *ptr)
{
return sdxc_is_card_inserted(ptr);
Expand Down Expand Up @@ -707,12 +709,15 @@ uint32_t board_init_uart_clock(UART_Type *ptr)
uint32_t freq = 0U;
if (ptr == HPM_UART0) {
clock_set_source_divider(clock_uart0, clk_src_osc24m, 1);
clock_add_to_group(clock_uart0, 0);
freq = clock_get_frequency(clock_uart0);
} else if (ptr == HPM_UART1) {
clock_set_source_divider(clock_uart1, clk_src_osc24m, 1);
clock_add_to_group(clock_uart1, 0);
freq = clock_get_frequency(clock_uart1);
} else if (ptr == HPM_UART2) {
clock_set_source_divider(clock_uart2, clk_src_osc24m, 1);
clock_add_to_group(clock_uart2, 0);
freq = clock_get_frequency(clock_uart2);
} else {
/* Not supported */
Expand Down
5 changes: 3 additions & 2 deletions board/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
#define BOARD_APP_UART_CLK_NAME clock_uart0

#ifndef BOARD_CONSOLE_TYPE
#define BOARD_CONSOLE_TYPE console_type_uart
#define BOARD_CONSOLE_TYPE CONSOLE_TYPE_UART
#endif

#if BOARD_CONSOLE_TYPE == console_type_uart
#if BOARD_CONSOLE_TYPE == CONSOLE_TYPE_UART
#ifndef BOARD_CONSOLE_BASE
#if BOARD_RUNNING_CORE == HPM_CORE0
#define BOARD_CONSOLE_BASE HPM_UART0
Expand Down Expand Up @@ -370,6 +370,7 @@ void board_init_sd_pins(SDXC_Type *ptr);
uint32_t board_sd_configure_clock(SDXC_Type *ptr, uint32_t freq);
void board_sd_switch_pins_to_1v8(SDXC_Type *ptr);
bool board_sd_detect_card(SDXC_Type *ptr);
void board_sd_power_switch(SDXC_Type *ptr, bool on_off);

void board_init_usb_pins(void);
void board_usb_vbus_ctrl(uint8_t usb_index, uint8_t level);
Expand Down
2 changes: 2 additions & 0 deletions board/linker_scripts/flash_rtt.ld
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ SECTIONS
PROVIDE(__finit_array_end = .);

. = ALIGN(8);
PROVIDE(__ctors_start__ = .);
KEEP(*crtbegin*.o(.ctors))
KEEP(*(EXCLUDE_FILE (*crtend*.o) .ctors))
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);

. = ALIGN(8);
KEEP(*crtbegin*.o(.dtors))
Expand Down
20 changes: 13 additions & 7 deletions board/linker_scripts/flash_rtt_enet.ld
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 - 2022 hpmicro
* Copyright 2021-2022 HPMicro
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand All @@ -9,16 +9,16 @@ STACK_SIZE = DEFINED(_stack_size) ? _stack_size : 0x4000;
HEAP_SIZE = DEFINED(_heap_size) ? _heap_size : 1M;
FLASH_SIZE = DEFINED(_flash_size) ? _flash_size : 16M;
SDRAM_SIZE = DEFINED(_sdram_size) ? _sdram_size : 16M;
NONCACHEABLE_SIZE = DEFINED(_noncacheable_size) ? _noncacheable_size : 1M;
NONCACHEABLE_SIZE = DEFINED(_noncacheable_size) ? _noncacheable_size : 256K;

MEMORY
{
XPI0 (rx) : ORIGIN = 0x80000000, LENGTH = FLASH_SIZE
ILM (wx) : ORIGIN = 0, LENGTH = 256K
DLM (w) : ORIGIN = 0x80000, LENGTH = 256K
AXI_SRAM (wx) : ORIGIN = 0x1080000, LENGTH = 512K
ILM (wx) : ORIGIN = 0, LENGTH = 128K
DLM (w) : ORIGIN = 0x80000, LENGTH = 128K
AXI_SRAM (wx) : ORIGIN = 0x01080000, LENGTH = 256K
SDRAM (wx) : ORIGIN = 0x40000000, LENGTH = SDRAM_SIZE
AXI_SRAM_NONCACHEABLE (wx) : ORIGIN = 0x01100000, LENGTH = NONCACHEABLE_SIZE
AXI_SRAM_NONCACHEABLE (wx) : ORIGIN = 0x010C0000, LENGTH = NONCACHEABLE_SIZE
}

__nor_cfg_option_load_addr__ = ORIGIN(XPI0) + 0x400;
Expand Down Expand Up @@ -84,7 +84,11 @@ SECTIONS
. = ALIGN(8);
__ramfunc_end__ = .;
} > AXI_SRAM


.fast_ram (NOLOAD) : {
KEEP(*(.fast_ram))
} > DLM

.text (__vector_load_addr__ + __vector_ram_end__ - __vector_ram_start__) : {
. = ALIGN(8);
*(.text)
Expand Down Expand Up @@ -182,10 +186,12 @@ SECTIONS
PROVIDE(__finit_array_end = .);

. = ALIGN(8);
PROVIDE(__ctors_start__ = .);
KEEP(*crtbegin*.o(.ctors))
KEEP(*(EXCLUDE_FILE (*crtend*.o) .ctors))
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);

. = ALIGN(8);
KEEP(*crtbegin*.o(.dtors))
Expand Down
6 changes: 4 additions & 2 deletions board/linker_scripts/ram_rtt.ld
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SECTIONS
. = ALIGN(8);
KEEP(*(.start))
} > AXI_SRAM

.vectors : {
. = ALIGN(8);
KEEP(*(.isr_vector))
Expand Down Expand Up @@ -133,10 +133,12 @@ SECTIONS
PROVIDE(__finit_array_end = .);

. = ALIGN(8);
PROVIDE(__ctors_start__ = .);
KEEP(*crtbegin*.o(.ctors))
KEEP(*(EXCLUDE_FILE (*crtend*.o) .ctors))
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);

. = ALIGN(8);
KEEP(*crtbegin*.o(.dtors))
Expand All @@ -158,7 +160,7 @@ SECTIONS
. = ALIGN(8);
PROVIDE(__ramfunc_end__ = .);
} > AXI_SRAM

.noncacheable : AT(etext + __data_end__ - __data_start__ + __ramfunc_end__ - __ramfunc_start__){
. = ALIGN(8);
__noncacheable_init_start__ = .;
Expand Down
Loading

0 comments on commit 03954d1

Please sign in to comment.