This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[Cortex-M3] SWO Packet Parsing

Note: This was originally posted on 21st February 2012 at http://forums.arm.com

Hi,

I'm trying to play with SEGGER JLink device and ARM M3 micro in order to implement a SWV engine.
Currently I set a SWD protocol communication, and all other needed definitions for the SWO activation:

DEMCR    = 0x01000000
DWT_FUNCTION0 = 0x00000000
DWT_FUNCTION1 = 0x00000000
DWT_FUNCTION2 = 0x00000000
DWT_FUNCTION3 = 0x00000000

I would like to monitor a variable located at address 0x2000017C, a 2 bytes length interger that changes every 100us:

DWT_COMP0   = 0x2000017C
DWT_MASK0  = 0x00000001
DWT_FUNCTION0 = 0x00000023

SELECTED_PIN_PROTOCOL_REG = 0x00000002
TPIU_ACPR       = 0x0000008F
LOCK_ACCESS_REGISTER   = 0xC5ACCE55
ITM_TCR       = 0x0001000F
ITM_TPR       = 0x0000000F
ITM_TER       = 0x00000000
DWT_CTRL       = 0x400003FE
TPIU_FFCR       = 0x00000100

When I start my acquisition phase, I'm able to obtain the buffer content from the TPIU (see attachment):


00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FC 00 00 00 05 8F 00 00 00 00 D0...

but I have difficulties regarding the parsing process: I'm not able to understand if the 28 bytes of 0s belong to the header that should terminates with only one 0b1.
The serie, in fact, terminates with 0xFC = 0b11111100, but I don't know if the first 1 bit (position [7]) belongs to the header definition, so if I have to discard it and consider the remaining value (0b1111100) value for the next data retrieving.

And after the header, how can I understand what type of info is following?

Thank you very much.
Parents
  • Note: This was originally posted on 13th April 2012 at http://forums.arm.com

    Hi there,

    Can you please let me know the way to decode those packets.
    My problem is: I am using Cortex M3 microcontroller and using Eclipse IDE (C/C++) for the same. So I want to display the debug messages in my code(printf). I am checking SWV and I cn see SWP packets in Jlink control panel.I am receiving data but I cant really comprehend it.
    Please advice.

    Thanks
    Sushant
Reply
  • Note: This was originally posted on 13th April 2012 at http://forums.arm.com

    Hi there,

    Can you please let me know the way to decode those packets.
    My problem is: I am using Cortex M3 microcontroller and using Eclipse IDE (C/C++) for the same. So I want to display the debug messages in my code(printf). I am checking SWV and I cn see SWP packets in Jlink control panel.I am receiving data but I cant really comprehend it.
    Please advice.

    Thanks
    Sushant
Children
No data