[SOLVED] Scripting Trace for test automation

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Scripting Trace for test automation

    Hi, having used Keil's uVision 4, I was used to call it with command line parameters to provide a set of uvproj-uvopt-axf files, allowing it to setup trace, flash the axf file, set a log file, do code coverage and run until it stops at a specified point :

    keil.com/support/man/docs/uv4/uv4_debug_commands.htm

    Basically, the script file would looks like this :

    Brainfuck Source Code

    1. /*-------------------------------------------------------------------
    2. ** Define the function to enable the trace port
    3. **-----------------------------------------------------------------*/
    4. FUNC void EnableTPIU(void) {
    5. _WDWORD(0x40023830, _RDWORD(0x40023830) | 0x00000010); // RCC_AHB1ENR: IO port E clock enable
    6. _WDWORD(0x40021000, 0x00002AA0); // GPIOE_MODER: PE2..PE6 = Alternate function mode
    7. _WDWORD(0x40021008, 0x00001550); // GPIOx_OSPEEDR: PE2..PE6 = 25 MHz Medium speed
    8. _WDWORD(0x4002100C, 0x00001550); // GPIOx_PUPDR: PE2..PE6 = Pull-up
    9. _WDWORD(0x40021020, 0x00000000); // GPIOx_AFRL: PE2..PE6 = AF0
    10. _WDWORD(0xE0042004, 0x000000E0); // Set DBGMCU_CR : - E0 --> Sync 4 bit
    11. }
    12. /*-------------------------------------------------------------------
    13. ** Invoke the function at debugger startup
    14. **-----------------------------------------------------------------*/
    15. EnableTPIU();
    16. /*-------------------------------------------------------------------
    17. ** Execute upon software RESET
    18. **-----------------------------------------------------------------*/
    19. FUNC void OnResetExec(void) {
    20. EnableTPIU();
    21. }
    22. Load "boot.axf" INCREMENTAL
    23. Load "test.axf" INCREMENTAL
    24. slog > test.printf.log
    25. g,testEnd
    26. slog off
    27. /* Create and save coverage information including assembly instructions */
    28. log > test.cov_asm.log
    29. coverage asm
    30. log off
    31. /* Create and save the statistics about the executed code */
    32. log > test.cov_result.log
    33. coverage
    34. log off
    35. /* Create and save the code coverage to a file.cov */
    36. coverage save test.cov_save.cov
    37. exit
    Display All
    Now using J-Link Commander, is it possible to do something similar in functionalities ?

    wiki.segger.com/J-Link_Commander

    Cheers.
  • Hello,

    Thank you for your inquiry.
    Ozone would be the right tool for this:
    segger.com/products/development-tools/ozone-j-link-debugger/
    The init you provided looks like some STM32F target device.
    Trace example projects for numerous devices can be found here: segger.com/products/debug-prob…echnology/tested-devices/

    An automation example in Ozone can be found here:

    wiki.segger.com/SEGGER_Ozone#Automated_test_example

    All Ozone GUI actions can be scripted e.g. an automated code coverage export with different possible filters etc.


    Best regards,

    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    I would like to script the automation of my test too. I need to log in a file the SWO output.

    I see in this thread ([SOLVED] Ozone: SWO issues), that it was planned to get the SWO trace in your development, what is the status today?

    I tried some options to get this trace, like Trace.ExportCSV but it failed. I know that it is possible to get this trace with other tools like Keil with the option log.


    Best regards
  • Hello,

    JBE wrote:

    I would like to script the automation of my test too. I need to log in a file the SWO output.
    SWO tracing is currently not supported by Ozone and we have no pripority for that feature in SWO at the moment.
    Currently only printf statements via SWO can be logged in Ozone terminal.
    If printf SWO is what you are looking for then we have good news as we are currently working on a scriptable SWO printf export function to be able to save the terminal log to a file.

    If you need that prinf log now JLinkSWOViewer can be used via CL and a log file can be specified.
    As an pin less alternative to SWO printf we suggest using RTT: segger.com/products/debug-prob…about-real-time-transfer/

    If you are looking for SWO tracing for debugging purposes our IDE Embedded Studio already supports SWO trace:
    wiki.segger.com/SEGGER_Embedde…mbedded_Studio_to_use_SWO

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.