Skip to content

Commit 571922c

Browse files
committed
hpm sdk release v1.5.0
[1.5.0] - 2024-03-29: Main changes since 1.4.0 Tested Segger Embedded Studio Version: 7.32a Tested IAR Embedded Workbench for RISC-V Version: 3.20.1 - Known Issue: - some IAR projects does not work properly when optimization level is increased - Changed: - soc: iomux: update macro prefix in pmic_iomux and batt_iomux. - soc: feature: change usb endpoint max number from 8 to 16 - soc: correct svd files and add subpart module list - drivers: usb: change usb_phy_get_line_state() to external function - drivers: qeiv2: update filter length setting - drivers: adc12/adc16: add sanity check for sample cycle - drivers: femc: add delay_cell_disable config option - drivers: i2s: change fifo threshold parameter. - drivers: i2c: replace and use the macro definition of hpm_soc_ip_feature. - drivers: uart: supplementary description of uart_check_status API. - components: enet_phy: lan8720/rtl8201/rtl8211: unify the default config with type bool - components: enet_phy: remove unused included header file - components: enet_phy: rtl8201/rtl8211: update register description - components: dma_mgr: change isr handler from static to public - middleware: tinyusb: host: use echi drivers - middleware: tinyusb: rename CFG_TUSB_HOST_DEVICE_MAX to CFG_TUH_DEVICE_MAX - middleware: tinyusb: update to v0.16 - middleware: rtthread-nano: use soc reset_handler and define MAIN_ENTRY as entry - middleware: fatfs: tinyusb: adapter to tinyusb update - middleware: threadx: use TX_TIMER_TICKS_PER_SECOND to config work ticks - middleware: threadx: use samples tx_user.h - middleware: uC/OS-III: enable sw interrupt in OSCtxSw/OSIntCtxSw - middleware: ucos: ports: Added IAR portable layer for ucos. - middleware: cherryusb/azure_rtos: add defined __ICCRISCV__ for iar - middleware: hpm_math: simplify libdsp path. - middleware: cherryusb: update to v1.1.0 - middleware: rtthread-nano:halt cpu when exception occur. - middleware: hpm_math: simplify libnn path. - middleware: threadx: move frequently called function to ram. - middleware: tinyusb: change endpoint number from 8 to 16 - middleware: usbx: change endpoint number from 8 to 16 - middleware: cherryusb: msc device: update to support multi lun and deinit - middleware: eclipse_threadx: update license - middleware: fatfs: tinyusb: add osal_task_delay() when use rtos wait - middleware: tinyusb: update CMakeLists.txt and delete custom osal_task_delay() - middleware: tinyusb: add debounce in port change isr - samples: erpc: add middleware src use middleware CMakeLists.txt - samples: multicore: core1: use board_init_core1() API - samples: multicore: coremark: delete custom reset_handler and use app_main as MAIN_ENTRY - samples: tinyusb: update samples to adapter tinyusb v0.16 - samples: usbx: host: delete unused hpm_usb_host.h - samples: usb: delete CONFIG_USB_HOST set - samples: lvgl_coremark: disable freqswitch_btn when coremark running - samples: mono: move to driver directory. - samples: freertos: change configMAX_PRIORITIES from 7 to 32 - samples: rtthread: delete unused macro RT_THREAD_PRIORITY_32 - samples: cherryusb: usbnet: decrease rtos stack config size - samples: lwip: all: unify logs about IP information - samples: lwip: lwip_https_server: remove an unused file - samples: lwip: all: update DHCP progress logic - samples: lwip: common: remove s_pxNetIf - samples: lwip: adjust the directories of netconf.c/netcof.h - samples: lwip: common: optimize speed for getting IP from DHCP server - samples: lwip: rename common_lwip.c to common.c - samples: lwip: common: adjust the call logic of netif_set_up/netif_set_down - samples: lwip: common: change the time of invoking netif_user_notification - samples: lwip: common: rename user_notification to netif_user_notification - samples: lwip: adjust directory structures to be compatible with single and multiple network ports - samples: use generate_ide_projects for new samples - samples: cherryusb: device: cdc acm: reorganize directory structure - samplse: gptmr: t_shape_accel_decel: modify the source address mode of DMA. - samples: cherryusb: device: change readbuf size from 2048 to CDC_MAX_MPS - samples: drivers: femc: update sdram dqs config - samples: update app.yaml to use ip_feature - samples: drivers: uart: change to app uart - samples: audio_codec: update wm8960 I2S protocol. - samples: drivers: cam: change cam sample to cam_dvp sample. - samples: usbx: device: msc: decrease ram disk size to 16KB - samples: cherryusb: msc device: update to support multi lun - samples: driver: uart_lin: support LIN transceiver on board. - samples: adc: temp: rename temp to adc16_temperature - samples: bldc block: Compatible with both hall and qeiv2 peripherals. - samples: motor_ctrl: Modify the value of pwm reload. - samples: lwip: common: single/multiple: update the size passed into sys_mbox_new() - samples: lwip: common: single/multiple: replace enet_get_link_status with netif_is_link_up - samples: lwip: lwip_https_server: remove unused header file - samples: lwip: rename macro TCP_XXX_PORT - samples: lwip: add cmake flag for netconn/socket api - samples: decode_wav: sd_fafts: update sd_choose_music. - samples: power_mode_switch: maintain xpi0 clock on switching preset - samples: dhrystone Change the optmization level to O3. - samples: tinyusb: hid_generic_inout: delete redundant image - samples: power_mode_switch: hpm67/hpm63: preserve femc clock at wait/stop mode - samples: erpc: core1: use optimization -os - samples: update uart_tamagawa to use software trig if TRGM not exist. - samples: eeprom_emulation: reduce management area - samples: sdxc: use block_size instead of 512 - samples: erpc: add -fno-exceptions compile option - samples: tinyusb: disable debug log print - boards: hpm5300evk and hpm6800evk: add delay after USB_PWR Pin init for power stable - boards: hpm6750evkmini: modify gptmr pins. - boards: hpm6200evk: modify gptmr pins. - boards: hpm6200evk: modify the i2c pins. - boards: hpm6750xxx: update sdram dqs config - boards: hpm6800evk:pinmux Increase drive strength for sdxc pins - boards: iomux: update macro prefix for pmic_iomux and batt_iomux. - boards: rename board feature - boards: update BOARD_APP_UART definition - boards: rename console definitions - boards: hpm5301evklite: update uart clock in board.c. - boards: hpm6750evkmini: change BOARD_GPTMR_PWM_DMA_SRC definition. - docs: samples: use glob in high level readme. - docs: update top level readme. - docs: netxduo: update sntp readme. - docs: threadx: update threadx hello readme. - docs: lwip: align pictures to the left - docs: pip: add cmake doc dependency - docs: add changelog to sphnix-doc. - scripts: ses: generate asm after build by default. - scripts: update linked project path logic. - scripts: check_board_cap.py: check ip feature's availability - cmake: remove CMP0116 setting. - cmake&scripts: clarify the error caused by core1 compiling failure. - scripts: ses/iar: use relpath in project file - Added: - soc: hpm6360/hpm6750/hpm6800: add MAC-related definitions in OTP section - soc: reset: add MAIN_ENTRY macro to custom define main entry - soc: add hpm6850 and hpm6830 part. - soc: soc_modules.list: add tamper drivers - soc: Add IAR toolchain support. - soc: add ip feature to soc_modules.list - soc: add hpm_soc_ip_feature.h - soc: driver: ppor: add reset hold operation APIs - soc: clock_driver add the clock_get_divider API. - soc: sysctl: add apis to control clock preservation - soc: toolchains: gcc: ram linker: add ILM last address overflow check - drivers: mcan Add timeout counter support. - drivers: tamper: add tamper driver - drivers: cam: add cam_update_buffer2 API - drivers: opamp: Add user configuration code. - drivers: lcdc: add stride for layer config. - drivers: pdma: add pdma_blit_ex. - drivers:pllctl add out-of-bound check in pllctl driver. - components:uart_lin: add hpm_uart_lin_send_wakeup() API - components: enet_phy: add LAN8720 driver - components: enet_phy: add definition of enet_phy_link_status_t - middleware: cherryusb: host: add dual port support - middleware: cmsis_os2: adapter to rtthread wrapper - middleware: cmsis_os2: update freertos files - middleware: cmsis_os2: adapter to threadx wrapper - middleware: cmsis_os2: adapter to ucOS-III wrapper - middleware: hpm_sdmmc Add eMMC config partition API. - middleware: cherryusb Add IAR toolchain support - middleware: erpc Fix IAR RISC-V support issue - middleware: tflm: add IAR riscv support in flatbuffer - middleware: FreeRTOS: portable:Added IAR portable layer. - middleware: segger_rtt Added EWRISCV support - middleware: hpm_math Add nds_dsp library for IAR. - middleware: lwip: cc: add PACK_STRUCT_XXX definitions for IAR platform - middleware: uC/OS-III: enable plicsw in IAR asm code - middleware: add tinyengine - middleware: threadx: add support for gptmr. - middleware: threadx: add profile support. - middleware: add agile_modbus. - middleware: add cherryrb. - middleware: cherryusb Add missing swap32/swap16 implementation. - middleware: hpm_mclv2: add block type drive motors - middleware: cherryusb: fix usbh_core ep0 buffer index - boards: hpm6200xxx and hpm6750xxx: add board_init_core1() API - boards: add tamper feature and pins init - boards: hpm5300evk: add board_init_console() declaration in board.h - boards: hpm6750evk/hpm6750evk2: add board_dual_usb feature - boards: openocd: add windows guide to *_all_in_one.cfg - boards: openocd: soc: add reset_soc proc - board:add pgpio configuration on hpm5301evklite - samples: drivers: add mono sample. - samples: drivers:mcan Add timeout counter sample. - samples: drivers: tamper: add tamper sample - samples: cmsis_os2: blinky: add rtthread samples - samples: cmsis_os2: add msg_queue sample - samples: cmsis_os2: add mem_pool samples - samples: cmsis_os2: msg_queue: add ucOS-III support - samples: cmsis_os2: blinky: add ucOS-III support - samples: lwip: common: add a task netif_update_link_status - samples: lwip: add MAC address load from OPT MAC area - samples: cherryusb: device: cdc acm: add cdc_acm_uart_com sample - samples: cherryusb: device: add msc sdcard sample - samples: tinyengine: add person detection. - samples: rtos: add threadx gptmr sample. - samples: modbus: tcp: add tcp samples. - samples: modbus: rtu: add rtu sample. - samples: add cherryrb sample. - samples: cherryusb: host: add dual port sample - samples: cherryusb: device: add dual port sample - samples: cherryusb: device: add dual lun msc sample - samples: lwip: ports: rtthread-nano: multiple: add arch-related files - samples: lwip: ports: freertos: multiple: add arch-related files - samples: lwip: common: multiple: osal: add osTaskFunction definition - samples: lwip: add a lwip_tcpecho_multi_ports_rtthread-nano sample - samples: lwip: add a lwip_tcpecho_multi_ports_freertos - samples: lwip: lwip_tcpecho_xxx: add definitions for task priorities - samples: lwip: lwip_tcpecho_freertos_socket: newly add - samples: lwip: lwip_tcpclient: newly add - samples: lwip: add lwip_tcpclient_freertos_socket - samples: vglite: add sample of rotate tiger. - samples: lwip: lwip_tcpclient_freertos_socket: fix failure to run - samples: lwip: lwip_tcpclient: fix failure to run with some release-related type - samples: jpeg: jpeg_encode: add debounce for button. - docs: add cmake doc - docs: hpm5300evk: add qeiv2 sin/cos pins - scripts: support sdk project localization. - cmake: add nds-gcc options to sdk_lib for nds-gcc. - cmake/scripts: add IAR project generation support - cmake: add symbols to specify linker for tools. - cmake: add sdk_*_src_glob. - cmake: add custom targets for localization. - Fixed: - soc: hpm6750: fix segger linker vectors order - soc: hpm_interrupt.h Fix compiling warning for DSP related macros - soc: hpm6750: otp Fix OTP program and read logic - soc: hpm6880: clock Fix wrong enum value for TSNS clock. - soc: clock driver: correct the clock name value for pll clocks. - soc: HPM6280: fix adc/dac clock setting - soc: ppor: fix ppor clear reset flag and set reset type API error - soc: HPM6880: fix i2s clock config driver - drivers: adc12: fix calibration setting error - drivers: cam: DMASA_FB2 need to be assigned whether FB2 buffer is enable or not. - drivers:can correct the logic of disabling re-transmission for ptb & stb. - drivers: qeo: fix driver error - drivers: i2s: ensure valid BCLK before call software reset. - drivers: pdma: fixed OUT_PS[] config. - components: wm8960: invert LRCLK to align with soc I2S. - middleware: uC/OS-III: fix register t0 unsafe. - middleware: ptpd: fix netShutdown error in ptpd initialization - middleware: cmsis_os2: task should call exit interface before exit - middleware: threadx: fix threadx profile RA register save and restore bug. - middleware: hpm_mcl: fix divide-by-zero error. refs: hpm_sdk-#1091 - middleware: cherryusb/tinyusb/usbx: device: fix transfer_len not reset - middleware: cherryusb/usbx: fix dtd return problem - middleware: cherryusb/tinyusb/usbx: fix usb device interrupt should be check active status - middleware: tinyusb: fix ehci cap_reg address error - middleware: tinyusb: fix hid report id - middleware: cherryusb: fix usbd_ep_close not reset ep_enable flag - middleware: cherryusb: fix rndis message length check - middleware: freertos: fix implementation error in xPortIsInsideInterrupt. - boards: hpm6200evk: fix tamper pin config - board: openocd: all_in_one: hpm6800 config file is missed. - boards: openocd: all_in_one: hpm5300: correct soc config name. - samples: threadx hello: fix printing errors. - samples: drivers: ad12/adc16: fix initialization sequence for trigger source, trigger mux and trigger target config - samples: lwip: lwip_ptp: fix netSend error before link-up - samples: dma: fix dma uart init position - samples: drivers:spi:master_trans_large_amound_of_data Fix logic error if SPI support 4GB transfer size - samples: sdxc: add boundary protection for last 1024 blocks test - samples: lwip: common: multiple: fix typo of enet_update_dhcp_state() - samples: lwip: common: single/multiple: fix timeout passed into sys_arch_mbox_fetch() - samples: e2prom: bugfix: base read fail if run perf firstly .refs:hpm_sdk-#1499 - samples: modbus: tcp: use volatile to prevent the compiler from optimizing out key variables - samples: modbus: rtu: fixed failed to run after turning on optimization issue. - samples: power_mode_switch: hpm68xx: fix ddr access issue for wait/stop mode - samples: cherryrb: fixed stack overflow issue - samples: lwip: lwip_tcpecho_multi_ports_ports_rtthread-nano: fix failure to run - sample: jpeg: jpeg_encode: fix that udisk can't be mounted when first capture. - cmake: correct board search path symbol for core1. - cmake: gcc: fix system include path. - cmake: fix sdk_link_libraries failed to link std lib. - cmake: EXTAR_LD_FLAGS to be added as ld options. - docs: lwip_ptp: v1: salve: fix format error - docs: samples: ppor: change title from sysctl to ppor - docs: hpm6750evk2: fix table display error Signed-off-by: Ryan QIAN <[email protected]>
1 parent 7440098 commit 571922c

