Skip to content

Commit

Permalink
project: add hpm5301evklite demo
Browse files Browse the repository at this point in the history
  • Loading branch information
RCSN authored and sakumisu committed Dec 1, 2023
1 parent cfb43de commit 7f5707c
Show file tree
Hide file tree
Showing 16 changed files with 1,206 additions and 1 deletion.
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CherryDAP is a DAPLink template based on [CherryUSB](https://github.com/sakumisu

![cherrydap1](./assets/cherrydap1.png)
![cherrydap2](./assets/cherrydap2.png)

![ses_debug_hpm](./assets/ses_debug_hpm.png)
# Projects

## BL616
Expand Down Expand Up @@ -40,3 +40,61 @@ cd projects/bl616
make BL_SDK_BASE=<pwd of bouffalo_sdk prefix>/bouffalo_sdk CROSS_COMPILE=<pwd of toolchain prefix>/toolchain_gcc_t-head_linux/bin/riscv64-unknown-elf-
```

## HPM5301EVKlite
![hpm5301evklite](./assets/hpm5301evklite.png)

- USB High speed
- Support UART, use DMA

- The 20PJTAG socket of the J5 interface is used by default.
- for example, use hpm5301evklite debug hpm5300evk

![debug_5300evk](./assets/debug_5300evk.png)

- Use uart3 as usb2uart

![53uart](./assets/53uart.png)


- build


1、 sdk version must be greater than 1.3

2、 download https://github.com/hpmicro/sdk_env

3、 if the sdk is not hpm5300evklite, you can download the pack unzip to sdk_env/hpm_sdk https://github.com/hpmicro/hpm_sdk/releases/download/v1.3.0/hpm_sdk_v1.3.0_patch-hpm5301evklite.zip

4、open sdk_env start_gui.exe on window

![sdk_env](./assets/sdk_env.png)


- download firmware

- the firmware bin file path: ../bin/hpm5301_daplink.bin

1、use hpm_manufacturing_tool https://github.com/hpmicro/hpm_manufacturing_tool

(1) baidu pan: https://pan.baidu.com/s/1RaYHOD7xk7fnotmgLpoAlA?pwd=xk2n
提取码:xk2n 复制这段内容打开「百度网盘APP 即可获取」

![hpm_acc_tools](./assets/hpm_acc_tools.png)


(2) unzip, open hpm_manufacturing_gui.exe,

(3) uart0 use usbttl module to connect tool, and press the SW1 and SW2 buttons simultaneously, then release SW1 (RESET), and then release SW2 (boot)

![hpm_isp_uart](./assets/hpm_isp_uart.png)

(4) connenct the tool and download firmware

![hpm_download](./assets/hpm_download.png)


2、use ses ide

3、use gdb

Binary file added assets/53uart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/debug_5300evk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/hpm5301evklite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/hpm_acc_tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/hpm_download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/hpm_isp_uart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sdk_env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ses_debug_hpm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions projects/hpm5301evklite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.DS_Store
.swp
.bak
cscope.*
*.orig
*.patch

build
*_build
cmake-build*
.idea
.vscode
.cache

*.log
*.jou
.settings
.cproject
.project

doctrees
doc/output/*

segger_embedded_studio
*.pyc
sec_core_img.c
*.o

36 changes: 36 additions & 0 deletions projects/hpm5301evklite/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2023 HPMicro
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.13)

set(CONFIG_CHERRYUSB 1)
set(CONFIG_USB_DEVICE 1)
set(CONFIG_USB_DEVICE_CDC 1)

find_package(hpm-sdk REQUIRED HINTS $ENV{HPM_SDK_BASE})

project(hpm5300evklite_jtag_dap)

sdk_compile_definitions(-DCONFIG_USB_HS)
sdk_compile_definitions(-DCONFIG_CHERRYUSB)

sdk_inc(./)
sdk_inc(../..)
sdk_inc(../../CherryRB)
sdk_inc(../../DAP/Include)

sdk_app_src(../../dap_main.c)
sdk_app_src(../../DAP/Source/DAP_vendor.c)
sdk_app_src(../../DAP/Source/DAP.c)
sdk_app_src(../../DAP/Source/SW_DP.c)
sdk_app_src(../../DAP/Source/JTAG_DP.c)
sdk_app_src(../../CherryRB/chry_ringbuffer.c)

sdk_app_src(main.c)
sdk_app_src(usb2uart.c)
# sdk_compile_options("-O3")

generate_ses_project()



Loading

0 comments on commit 7f5707c

Please sign in to comment.