Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Add SAM5X SWO support
Browse files Browse the repository at this point in the history
  • Loading branch information
mubes committed Dec 20, 2020
1 parent 6055192 commit 97caf8a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Support/gdbtrace.init
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ IMXRT;
enableIMXRT102XSWO : Enable SWO on IMXRT102X series pins (AD_B0_04)
enableIMXRT106XSWO : Enable SWO on IMXRT106X series pins (AD_B0_10)

SAM5X;
enableSAMD5XSWD : Enable SWO on SAM5X output pin on SAM5X

All;
prepareSWO : Prepare SWO output in specified format

Expand Down Expand Up @@ -224,6 +227,20 @@ document enableSTM32SWO
enableSTM32SWO Configure output pin on STM32 for SWO use.
end
# ====================================================================
define enableSAMD5XSWD
# Enable peripheral channel clock on GCLK#0
# GCLK->PHCTRL[47] = GCLK_PCHCTRL_GEN(0)
set *(unsigned char *)0x40001D3C = 0
# GCLK->PHCTRL[47] |= GCLK_PCHCTRL_CHEN
set *(unsigned char *)0x40001D3C |= 0x40
# Configure PINMUX for GPIOB.30. '7' is SWO.
set *(unsigned char *)0x410080BF |= 0x07
set *(unsigned char *)0x410080DE = 0x01
end
document enableSAMD5XSWD
enableSAMD5XSWD Configure output pin on SAM5X for SWO use.
end
# ====================================================================
# Enable CORTEX TRACE on preconfigured pins
define _doTRACE
# Must be called with $bits containing number of bits to set trace for
Expand Down

0 comments on commit 97caf8a

Please sign in to comment.