Target AM57x
I am having a problem running a very simple DSP program on both dsp1 and dsp2. The program being used just creates a main task, starts BIOS, andworkspace_dsp_hello.tar.gz the task prints a message and then loops forever as if it is waiting for a debugger to attach.
I am attaching the source code and objects for these two projects. I am building these programs from within Code Composer (12.4) as CCS Projects. I am using an RTOS processor sdk version 8.01.00.09. I have tried running the programs on both 4.19.94 and 5.10.168 kernels with mixed results.
The differences between the source code files are as follows:
- The XDCtools Platform argument is slightly different:
- The DSP1 project is using ti.platforms.evmDRA7XX:dsp1
- The DSP2 project is using ti.platforms.evmDRA7XX:dsp2
- main1.cfg: The procName is set to "DSP1" or "DSP2" depending on the project.
- dsp1_rsc_table_dsp.h: The variable MEM_BASE is set to match the reserved-memory region for the appropriate DSP.
- DSP1 gets a MEM_BASE value of 0x99000000
- DSP2 gets a MEM_BASE value of 0x9F000000
- These values match what is in the device tree I am using for the reserved-memory regions for dsp1 and dsp2 respectively
I build these programs using Code Composer (12.04) on a Linux VM.(Ubuntu 18.04)
- Untar the file, should create a workspace_dsp_hello directory
- Start Code Composer, pick the workspace_dsp_hello directory for the workspace_dsp_hello
- File->Import...->Code Composer Studio->CCS Projects. Press Next>
- Press the Browse... button to the right at the top line, "Select search-directory". Press the Open button in the upper right of the Select Search Directory dialog that comes up in order to select the default directory it is showing.
- Check the checkboxes for both DSP1 and DSP2. Press Finish.
- This should import the 2 projects and show them in the Project Explorer.
- Build the projects. I have been using Debug versions.
Results:
4.19.94 kernel
- Both programs can be started and the trace0 output for each is like this:
root@mitysom-am57x:~# more /sys/kernel/debug/remoteproc/remoteproc2/trace0
[ 0.000] 18 Resource entries at 0xa0000000
[ 0.000] registering rpmsg-proto:rpmsg-proto service on 61 with HOST
[ 0.000] [t=0x033e7906] xdc.runtime.Main: NameMap_sendMessage: HOST 53, port=61
[ 0.000] Waiting for debugger
root@mitysom-am57x:~# more /sys/kernel/debug/remoteproc/remoteproc3/trace0
[ 0.000] 18 Resource entries at 0xa0000000
[ 0.000] registering rpmsg-proto:rpmsg-proto service on 61 with HOST
[ 0.000] [t=0x0380d228] xdc.runtime.Main: NameMap_sendMessage: HOST 53, port=61
[ 0.000] Waiting for debugger
- This output was after a reboot where the DSP processors were started as part of the reboot.
- Originally, neither DSP was running and I started DSP2 first, and then DSP1.
5.10.168 kernel
- The results were not as good here and I am not sure why.
- When starting a DSP, a symbolic link is made from /lib/firmware/dra7-dsp1-fw.xe66 to DSP1.out and similarly for DSP2.out.
- If neither DSP is running and I start DSP2, then it freezes the kernel. The console is unresponsive. A system reboot after a power cycle is still trying to start DSP2 and this again freezes the system.
- After the freeze, I plug the SD card into the Linux VM and move the target of the symbolic link from DSP2.out to DSP2.out.hide. This lets the system boot again.
- If I start DSP1, it seems to work.
- If I then start DSP2, this seems to work. So DSP2 seems to work if DSP1 is already running.
- If a reboot is now done with the intent to start both DSPs, things go south and the system is toast. I don't think the order of starting the DSPs is guaranteed and since the order seems to matter, it is not likely to work. I don't remember all the details but sometimes the system goes into rolling exceptions.
- This is repaired by renaming the targets of the symbolic links as was done above.
Questions:
- Why would trying to start DSP2 freeze the system on 5.10.168 if DSP1 is not already running?
- Are there possibly some kernel config options that could affect starting the DSPs like this?
Thanks.