Skip to main content

双pmos作为开关

· One min read
Z-o-o-d
Owner

用于USBC电源开关

电路如图

DUAL_MOS_SWITCH

DUAL_SW低电平NMOS截止,AO4805双PMOS被举起,开关关断。

DUAL_SW低电平NMOS导通,AO4805双PMOS控制脚(G)低电平,开关打开。

STM32CubeIDE使用CMSIS_DAP

· 2 min read
Z-o-o-d
Owner

切换为OpenOCD,公版我不会改,ST的魔改过的,改这个比较方便

alt text

切换后打开CFG文件

alt text

改签改后对比

source [find interface/stlink-dap.cfg]

transport select "dapdirect_swd"

reset_config srst_only srst_nogate connect_assert_srst

把以上改为以下

source [find interface/cmsis-dap.cfg]

transport select "swd"

reset_config none

BEFORE

# This is an genericBoard board with a single STM32G474RETx chip
#
# Generated by STM32CubeIDE
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)

source [find interface/stlink-dap.cfg]


set WORKAREASIZE 0x8000

transport select "dapdirect_swd"

set CHIPNAME STM32G474RETx
set BOARDNAME genericBoard

# Enable debug when in low power modes
set ENABLE_LOW_POWER 1

# Stop Watchdog counters when halt
set STOP_WATCHDOG 1

# STlink Debug clock frequency
set CLOCK_FREQ 8000

# Reset configuration
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
set CORE_RESET 0

# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333





# BCTM CPU variables

source [find target/stm32g4x.cfg]


AFTER

# This is an genericBoard board with a single STM32G474RETx chip
#
# Generated by STM32CubeIDE
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)

source [find interface/cmsis-dap.cfg]


set WORKAREASIZE 0x8000

transport select "swd"

set CHIPNAME STM32G474RETx
set BOARDNAME genericBoard

# Enable debug when in low power modes
set ENABLE_LOW_POWER 1

# Stop Watchdog counters when halt
set STOP_WATCHDOG 1

# STlink Debug clock frequency
set CLOCK_FREQ 8000

# Reset configuration
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config none
set CONNECT_UNDER_RESET 1
set CORE_RESET 0

# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333





# BCTM CPU variables

source [find target/stm32g4x.cfg]