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.

CCS: TDA4M EVM How to get started with SYS/BIOS and UART on C71 DSP?

Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi,

I have some trouble starting work witht he TDA4m EVM C66 and C71:

 

XDC Tools:

When I try to create a RTSC config in a project it asks me if XDCtools should be added to the project, I select yes.

Then when checking the project settings there is the message "None of the currently selected products supplies value for the Target. Please specify the Target manually, or try using a pre-3.30 version of XDCtools."

and I cannot click on the XDCtools entry on the left besides the compiler and linker.

I have various versions installed, from the 6.1.0 SDK and others, whats wrong here? I have CCS Version 9.2.0.00013

When I try to create a "DSP/BIOS v5.0 Configuration File" it tells me "No DSP/BIOS tools are currently installed. Please install DSP/BIOS tools before creating a new DSP/BIOS configuration file."

Also the user guides always to use examples from the resource explorer, but there is no TDA4 stuff in there.

I thought about calling XS manually but the command line is long and I cannot guess the parameters I need for the C71 DSP.

Since the CCS SYSBIOS stuff is not usable, a Makefile project would also be fine. Here I face the problem that there is no example project I can start with, or is there?

Which Makefiles do I need to include to pull ion the XDC stuff? Which variables must I set for this to work?

UART:

How can I use the UART to output debug message on the C71 and C66?

This is very important for me because I do not use the perception stuff which might run out of the box...

Please give me some example code or so. I searched the 6.1.0 SDK but could not find anything which is of much use.

It's really hard here to get started with the board. Much information is just not available or outdated or incorrect.

There is not much support even for easy stuff like a simple SYSBIOS hellow orld which print on the UART on the C71...

Best regards

