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.

DaemonNew does not work with OpenMP

Other Parts Discussed in Thread: SYSBIOS, TMS320C6678

Hi, all!
I'm learning evm6678. I'm a beginner in programming DSP and I have many questions about combining NDK and OpenMP.
I want to create a project in which one core would receive data via ethernet and other cores would process this data in parallel.
So, for this goal I want to combine NDK and OpenMP. While solving this problem, I have faced with many other problems, the solution of which I could not find.
To begin with, I created a simple project with NDK, which sends a welcome message via TCP/IP and I faced a problem: NC_NetStart does not start. Later I noticed that after system reset and restart, project starts and runs normally. In the post on this forum, I found a solution to this problem by adding the following strings to EVM_init():

/* Disabling PA PDSP to prepare for power down */
    	volatile unsigned int *passPDSP;
    	passPDSP = (unsigned int*) PASS_PDSP0;
    	*passPDSP &= 0xFFFFFFFD;

    	passPDSP = (unsigned int*) PASS_PDSP1;
    	*passPDSP &= 0xFFFFFFFD;

    	passPDSP = (unsigned int*) PASS_PDSP2;
    	*passPDSP &= 0xFFFFFFFD;

    	passPDSP = (unsigned int*) PASS_PDSP3;
    	*passPDSP &= 0xFFFFFFFD;

    	passPDSP = (unsigned int*) PASS_PDSP4;
    	*passPDSP &= 0xFFFFFFFD;

    	passPDSP = (unsigned int*) PASS_PDSP5;
    	*passPDSP &= 0xFFFFFFFD;
    	/* Turning off the NetCP modules and domain */
    	setModulePower(CSL_PSC_LPSC_CPGMAC, CSL_PSC_PD_PASS, 0);
    	setModulePower(CSL_PSC_LPSC_Crypto, CSL_PSC_PD_PASS, 0);
    	setDomainAndModulePower(CSL_PSC_LPSC_PKTPROC, CSL_PSC_PD_PASS, 0);

and replacing the file resourcemgr.c at the next:

2086.resourcemgr.c

So, my first question:

1) What are fundamental changes in the code that the project began to run immediately without system reset? And when it should be used (only in project with NDK)?

Next, I started my project with NDK at ti.omp.examples.platform.evm6678 and it worked normally. But when I tried to combine my .cfg file and .cfg file from OpenMP Hello World I got:
HeapOMP.SharedRegionId is invalid  (if I use omp 1.1.3.02)

and if I used omp 1.2.0.05 then I got:
Segment 0xa0200000 overlaps with: SL2_RAM

The situation described for SYS/BIOS 6.33.6.50 and XDCtools 3.23.4.60. If I use a later version, then I get:


A second question:

2)  How correctly create SharedRegion and HeapOMP?


After all this, I began to use demos.image_processing.openmp.evm6678l.platform and tried to combine my .cfg file and .cfg file from image processing demo, but errors were similar to the previous case. When I changed the location of the sections in the .cfg file from DDR3 to MSMCSRAM, the program compiled, but never went to main().

A third question:

3) Which sections should be statically placed in .сfg file, and where better to place their?

4) How to learn correctly create platforms and .cfg files for projects with NDK and OpenMP?

Later, I began to use platform and .cfg file from demo like a template, but sources and headers files were my, but again the program never go to main(). After it, I took whole image processing demo progect and began to use it like template only inserting into to it my functions. In this case program go to main() only after system reset and restart (and it is not always). Then I added  setModulePower() and setDomainAndModulePower() functions in resourcemgr.c, but it did not solve problem.

So, question:

5) How to make the program always run stably and go to main()?

Okay! Sometimes it goes to main() - that's good. But again when program comes up to NC_NetStart(), it gives in console next:

Timeout waiting for reply from PA to PA_addMac command

ti.sdo.ipc.heaps.HeapMemMP: line 820: assertion failure: A_invalidFree: Invalid free

xdc.runtime.Error.raise: terminating execution.

Again do system reset and restart, and after it the program do NC_NetStart() normally and go to NetworkStart(), where I call DaemonNew(). In ROV I saw, that task for daemon was created, but after exit from NetworkStart(), program stops running and in console I saw:

ti.sysbios.knl.Task: line 334: E_stackOverflow: Task 0x9002e8a0 stack overflow

xdc.runtime.Error.raise: terminating execution.

The main question:

6) How to make a TCP/IP stack start in this situation?

I tried using different combinations with different versions of the component TI-RTOS, and stopped at this (in brackets components that I also tried):

IPC 1.24.3.32 (1.25.3.15, 1.24.2.27)

MCSDK 2.1.2.6

PDK TMS320c6678 1.1.2.6

NDK 2.24.0.11 (2.24.1.18)

NSP (1.10.2.09)

OMP 1.1.3.02 (1.2.0.05)

SYS/BIOS 6.33.6.50 (6.40.1.15, 6.41.0.26)

XDCtools 3.23.4.60 (3.30.1.25_core, 3.30.5.60_core)

compiler version TI v7.4.0 (7.4.8, 8.0.0)

Build-profile: release

7) Can I use the latest versions of components together? (for example, would  omp 1.2.0.05 and SYS/BIOS 6.41.0.26, XDCtools 3.30.5.60_core work together?)

I hope that someone will be able to answer at least some of the questions.

Best regards,

Nik