faill to init shell, implementing shell into an application

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

faill to init shell, implementing shell into an application

Jump to solution
1,156 Views
claudecdg66
Contributor II

Hello,

I've started a project from an example(lpi2c_pooling) and i want to add a shell structure to it. However the init of the shell crash when it come to those lines

status = SerialManager_OpenReadHandle(shellContextHandle->serialHandle, shellContextHandle->serialReadHandle);
    assert(kStatus_SerialManager_Success == status);

SerialManager_OpenReadHandle return with that its busy cause the function can't turn off DisableGlobalIRQ().

what could be the problem here?

Also don't tell me to try the example code first, i did but now i need to integrate it into my application.

I joined the code so you can help me debug it.  im using the eval kit for the i.mx rt 1010 processor.

Labels (1)
Tags (1)
1 Solution
1,066 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Claude,

Hope you are doing well.

I'd recommend to grab the hello world example and using the BOARD_InitDebugConsole(); function as reference to initialize what you'd like to work with. Once you have it working in this example you may merge them together with your custom application.This function uses the SerialManager_OpenReadHandle and you may see how it is used.In addition if you would like to understand the API here is the link for more details on the functions and returned status.

MCUXpresso SDK API Reference Manual: Serial Manager 

Also check what is returned. The reading handle can not be opened multiple at the same time. The error code kStatus_SerialManager_Busy would be returned when the previous reading handle is not closed. And there can only be one buffer for receiving for the reading handle at the same time.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

View solution in original post

3 Replies
1,067 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Claude,

Hope you are doing well.

I'd recommend to grab the hello world example and using the BOARD_InitDebugConsole(); function as reference to initialize what you'd like to work with. Once you have it working in this example you may merge them together with your custom application.This function uses the SerialManager_OpenReadHandle and you may see how it is used.In addition if you would like to understand the API here is the link for more details on the functions and returned status.

MCUXpresso SDK API Reference Manual: Serial Manager 

Also check what is returned. The reading handle can not be opened multiple at the same time. The error code kStatus_SerialManager_Busy would be returned when the previous reading handle is not closed. And there can only be one buffer for receiving for the reading handle at the same time.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

1,066 Views
claudecdg66
Contributor II

I founded the problem

/*!@ brief Whether enable the RX function
 * If the macro is zero, the receive function of the debug console is disabled.
 */
#ifndef DEBUG_CONSOLE_RX_ENABLE
#define DEBUG_CONSOLE_RX_ENABLE (0U)
#endif /* DEBUG_CONSOLE_RX_ENABLE */

DEBUG_CONSOLE_RX_ENABLE was at 1 while in the example it was to 0 not the code work.

0 Kudos
1,066 Views
claudecdg66
Contributor II

That's interesting but witch other handle is blocking the api i didn't add one and the rest of the code is exactly like the example. i even used beyond compare to be sure.

0 Kudos