I am working with the high_accuracy_14xx_mss lab.
Now that a basic EDMA transfer is working, I am trying to add the MmwDemo_EDMA_transferCompletionCallbackFxn() to signal the completion of the transfer. Following the existing EDMA_1Ddone_semHandle example existing in the MmwDemo_edmaInit() function, I created a EDMA_L1BackupDone_semHandle semaphore:
Semaphore_Params_init(&semParams);
semParams.mode = Semaphore_Mode_BINARY;
obj->EDMA_1Ddone_semHandle = Semaphore_create(0, &semParams, NULL);
Semaphore_Params_init(&semParams);
semParams.mode = Semaphore_Mode_BINARY;
obj->EDMA_L1BackupDone_semHandle = Semaphore_create(0, &semParams, NULL);
Then in the MmwDemo_EDMA_transferCompletionCallbackFxn(), I again copied what was existing in the function:
switch (transferCompletionCode)
{
case MMWDEMO_EDMA_TRANSFER_COMPLETION_CODE_1D_DONE:
Semaphore_post(obj->EDMA_1Ddone_semHandle);
break;
case EDMA_TPCC0_REQ_FREE_2:
Semaphore_post(obj->EDMA_L1BackupDone_semHandle);
break;
When I run the code, it crashes when the Semaphore_post is called.
I find the same thing happens if I substitute the EDMA_1Ddone_semHandle for the semaphore to be posted. I also tried adding a Semaphore_reset() just before the call to post to ensure the semaphore count is 0, but the crash still occurs.
I would expect that the existing code provided in the lab is functional, but the MmwDemo_EDMA_transferCompletionCallbackFxn() is not actually used for the base build. Therefore, I cannot verify that the initial implementation of the semaphores in the lab actually works and does not create an assert.
A call to Semaphore_Module_startupDone() before the creation of the semaphore return TRUE, so the semaphore module has started. From the debug error messages, it appears that there may be a privilege or exclusion issue. The 6.53.02.00 BIOS User Guide does not indicate that there are conditions necessary for the semaphores to work. Is there something else that needs to be called, enabled, or disabled for the semaphores to work?