File tree

6,694 files changed

+529409
-166906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,694 files changed

+529409
-166906
lines changed

CHANGELOG.md

Lines changed: 276 additions & 1 deletion
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# SPDX-License-Identifier: BSD-3-Clause
33
cmake_minimum_required(VERSION 3.13)
44

5-
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.20)
6-
cmake_policy(SET CMP0116 OLD)
7-
endif()
85
cmake_policy(SET CMP0079 NEW)
96

107
project(hpm_sdk)
@@ -15,6 +12,11 @@ target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_LIB_ITF})
1512
add_library(${HPM_SDK_GCC_LIB} STATIC "")
1613
target_link_libraries(${HPM_SDK_GCC_LIB} PUBLIC ${HPM_SDK_GCC_LIB_ITF} ${HPM_SDK_LIB_ITF})
1714

15+
target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_GCC_LIB_ITF})
16+
if("${TOOLCHAIN_VARIANT}" STREQUAL "nds-gcc")
17+
target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_NDSGCC_LIB_ITF})
18+
endif()
19+
1820
if(flash_size)
1921
sdk_linker_global_symbols("_flash_size=${flash_size}")
2022
endif()
@@ -120,6 +122,11 @@ if(DEFINED CUSTOM_SES_STARTUP_FILE)
120122
sdk_ses_src(${CUSTOM_SES_STARTUP_FILE})
121123
endif()
122124