Jan

  • I tried loading some executables from the pdk like UART_j721e_evm_c7x_1TestApp_release.xe71 via remoteproc on the C71 DSP,

    but the remoteproc interface tells me: remoteproc remoteproc2: header-less resource table

    There is also an IPC echo test, but the binary for the A72 seems to be a bare-metal binary. I need something running under a POSIX OS.

    As you see it is really frustrating to work with the TDA4 at this point. All I want is a small Makefile project for the C71 DSP which uses SYS/BIOS and prints "Hello world" on the UART. Maybe you can just provide me that via ZIP file?

  • Hi Jan,

    Are you trying to load the executables via CCS? I would recommend to try any of the examples in pdk which should be simple enough. To have an idea about what dependencies to include, you can go through the makefiles in any of the examples. I suppose you have already tried this. Please refer to Section 5.5 of the PSDKRA userguide for instructions on loading RTOS binaries to any core.

  • As i stated in another thread, CCS told me to update the XDS firmware, since then it does not work anymore (it's not bricked, i can connect with the xds still firmware utility). Thats why I wanted to try remoteproc.

    To use any example seems not to work, as I stated above, remoteproc fails for some of them and I don't know why.

    Aside from that it noes not answer my two questions:

    A: How to configure SYSBIOS tasks (XDC tools do not work in CCS). It would already help a little if you tell me if I am the only person where XDC tools do not work in CCS or if that is a bug or so in the 6.01.00 SDK.

    B: A simple example which uses UART on the C7 DSP.

    It would really satisfy me if you post a few lines of code which prints stuff to the UART on the C7x DSP.

    Best regards

  • hi Jan,

    Sorry for the trouble you are facing.

    Attached is a sample code which does below, see also README.txt included in the tar file file.
    It has a simple main.c with BIOS configured.
    A timer is configured (appTimerInterruptInit).
    A task is created (appMain) and printf is called every 10 OS ticks, (1 tick = 1ms).

    This needs to be loaded and run from CCS.
    The print goes to CCS console NOT UART.

    This should help you get started with SysBIOS.

    Note, we dont recommend to CCS projects and recommend to use makefile.

    XDC/SysBIOS Config needs to be done via .cfg files. Lot of config can also be done via APIs in C code. Example see how a task in create in this sample code.

    There is a "bios_common" folder where the SysBIOS config is done which is typically common across multiple CPUs (maybe overkill in this example but is helpful when there are more than one CPU in system running SysBIOS).

    There is a "c7x_1.cfg" which has C7x specific core info.

    I can help you with a similar app which can be loaded via linux boot loader, but I need some more info to  make such a sample app.

    1. Do you want the C7x app to be loaded from a bootloader, i.e you dont want to use CCS ? Out recommendation is to use the Linux uboot as bootloader when not using CCS. This needs a "resource table" to be setup.

    2. Linux itself uses one UART port, in our demos what we do is redirect a printf from SysBIOS side to a shared memory and then have a user space app on Linux to read from the shared memory and output to Linux console. This helps since when you have multiple CPUs you wont have enough UARTs to output prints from each CPU. Also its useful to see all prints from different CPUs in a common UART. Will this be ok for you rather than C7x controlling UART directly ? We highly recommend this approach.

    3. Do you want Linux and C7x to be able to talk to each other ? Or you want C7x to be a standalone application just running in parallel to A72 Linux?

    Based on this I can make simple app for you. The pieces of which are there in vision_apps.

    Example,

    1, needs a resource table to be setup (vision_apps/apps/basic_demos/app_tirtos/tirtos_linux/app_ipc_rsctable.h)

    2. needs a utility API on C7x side and application on linux side (vision_apps/utils/console_io)

    3. needs IPC to be init on C7x and Linux side (vision_apps/utils/ipc)

    If you can tell me some of this info it will help me make a useful sample for you. Largely I will update the attach app to add these features.

    regards
    Kedar

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/my_5F00_apps.tar.xz

  • Hi Kedar,

    big thanks for the detailed answer and the example! This is a good start!

    To your questions:

    1) We basically don't want to use CCS. U-Boot would be OK but I would prefer a more dynamic way, like Linux remoteproc.
    In development state this would enable us to compile C71/C66 firmware via makefile and directly load and test them.

    2) This sounds exactly like what we need right now. I will check your information and try to use this.

    3) Yes, we want to put parts of algorithms on the DSP. Note: We cannot use OpenCl since it is not ASIL conform.
    We first want a simple IPC communication, like triggering tasks on the DSP from the A72, this should work with shared memory.
    Later we may investigate OpenVx, but first we want basic IPC running.

    Hope you can help me with this. It's very difficult for me to find the information I need. We have tons of documents which I studied but I rely on this forum mostly.

    Best regards

    Jan

  • I will update the app to include 1,2,3. I will need a day to give you a updated app. Note, we recommend to use uboot for loading. This is still remote proc, only it runs from uboot.

    Regards

    Kedar

  • hi,

    Attached is the updated "my_app" which shows a simple IPC exchange of messages and buffers between A72 and C7x.

    Some notes,

    • Uboot loads the C7x app and Linux kernel
    • You can use printf on C7x and the print will appear on Linux A72 console.
    • A72 app does IPC with C7x in two ways
      1. It passes messages by value, i.e data is in the message, this is copy based IPC
      2. It passes messages via buffers, i.e data is in shared memory allocated buffer and message only holds the buffer pointer. This can be considered as zero copy IPC
    • High level its a cutdown of vision_apps, so the steps to build and run are same as that of vision_apps.
    • It uses some utility functions from vision_apps so that I do not need to rewrite them. The functions are granular in that you can copy over specific ones to my_apps and they work just fine.
    • See included README.txt for more details.

    If you need more help do not hesitate to ask.

    regards
    Kedar

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/my_5F00_apps_5F00_20191204_5F00_00.tar.xz

  • Wow, thanks very much for the support.

    I managed to modify the first version of your example to be loadable via Linux remoteproc.
    I was very happy when I got this working. Now I try to integrate the printf and then I will close this thread when it works.

    Thanks again! Your help was very good.

    A question: I got the IPC remoteproc stuff working but is there a documentation for it other than the doxygen generated?

    Best regards

    Jan

  • Small update:

    Your second example relies heavy on vision examples. So I try compiling them but get:

    [GCC] Compiling C99 app_mem_linux_ion.c
    /home/IBEO.AS/jahi/ti/psdk_rtos_auto_j7_06_01_00_15/vision_apps/utils/mem/src/app_mem_linux_ion.c:76:10: fatal error: ion/ion.h: No such file or directory
     #include <ion/ion.h>

    "It looks like it does not find the Linux Kernel source. I tried to find out how the compiler is called but could not find a VERBOSE option in concerto.
    So I have no idea how to fix this, I'm sure it's just a path thats not correct somewhere."

    [KC] You don't need need Linux kernel but you need Linux target filesystem from PSDKLA (Processor SDK Linux Automotive).

    See vision_apps/docs/user_guide/ENVIRONMENT_SETUP.html

    See also vision_apps/docs/user_guide/BUILD_TROUBLE_SHOOTING.html

    It tries to find ion.h file here ${PSDKRA_PATH}/targetfs/usr/include/ion/ion.h, check if you see this file here. And see if the Linux target filesystem exists at ${PSDKRA_PATH}/targetfs

    To get verbose print pass SHOW_COMMANDS=1 to the make command as below

    make SHOW_COMMANDS=1

    "It would be much nicer to get the printf via shared memory working without using the vision apps. Thats a dependency I don't want to use."

    [KC] We can do this, it will be a simple copy paste from vision_apps to here. There are few other utilities from here you will need including memory allocation, IPC. To get started hence I reused them. Let get this compiling and running and then I can help remove the vision_apps dependency. Note, you will still need the ion.h and some other files and .so's from Linux target filesystem to exchange shared buffers.

    Btw, the ion.h is a memory allocator in Linux, this is needed for exchanging shared memory buffers between 2 CPUs. This is not need for print per se.

    regards
    Kedar

  • OK so the current state is that I would prefer not to rely on vision_apps.

    There are a few reasons for this which are not so important ATM.

    Basically I need a lean shared mem printf() impl which only relies on the TI drivers like IPC but not on the vision apps.

    So if we can modify the first example you attached to make some kind of printf possible it would be nice.
    An easy solution would be prefered here which does not rely on vision_apps and many TI libraries in the Linux.

    I currently have an eye on ipc_echo_test_c7x_1_release.xe71 which when loaded via remoteproc spams the Kernel log with rpmsg virtio messages.

    I think this is what I need and I only need a way to print out text which is received in the Linux side without dependencies to libs and stuff.

  • I got shared memory working. Since I cannot make use of TI libs because ASIL and maybe another OS later I will make my own IPC stuff anyway.

    So with that closing this.

    Big thanks for you support!

  • Sorry that I open this again.

    I modified your app to load it via remoteproc (added resource table, modified linking) and it worked fine.

    But when I added a construct like this:

    volatile uint8_t* state = (uint8_t*)0xbc000100;
    
    static Void appMain(UArg arg0, UArg arg1)
    {
        *state = 1;
        while(1)
        {
            Task_sleep(10);
            *state = 2;
            printf("Hello, world !!!\n");
            *state = 3;
        }
    }
    

    I saw that it hangs at the Task_sleep() function. So I loaded the program via CCS + XDS and it worked fine.

    I should mention that I read the state in Linux like this: sudo devmem2 0xbc000100

    I assumed that there may be a problem with remoteproc and tried your unmodified example my_apps.tar.xz with the same state variable modification
    and loaded this via U-Boot, but the memory address is never set.

    I copied the binary to /lib/firmware/j7-c71_0-fw and in U-Boot I set dorprocboot=1.

    So what am I doing wrong? I have no idea how to debug this.

    Best regards Jan

  • Jan,

    Can you confirm, there are two problems ?

    1. "I saw that it hangs at the Task_sleep() function"

    2. What you write in *state is not reflected on Linux side.

    1. would be due to timer not setup, see my example, there will be a appTimerInterruptInit() in c7x_1/main.c, make sure your app calls this, else timer interrupt is not enabled and Task_sleep will never return

    2. 0xbc000100 is cached on C7x side after a write you need to do a cache writeback using below BIOS API.

    #include <ti/sysbios/hal/Cache.h>

       Cache_wb((Ptr)addr, (SizeT)size, (Bits16)Cache_Type_ALL, (Bool)TRUE);

    Note also the invalidate and writeback invalidate API in BIOS below

    Cache_wbInv((Ptr)addr, (SizeT)size, (Bits16)Cache_Type_ALL, (Bool)TRUE);

    Cache_inv((Ptr)addr, (SizeT)size, (Bits16)Cache_Type_ALL, (Bool)TRUE);

    On Linux side, when you do devmem2, this maps it as non-cached so once you do a writeback from C7x you should see it.

    regards

    Kedar