cosminq
cosminq

Reputation: 51

STM32F103 TRACESWO debug configuration

I'm working with the following MCU STM32F103RBT6 ARM 32 bit CORTEX M3™. The developemment board is STM32-H103. My project aims to give an approximate current consumption per executed instruction. For that i need to configure the SWO to generate packages containing the PC (program counter), all the generated interrupts and the timestamp. Can anyone help me ?

Thanks.

Upvotes: 0

Views: 4626

Answers (2)

Frank
Frank

Reputation: 11

TRACE SWO example,

int SwdWrite(char * pcBuff,unsigned long length)
{
        int xBytesSent=0;
        while (length)
        {
                ITM_SendChar((uint32_t)(*pcBuff));
                length--;
                pcBuff++;
                xBytesSent++;
        }
        return xBytesSent++;
}

Upvotes: 1

Clifford
Clifford

Reputation: 93446

TRACE SWO is available to you on your board if using SWI rather than JTAG. Section 31 of the STM32F103 reference manual describes the debug support for the part.

Trace information available via TRACESWO is very limited and not instruction level. You require more expensive debug hardware to access the full instruction level trace capability.

Full trace capability is a 6 wire interface in addition to the standard JTAG or SWI debug interface. The STM32-H103 board's debug connector does not provide these pins, though they may be available on the extension headers since they are multiplexed with other functions.

Upvotes: 1

Related Questions