Skip to content

Commit

Permalink
hpm sdk release v1.5.0
Browse files Browse the repository at this point in the history
[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]>
  • Loading branch information
jhqian committed Mar 29, 2024
1 parent 7440098 commit 571922c
Show file tree
Hide file tree
Showing 6,694 changed files with 529,409 additions and 166,906 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
277 changes: 276 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.13)

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.20)
cmake_policy(SET CMP0116 OLD)
endif()
cmake_policy(SET CMP0079 NEW)

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

target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_GCC_LIB_ITF})
if("${TOOLCHAIN_VARIANT}" STREQUAL "nds-gcc")
target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_NDSGCC_LIB_ITF})
endif()

if(flash_size)
sdk_linker_global_symbols("_flash_size=${flash_size}")
endif()
Expand Down Expand Up @@ -120,6 +122,11 @@ if(DEFINED CUSTOM_SES_STARTUP_FILE)
sdk_ses_src(${CUSTOM_SES_STARTUP_FILE})
endif()

if(DEFINED CUSTOM_IAR_STARTUP_FILE)
set(USE_CUSTOM_STARTUP 1)
sdk_iar_src(${CUSTOM_IAR_STARTUP_FILE})
endif()

sdk_sys_inc(${SYSROOT_DIR}/include)

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

if("${TOOLCHAIN_VARIANT}" STREQUAL "nds-gcc")
target_link_libraries(${HPM_SDK_LIB} PUBLIC ${HPM_SDK_NDSGCC_LIB_ITF})
target_link_libraries(${APP_ELF_NAME}
"-Wl,-Map=${EXECUTABLE_OUTPUT_PATH}/${APP_MAP_NAME}"
${HPM_SDK_WHOLE_ARCHIVE_OPT}
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ 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
v1.5.0 :a1, 2024-01-01, 2024-03-31
v1.6.0 :a2, 2024-04-01, 2024-06-30
v1.7.0 :a3, 2024-07-01, 2024-09-30
v1.8.0 :a4, 2024-10-01, 2024-12-31
```

[中文](README_zh.md)
Expand Down Expand Up @@ -35,7 +35,7 @@ The HPM SDK Project is a software development kit based on HPMicro's MCUs, which
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.
> Please refer to for [hpm_sdk Getting Started](docs/en/get_started.md) more details about documentation building.
- Online:
- http://hpm-sdk.readthedocs.io/
- http://hpm-sdk-zh.readthedocs.io/
Expand Down
10 changes: 5 additions & 5 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ 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
v1.5.0 :a1, 2024-01-01, 2024-03-31
v1.6.0 :a2, 2024-04-01, 2024-06-30
v1.7.0 :a3, 2024-07-01, 2024-09-30
v1.8.0 :a4, 2024-10-01, 2024-12-31
```

[English](README.md)
Expand Down Expand Up @@ -35,7 +35,7 @@ HPM SDK项目是基于HPMicro 公司的MCU编写的软件开发包,支持多
SDK文档可以进行本地编译,成功编译之后可以通过以下入口访问本地文档:
- <HPM_SDK_BASE>>/docs/index.html
- <HPM_SDK_BASE>>/docs/index_zh.html
> 文档编译方式请参考<HPM_SDK_BASE>/docs/README.md
> 文档编译方式请参考[hpm_sdk Getting Started](docs/zh/get_started.md)
- 在线文档:
- http://hpm-sdk.readthedocs.io/
- http://hpm-sdk-zh.readthedocs.io/
Expand Down
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 = 4
VERSION_MINOR = 5
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION = 0
26 changes: 15 additions & 11 deletions boards/hpm5300evk/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ The HPM5300EVK provides a series of interfaces for the characteristic peripheral

(lab_hpm5300_evk_board)=

- UART Pin:
- UART Pin: modbus_rtu sample

- The UART2 is used for some functional testing using UART, such as MICROROS_UART, USB_CDC_ACM_UART, etc.

| Function | Position |
| --------- | -------- |
| UART2.TXD | P1[8] |
| UART2.RXD | P1[10] |
| UART2.DE | P1[38] |

- LIN Pin:
- LIN Pin (UART_LIN case):

| Function | Position |
| -------- | -------- |
| LIN3 | J9[5] |
| LIN | J9[5] |

- SPI Pin:

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

- ADC16 Pin:

| Function | Position |
| ---------- | -------- |
| ADC0.INA4 | J7[15] |
| ADC0.INA11 | J7[20] |
| ADC1.INA1 | J7[2] |
| ADC1.INA2 | J7[6] |
| ADC1.INA3 | J7[4] |
| ADC1.INA5 | J7[13] |
| Function | Position | Remark |
| ---------- | -------- | -------- |
| ADC0.INA13 | P1[32] | ADC16 |

- DAC Pin:

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

- QEIV2 Sin/Cos Pin:

| Function | Position | Remark |
| ---------- | -------- | -------- |
| ADC0.INA4 | J7[15] | ADC_IW (Cos) |
| ADC1.INA5 | J7[13] | ADC_IU (Sin) |

- Motor Pin:

Refer to section [DRV-LV50A-MP1907 Motor Driver Board ](lab_drv_lv50a_mp1907) for configuration
26 changes: 15 additions & 11 deletions boards/hpm5300evk/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ HPM5300EVK提供了一系列HPM5300系列微控制器特色外设的接口,包

(lab_hpm5300_evk_board)=

- LIN引脚
- LIN引脚 (UART_LIN示例)

| 功能 | 位置 |
| ---- | ----- |
| LIN3 | J9[5] |
| LIN | J9[5] |

- UART引脚
- UART引脚 可用于modbus rtu工程

UART2用于一些使用UART的功能测试,例如MICROROS_UART,USB_CDC_ACM_UART等。

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

- ADC16引脚

| 功能 | 位置 |
| ---------- | ------ |
| ADC0.INA4 | J7[15] |
| ADC0.INA11 | J7[20] |
| ADC1.INA1 | J7[2] |
| ADC1.INA2 | J7[6] |
| ADC1.INA3 | J7[4] |
| ADC1.INA5 | J7[13] |
| 功能 | 位置 | 备注 |
| ---------- | ------ | ------
| ADC0.INA13 | P1[32] | ADC16 |

- DAC引脚

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

- QEIV2 Sin/Cos引脚

| 功能 | 位置 | 备注 |
| ---------- | ------ | ------ |
| ADC0.INA4 | J7[15] | ADC_IW (Cos) |
| ADC1.INA5 | J7[13] | ADC_IU (Sin) |

- 电机引脚

参考 [DRV-LV50A-MP1907 电机驱动板章节](lab_drv_lv50a_mp1907) 进行连接
56 changes: 25 additions & 31 deletions boards/hpm5300evk/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,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 @@ -211,10 +211,6 @@ void board_init_clock(void)
clock_add_to_group(clock_can2, 0);
clock_add_to_group(clock_can3, 0);
clock_add_to_group(clock_ptpc, 0);
clock_add_to_group(clock_lin0, 0);
clock_add_to_group(clock_lin1, 0);
clock_add_to_group(clock_lin2, 0);
clock_add_to_group(clock_lin3, 0);
clock_add_to_group(clock_gptmr0, 0);
clock_add_to_group(clock_gptmr1, 0);
clock_add_to_group(clock_gptmr2, 0);
Expand Down Expand Up @@ -332,6 +328,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);

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

