0
votes

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.

2
Without knowing what device you are talking about how can you expect anyone to answer this question? Normally such things are handled by your debugger.Clifford
The MCU i'm working with is STM32F103RBT6 ARM 32 bit CORTEX M3™. The development board is STM32-H103 olimex.com/Products/ARM/ST/STM32-H103Cosmin
I know that this is normally is handled by the debugger but i need to receive these packages because i want to see what code is executed at a specific time.Cosmin
My project aims to give approximate current consumption per executed instruction.Cosmin
STM32-H103 is an Olimex development board, not the processor - that would be STM32F103. Either way, you should have added the information to the question to improve it rather than as a comment and remaining a poorly formed question - done it for you.Clifford

2 Answers

1
votes

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.

1
votes

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++;
}