Hi Kerry,
I have been able to get the shell module to work in a task. I needed to set the priority of the shell task to be lower than all the others and make sure that all other tasks have a vTaskDelay() in them.
However this implementation isn't ideal for me because I can't really control how often the shell task is called.
I'm looking into SHELL_NON_BLOCKING_MODE. It looks like I define DEBUG_CONSOLE_TRANSFER_NON_BLOCKING, which sets SERIAL_MANAGER_NON_BLOCKING_MODE=1.
Since I am using static memory allocation in my project this causes an error when using the function xSemaphoreCreateMutex(). I've made the following change in fsl_debug_console.c
- #define DEBUG_CONSOLE_CREATE_MUTEX_SEMAPHORE(mutex) ((mutex) = xSemaphoreCreateMutex())
+ StaticSemaphore_t xMutexBuffer; // allocate the memory
+ #define DEBUG_CONSOLE_CREATE_MUTEX_SEMAPHORE(mutex) ((mutex) = xSemaphoreCreateMutexStatic(&xMutexBuffer))
The project will compile but when I run it in debug it hangs in the SerialManager_Write() function in serial_manager.c in the while-loop on line 660.
if (kSerialManager_TransmissionBlocking == mode)
{
while (serialWriteHandle->transfer.length > serialWriteHandle->transfer.soFar)
{
#if defined(__GIC_PRIO_BITS)
if ((__get_CPSR() & CPSR_M_Msk) == 0x13)
#else
if (__get_IPSR() != 0U) // This is never not zero
#endif
{
SerialManager_IsrFunction(handle);
}
}
}
return kStatus_SerialManager_Success;
I see that this happens because it is using kSerialManager_TransmissionBlocking mode. Should I be able to do a blocking write even though the serial manager is configured for non-blocking?
L.M.