125+
if(DEFINED CUSTOM_IAR_STARTUP_FILE)
126+
set(USE_CUSTOM_STARTUP 1)
127+
sdk_iar_src(${CUSTOM_IAR_STARTUP_FILE})
128+
endif()
129+
123130
sdk_sys_inc(${SYSROOT_DIR}/include)
124131

125132
# parse module list file provided in soc folder, it will decide which modules to be enabled under drivers folder
@@ -194,6 +201,7 @@ if(${HPM_SDK_LD_NO_WHOLE_SDK})
194201
endif()
195202

196203
if("${TOOLCHAIN_VARIANT}" STREQUAL "nds-gcc")
204+
target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_NDSGCC_LIB_ITF})
197205
target_link_libraries(${APP_ELF_NAME}
198206
"-Wl,-Map=${EXECUTABLE_OUTPUT_PATH}/${APP_MAP_NAME}"
199207
${HPM_SDK_WHOLE_ARCHIVE_OPT}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ gantt
33
title HPM SDK Release Plan
44
dateFormat YYYY-MM-DD
55
section Mainline Release
6-
v1.1.0 :a1, 2023-01-01, 2023-03-31
7-
v1.2.0 :a2, 2023-04-01, 2023-06-30
8-
v1.3.0 :a3, 2023-07-01, 2023-09-30
9-
v1.4.0 :a4, 2023-10-01, 2023-12-31
6+
v1.5.0 :a1, 2024-01-01, 2024-03-31
7+
v1.6.0 :a2, 2024-04-01, 2024-06-30
8+
v1.7.0 :a3, 2024-07-01, 2024-09-30
9+
v1.8.0 :a4, 2024-10-01, 2024-12-31
1010
```
1111

1212
[中文](README_zh.md)
@@ -35,7 +35,7 @@ The HPM SDK Project is a software development kit based on HPMicro's MCUs, which
3535
SDK documentation can be built locally, once it's done, it can be accessed with the following entries:
3636
- <HPM_SDK_BASE>>/docs/index.html
3737
- <HPM_SDK_BASE>>/docs/index_zh.html
38-
> Please refer to <HPM_SDK_BASE>/docs/README.md for more details about documentation building.
38+
> Please refer to for [hpm_sdk Getting Started](docs/en/get_started.md) more details about documentation building.
3939
- Online:
4040
- http://hpm-sdk.readthedocs.io/
4141
- http://hpm-sdk-zh.readthedocs.io/

README_zh.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ gantt
33
title HPM SDK Release Plan
44
dateFormat YYYY-MM-DD
55
section Mainline Release
6-
v1.1.0 :a1, 2023-01-01, 2023-03-31
7-
v1.2.0 :a2, 2023-04-01, 2023-06-30
8-
v1.3.0 :a3, 2023-07-01, 2023-09-30
9-
v1.4.0 :a4, 2023-10-01, 2023-12-31
6+
v1.5.0 :a1, 2024-01-01, 2024-03-31
7+
v1.6.0 :a2, 2024-04-01, 2024-06-30
8+
v1.7.0 :a3, 2024-07-01, 2024-09-30
9+
v1.8.0 :a4, 2024-10-01, 2024-12-31
1010
```
1111

1212
[English](README.md)
@@ -35,7 +35,7 @@ HPM SDK项目是基于HPMicro 公司的MCU编写的软件开发包,支持多
3535
SDK文档可以进行本地编译,成功编译之后可以通过以下入口访问本地文档:
3636
- <HPM_SDK_BASE>>/docs/index.html
3737
- <HPM_SDK_BASE>>/docs/index_zh.html
38-
> 文档编译方式请参考<HPM_SDK_BASE>/docs/README.md
38+
> 文档编译方式请参考[hpm_sdk Getting Started](docs/zh/get_started.md)
3939
- 在线文档:
4040
- http://hpm-sdk.readthedocs.io/
4141
- http://hpm-sdk-zh.readthedocs.io/

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION_MAJOR = 1
2-
VERSION_MINOR = 4
2+
VERSION_MINOR = 5
33
PATCHLEVEL = 0
44
VERSION_TWEAK = 0
55
EXTRAVERSION = 0

boards/hpm5300evk/README_en.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,21 @@ The HPM5300EVK provides a series of interfaces for the characteristic peripheral
3030

3131
(lab_hpm5300_evk_board)=
3232

33-
- UART Pin:
33+
- UART Pin: modbus_rtu sample
34+
35+
- The UART2 is used for some functional testing using UART, such as MICROROS_UART, USB_CDC_ACM_UART, etc.
3436

3537
| Function | Position |
3638
| --------- | -------- |
3739
| UART2.TXD | P1[8] |
3840
| UART2.RXD | P1[10] |
3941
| UART2.DE | P1[38] |
4042

41-
- LIN Pin:
43+
- LIN Pin (UART_LIN case):
4244

4345
| Function | Position |
4446
| -------- | -------- |
45-
| LIN3 | J9[5] |
47+
| LIN | J9[5] |
4648

4749
- SPI Pin:
4850

@@ -77,14 +79,9 @@ The HPM5300EVK provides a series of interfaces for the characteristic peripheral
7779

7880
- ADC16 Pin:
7981

80-
| Function | Position |
81-
| ---------- | -------- |
82-
| ADC0.INA4 | J7[15] |
83-
| ADC0.INA11 | J7[20] |
84-
| ADC1.INA1 | J7[2] |
85-
| ADC1.INA2 | J7[6] |
86-
| ADC1.INA3 | J7[4] |
87-
| ADC1.INA5 | J7[13] |
82+
| Function | Position | Remark |
83+
| ---------- | -------- | -------- |
84+
| ADC0.INA13 | P1[32] | ADC16 |
8885

8986
- DAC Pin:
9087

@@ -163,6 +160,13 @@ The HPM5300EVK provides a series of interfaces for the characteristic peripheral
163160
| --------- | ------ |------|
164161
| SEI1.CLK Section | J5 | Master side, CLKO active. Slave side,CLKI active |
165162

163+
- QEIV2 Sin/Cos Pin:
164+
165+
| Function | Position | Remark |
166+
| ---------- | -------- | -------- |
167+
| ADC0.INA4 | J7[15] | ADC_IW (Cos) |
168+
| ADC1.INA5 | J7[13] | ADC_IU (Sin) |
169+
166170
- Motor Pin:
167171

168172
Refer to section [DRV-LV50A-MP1907 Motor Driver Board ](lab_drv_lv50a_mp1907) for configuration

boards/hpm5300evk/README_zh.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ HPM5300EVK提供了一系列HPM5300系列微控制器特色外设的接口,包
3030

3131
(lab_hpm5300_evk_board)=
3232

33-
- LIN引脚
33+
- LIN引脚 (UART_LIN示例)
3434

3535
| 功能 | 位置 |
3636
| ---- | ----- |
37-
| LIN3 | J9[5] |
37+
| LIN | J9[5] |
3838

39-
- UART引脚
39+
- UART引脚 可用于modbus rtu工程
40+
41+
UART2用于一些使用UART的功能测试,例如MICROROS_UART,USB_CDC_ACM_UART等。
4042

4143
| 功能 | 位置 |
4244
| --------- | ------ |
@@ -77,14 +79,9 @@ HPM5300EVK提供了一系列HPM5300系列微控制器特色外设的接口,包
7779

7880
- ADC16引脚
7981

80-
| 功能 | 位置 |
81-
| ---------- | ------ |
82-
| ADC0.INA4 | J7[15] |
83-
| ADC0.INA11 | J7[20] |
84-
| ADC1.INA1 | J7[2] |
85-
| ADC1.INA2 | J7[6] |
86-
| ADC1.INA3 | J7[4] |
87-
| ADC1.INA5 | J7[13] |
82+
| 功能 | 位置 | 备注 |
83+
| ---------- | ------ | ------
84+
| ADC0.INA13 | P1[32] | ADC16 |
8885

8986
- DAC引脚
9087

@@ -163,6 +160,13 @@ HPM5300EVK提供了一系列HPM5300系列微控制器特色外设的接口,包
163160
| --------- | ------ |------|
164161
| SEI1.CLK选择 | J5 | Master侧,选择CLKO;Slave侧,选择CLKI |
165162

163+
- QEIV2 Sin/Cos引脚
164+
165+
| 功能 | 位置 | 备注 |
166+
| ---------- | ------ | ------ |
167+
| ADC0.INA4 | J7[15] | ADC_IW (Cos) |
168+
| ADC1.INA5 | J7[13] | ADC_IU (Sin) |
169+
166170
- 电机引脚
167171

168172
参考 [DRV-LV50A-MP1907 电机驱动板章节](lab_drv_lv50a_mp1907) 进行连接

boards/hpm5300evk/board.c

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ void board_init_console(void)
8888
* uart rx pin when configuring pin function will cause a wrong data to be received.
8989
* And a uart rx dma request will be generated by default uart fifo dma trigger level.
9090
*/
91-
init_uart_pins((UART_Type *) BOARD_CONSOLE_BASE);
91+
init_uart_pins((UART_Type *) BOARD_CONSOLE_UART_BASE);
9292

9393
/* Configure the UART clock to 24MHz */
94-
clock_set_source_divider(BOARD_CONSOLE_CLK_NAME, clk_src_osc24m, 1U);
95-
clock_add_to_group(BOARD_CONSOLE_CLK_NAME, 0);
94+
clock_set_source_divider(BOARD_CONSOLE_UART_CLK_NAME, clk_src_osc24m, 1U);
95+
clock_add_to_group(BOARD_CONSOLE_UART_CLK_NAME, 0);
9696

9797
cfg.type = BOARD_CONSOLE_TYPE;
98-
cfg.base = (uint32_t)BOARD_CONSOLE_BASE;
99-
cfg.src_freq_in_hz = clock_get_frequency(BOARD_CONSOLE_CLK_NAME);
100-
cfg.baudrate = BOARD_CONSOLE_BAUDRATE;
98+
cfg.base = (uint32_t)BOARD_CONSOLE_UART_BASE;
99+
cfg.src_freq_in_hz = clock_get_frequency(BOARD_CONSOLE_UART_CLK_NAME);
100+
cfg.baudrate = BOARD_CONSOLE_UART_BAUDRATE;
101101

102102
if (status_success != console_init(&cfg)) {
103103
/* failed to initialize debug console */
@@ -211,10 +211,6 @@ void board_init_clock(void)
211211
clock_add_to_group(clock_can2, 0);
212212
clock_add_to_group(clock_can3, 0);
213213
clock_add_to_group(clock_ptpc, 0);
214-
clock_add_to_group(clock_lin0, 0);
215-
clock_add_to_group(clock_lin1, 0);
216-
clock_add_to_group(clock_lin2, 0);
217-
clock_add_to_group(clock_lin3, 0);
218214
clock_add_to_group(clock_gptmr0, 0);
219215
clock_add_to_group(clock_gptmr1, 0);
220216
clock_add_to_group(clock_gptmr2, 0);
@@ -332,6 +328,8 @@ void board_init_usb_pins(void)
332328
{
333329
init_usb_pins();
334330
usb_hcd_set_power_ctrl_polarity(BOARD_USB, true);
331+
/* Wait USB_PWR pin control vbus power stable. Time depend on decoupling capacitor, you can decrease or increase this time */
332+
board_delay_ms(100);
335333

336334
/* As QFN32, QFN48 and LQFP64 has no vbus pin, so should be call usb_phy_using_internal_vbus() API to use internal vbus. */
337335
/* usb_phy_using_internal_vbus(BOARD_USB); */
@@ -386,26 +384,6 @@ void board_init_spi_pins_with_gpio_as_cs(SPI_Type *ptr)
386384
GPIO_GET_PIN_INDEX(BOARD_SPI_CS_PIN), !BOARD_SPI_CS_ACTIVE_LEVEL);
387385
}
388386

389-
void board_init_lin_pins(LINV2_Type *ptr)
390-
{
391-
init_lin_pins(ptr);
392-
gpio_set_pin_output_with_initial(BOARD_12V_EN_GPIO_CTRL, BOARD_12V_EN_GPIO_INDEX, BOARD_12V_EN_GPIO_PIN, 1); /* enable 12v output */
393-
}
394-
395-
uint32_t board_init_lin_clock(LINV2_Type *ptr)
396-
{
397-
if (ptr == HPM_LIN2) {
398-
clock_add_to_group(clock_lin2, 0);
399-
clock_set_source_divider(clock_lin2, clk_src_pll1_clk0, 40U); /* 20MHz */
400-
return clock_get_frequency(clock_lin2);
401-
} else if (ptr == HPM_LIN3) {
402-
clock_add_to_group(clock_lin3, 0);
403-
clock_set_source_divider(clock_lin3, clk_src_pll1_clk0, 40U); /* 20MHz */
404-
return clock_get_frequency(clock_lin3);
405-
}
406-
return 0;
407-
}
408-
409387
void board_usb_vbus_ctrl(uint8_t usb_index, uint8_t level)
410388
{
411389
(void) usb_index;
@@ -559,6 +537,10 @@ uint32_t board_init_uart_clock(UART_Type *ptr)
559537
clock_set_source_divider(clock_uart2, clk_src_pll0_clk2, 8);
560538
clock_add_to_group(clock_uart2, 0);
561539
freq = clock_get_frequency(clock_uart2);
540+
} else if (ptr == HPM_UART3) {
541+
clock_set_source_divider(clock_uart3, clk_src_pll0_clk2, 8);
542+
clock_add_to_group(clock_uart3, 0);
543+
freq = clock_get_frequency(clock_uart3);
562544
}
563545

564546
return freq;
@@ -620,4 +602,16 @@ void board_init_i2c(I2C_Type *ptr)
620602
void board_init_adc_qeiv2_pins(void)
621603
{
622604
init_adc_qeiv2_pins();
623-
}
605+
}
606+
607+
void board_lin_transceiver_control(bool enable)
608+
{
609+
init_lin_transceiver_ctrl_pin();
610+
if (enable) {
611+
gpio_set_pin_output_with_initial(BOARD_12V_EN_GPIO_CTRL, BOARD_12V_EN_GPIO_INDEX, BOARD_12V_EN_GPIO_PIN, 1); /* enable 12v output */
612+
gpio_set_pin_output_with_initial(BOARD_LIN_TRANSCEIVER_GPIO_CTRL, BOARD_LIN_TRANSCEIVER_GPIO_INDEX, BOARD_LIN_TRANSCEIVER_GPIO_PIN, 1); /* disable transceiver sleep */
613+
} else {
614+
gpio_set_pin_output_with_initial(BOARD_12V_EN_GPIO_CTRL, BOARD_12V_EN_GPIO_INDEX, BOARD_12V_EN_GPIO_PIN, 0); /* disable 12v output */
615+
gpio_set_pin_output_with_initial(BOARD_LIN_TRANSCEIVER_GPIO_CTRL, BOARD_LIN_TRANSCEIVER_GPIO_INDEX, BOARD_LIN_TRANSCEIVER_GPIO_PIN, 0); /* enable transceiver sleep */
616+
}
617+
}

0 commit comments

Comments
 (0)