void board_init_lin_pins(LINV2_Type *ptr)
{
init_lin_pins(ptr);
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 */
}

uint32_t board_init_lin_clock(LINV2_Type *ptr)
{
if (ptr == HPM_LIN2) {
clock_add_to_group(clock_lin2, 0);
clock_set_source_divider(clock_lin2, clk_src_pll1_clk0, 40U); /* 20MHz */
return clock_get_frequency(clock_lin2);
} else if (ptr == HPM_LIN3) {
clock_add_to_group(clock_lin3, 0);
clock_set_source_divider(clock_lin3, clk_src_pll1_clk0, 40U); /* 20MHz */
return clock_get_frequency(clock_lin3);
}
return 0;
}

void board_usb_vbus_ctrl(uint8_t usb_index, uint8_t level)
{
(void) usb_index;
Expand Down Expand Up @@ -559,6 +537,10 @@ uint32_t board_init_uart_clock(UART_Type *ptr)
clock_set_source_divider(clock_uart2, clk_src_pll0_clk2, 8);
clock_add_to_group(clock_uart2, 0);
freq = clock_get_frequency(clock_uart2);
} else if (ptr == HPM_UART3) {
clock_set_source_divider(clock_uart3, clk_src_pll0_clk2, 8);
clock_add_to_group(clock_uart3, 0);
freq = clock_get_frequency(clock_uart3);
}

return freq;
Expand Down Expand Up @@ -620,4 +602,16 @@ void board_init_i2c(I2C_Type *ptr)
void board_init_adc_qeiv2_pins(void)
{
init_adc_qeiv2_pins();
}
}

void board_lin_transceiver_control(bool enable)
{
init_lin_transceiver_ctrl_pin();
if (enable) {
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 */
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 */
} else {
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 */
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 */
}
}
Loading

0 comments on commit 571922c

Please sign in to comment.