SWO Debug#

Serial Wire Output Debug Configuration.

Initializes Serial Wire Output using the DWT and ITM peripherals of Cortex-M processors. Configures output of Program Counter samples, interrupt events, and data over any ITM channel.

Functions#

sl_status_t

Initialize SWO Debug.

sl_status_t
sl_debug_swo_enable_itm(uint32_t channel)

Enable an ITM channel.

sl_status_t
sl_debug_swo_disable_itm(uint32_t channel)

Disable an ITM channel.

sl_status_t
sl_debug_swo_write_u8(uint32_t channel, uint8_t byte)

Write a byte to an ITM channel.

sl_status_t
sl_debug_swo_write_u16(uint32_t channel, uint16_t half_word)

Write a half-word to an ITM channel.

sl_status_t
sl_debug_swo_write_u32(uint32_t channel, uint32_t word)

Write a word to an ITM channel.

Macros#

#define
sl_debug_swo_write sl_debug_swo_write_u8

alias for backward compatibility

Function Documentation#

sl_debug_swo_init#

sl_status_t sl_debug_swo_init (void )

Initialize SWO Debug.

Parameters
N/A

Initializes SWO debug using configuration parameters for frequency, as well as whether PC sample events and interrupt events should be emitted.

Note

Returns

  • Status code

Return values

  • SL_STATUS_OK: SWO initialized successfully


Definition at line 66 of file platform/driver/debug/inc/sl_debug_swo.h

sl_debug_swo_enable_itm#

sl_status_t sl_debug_swo_enable_itm (uint32_t channel)

Enable an ITM channel.

Parameters
[in]channel

ITM channel number

Enables the given ITM channel in the Trace Enable Register.

Returns

  • Status code

Return values

  • SL_STATUS_OK: ITM channel enabled successfully


Definition at line 79 of file platform/driver/debug/inc/sl_debug_swo.h

sl_debug_swo_disable_itm#

sl_status_t sl_debug_swo_disable_itm (uint32_t channel)

Disable an ITM channel.

Parameters
[in]channel

ITM channel number

Disables the given ITM channel in the Trace Enable Register.

Returns

  • Status code

Return values

  • SL_STATUS_OK: ITM channel disabled successfully


Definition at line 92 of file platform/driver/debug/inc/sl_debug_swo.h

sl_debug_swo_write_u8#

sl_status_t sl_debug_swo_write_u8 (uint32_t channel, uint8_t byte)

Write a byte to an ITM channel.

Parameters
[in]channel

ITM channel number

[in]byte

Byte to send

Writes the given byte to the given ITM channel

Note

  • This function ensures that the ITM channel is enabled, and enables it if it wasn't already. Note that even if the debug port is locked, the byte will still be written on the SWO.

Returns

  • Status code

Return values

  • SL_STATUS_OK: Byte sent successfully

  • SL_STATUS_NOT_INITIALIZED: ITM has not been enabled, call


Definition at line 113 of file platform/driver/debug/inc/sl_debug_swo.h

sl_debug_swo_write_u16#

sl_status_t sl_debug_swo_write_u16 (uint32_t channel, uint16_t half_word)

Write a half-word to an ITM channel.

Parameters
[in]channel

ITM channel number

[in]half_word

Half-word to send

Writes the given half-word to the given ITM channel

Note

  • This function ensures that the ITM channel is enabled, and enables it if it wasn't already.

Returns

  • Status code

Return values

  • SL_STATUS_OK: half-word sent successfully

  • SL_STATUS_NOT_INITIALIZED: ITM has not been enabled, call


Definition at line 133 of file platform/driver/debug/inc/sl_debug_swo.h

sl_debug_swo_write_u32#

sl_status_t sl_debug_swo_write_u32 (uint32_t channel, uint32_t word)

Write a word to an ITM channel.

Parameters
[in]channel

ITM channel number

[in]word

Word to send

Writes the given word to the given ITM channel

Note

  • This function ensures that the ITM channel is enabled, and enables it if it wasn't already.

Returns

  • Status code

Return values

  • SL_STATUS_OK: half-word sent successfully

  • SL_STATUS_NOT_INITIALIZED: ITM has not been enabled, call


Definition at line 153 of file platform/driver/debug/inc/sl_debug_swo.h

Macro Definition Documentation#

sl_debug_swo_write#

#define sl_debug_swo_write
Value:
sl_debug_swo_write_u8

alias for backward compatibility


Definition at line 158 of file platform/driver/debug/inc/sl_debug_swo.h