Hi.
First, I'm using DSP/BIOS 5.41 and EVMDM6437 Board.
And I've used the mailbox source provided by TI.
THIS IS MY SOURCE PATH : C:\CCStudio_v3.3\bios_5_41_01_09\packages\ti\bios\examples\basic\mailbox
But I can't be sure, I think there is a bug in the mailbox module.
In that source, basically mailbox has 2 length object property in GCONF.
But when I changed this from 2 to 3 length, then compiled it and run it, It's behavior is abnormal I think.
This is result(LOG) when i excuted this program which has mailbox 3 length.
0 (0) writing 'a' ... 1 (0) writing 'b' ... 2 (0) writing 'c' ... 3 writer (0) done. 4 read 'a' from (0). 5 read 'b' from (0). 6 read 'c' from (0). 7 (1) writing 'a' ... 8 (1) writing 'b' ... 9 (2) writing 'a' ... 10 read 'a' from (1). 11 read 'b' from (1). 12 read 'a' from (2). 13 (1) writing 'c' ... 14 writer (1) done. 15 (2) writing 'b' ... 16 (2) writing 'c' ... 17 writer (2) done. 18 read 'c' from (1). 19 read 'b' from (2). 20 read 'c' from (2). 21 timeout expired for MBX_pend() 22 reader done. |
As you can see line from 7 to 14, this is weired.
I've thought that Writer 1 have to write all characters("a,b,c") to a mailbox buffer before Writer 2 writes its characters.
And One Reader Task must read all buffer data that is received by writer 1 task.
But the line no.9 show that writer 1 task is preempted by writer 2 task.
I think, the preemption is not possible in this condition(because Writer 1, Writer 2, Writer 3, Reader have all same priority of 1)
So, I tested some cases through changing mailbox length property from 1 to 7.
and I found out that only when I set length value to 3, this mailbox example has a problem.
another cases have no problem i can't expect.
This is Reader and Writer Sources. And the program has 3 writer tasks and 1 reader task.
and one mailbox object(mbx)
Regards,
Zizek