This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4AEN-Q1: Lauterbach cmm script not working to load mcu domain freertos application.

Part Number: TDA4AEN-Q1
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hello team,

Debugger part no.:- LA-3506 PowerDebug X50 with LA-3743A JTAG-ARM

Trace32 verion:- TRACE32 for ARM -> Version: R.2024.09.000175016

rtos-sdk version:- ti-processor-sdk-rtos-j722s-evm-10_00_00_05

We are trying to load hello-world freertos program to mcu-r5fss0-0 core of TDA4AEN board. Attached the .cmm script used.

 Trace32 shows the target is running but we're not able to see any print on ttyUSB1(mcu domain) serial terminal. Attached ttyUSB0(wakeup domain) logs for reference.

I've tested the same program on Blackhawk and it is working fine. But we need to use lauterbach for our Project.

So can you please help us to debug using lauterbach and also share us the working cmm script.

system.reset
system.cpu TDA4AEN-CR5-MCU
system.jtagclock 10.0Mhz
DIALOG.OK "Please Power cycle the target and press ok"
SYStem.config.debugap1.port 1.
SYStem.CONFIG.COREDEBUG.Base DAP:0x9d510000
SYStem.CONFIG.CTI.Base DAP:0x9d518000
SYStem.CONFIG.ETM.Base DAP:0x9d51c000
;system.o ResBreak off
;system.m.a
system.up
if run()
  break
register.reset
data.load.auto "C:\Users\8lmcwq\Downloads\hello_world.release.out"
data.list
break.set main
;go.direct main
;register.set pc main 
go
enddo
;

Regards,

Tarun C

  • Hello,

    The basic reason this ~bare metal .out file can't be direct loaded is the MCU had run some ROM code ahead of the attach which left the MPU and icache enabled.  A reset or a core clean up is needed before a reliable new object load+run can happen.  There are a few ways to force resets but probably the most simple solution in this case is just to add some clean ups which zap the icache and MPU.  I made a short video showing a ~semi-random version of a hello world I scraped up and added the script fragment below.

    SYStem.Attach
    Break
    GOSUB CLEAN_CORE
    GOSUB TI_SEMIHOST
    data.load.auto "d:/syms/j7aen/hello_world.release.out"
    data.list
    break.set main
    Go
    WAIT !RUN()
    Register.Set PC hello_world_main+0xa
    Go
    
    enddo
    ;
    CLEAN_CORE:
    (
      Register.reset
      cache.INVALIDATE.dc
      cache.INVALIDATE.ic
      PER.Set.simple C15:0x1 %Long 0x01E50878  ; shut off I/D/M let the application turn it on
      ; R5 to SVC mode with IRQs + async abort masked
      Register.Set M 0x13  ; SVC
      Register.Set I 1
      Register.Set F 1
      Register.Set A 1
      Register.Set T 0
      RETURN
    )
    
    TI_SEMIHOST:
    (
      TERM.RESET
      TERM.size #2 80. 50. 200.
      TERM.METHOD #2 CCIO C$$IO$$ __CIOBUF_
      WinPOS ,,,,,, semihost, Normal "SemiHost Console"
      TERM.GATE #2
      Break.Set C$$IO$$
      RETURN
    )
    
    ARM_SEMIHOST:
    (
      TERM.RESET
      TERM.HEAPINFO 0x00000 0x10000 (0x70680000+0x4000) 0x70680000  ; IAR/GCC - GCC-newlib broken heap needs 0
      TERM.METHOD armswi
      TERM.Mode STRING
      TERM.GATE
      RETURN
    )

    Regards,
    Richard W.
  • Hi Richard,

    Thanks for the cmm script. Now I'm able to get print statements in the Trace32 console.

    But I have three questions,

    1. Those print statements that I'm getting are in Trace32 Console and not on UART. I've opened /dev/ttyUSB1 (since it is MCU core) but I get nothing in the serial terminal. How to get those prints in UART as well?

    2. What does Register.Set PC hello_world_main+0xa in cmm script do? If I'm running any other code, what should I change.

    3. How to include source symbols for debugging?

    Regards,

    Tarun C

  • Hello Tarun,

    -0-  The general answer is like this:

    To run the SDK example using the TI supplied drivers you will need to burn a sbl_null into your flash.  This image loads and inits firmware which provides services the drivers want to use.

    If you follow this step (which burns an SBL NULL and sets DIP switches) the UART will work.

    The above step uses the uniflash program to download and burn the image into EVM target.  It is also possible to use a Lauterbach flasher to burn the image into your board, but as you are developing with the SDK its best to just follow these steps the first time.  Later you can factor out uniflash if its useful.

    Now specific questions:

    -1- 

    The UART requires a TI driver to run which requires the sciserver service which is depends on firmware running the the cortex-m/tifs core.  Once you provide the firnware which runs at power one and before the jtag app load attempt it will work. 

    -2-

    The register.set pc main+0xa skips over the driver init calls which make use of the sciserver and just starts execution at the printing of hello world.  The point of this was to get you to the ~same point as you were with the blackhawk (probably just a bit further actually) as that probably got to main but failed as you didn't burn the firmware.   Like with the flashing, there can be ways to shift more things to the JTAG, but those are not supported by the SDK, and especially for startup there its counter productive to start to customize before you are going.

    -3- 

    The easiest way to get source is to go to a list window and right click in a hashed area in the assembly listing.  The menu which comes up has a 'resolve source' option which allows you to navigate to the source and it will fix up everything.   You can also use symbol.spath.srd in a script or command to have it search a directory structure for your source.  There are actually many ways to establish the paths, if you look in the TRACE32 documentation for 'Symbol' many examples are there.   For these kind of tool specific questions, its best to ask Lauterbach support as they can supply the best advice for their tool. 

    Regards,

    Richard W.