iMXRT1024 - Seperate Debug Console and shell

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

iMXRT1024 - Seperate Debug Console and shell

531 Views
GUnderdown
Contributor III

Hi

 

I would like to have the debug console put on USART1, and a true shell put on USART6. This way we can have debug messages printed over a clean port, and then have customers interact with the shell as a backup to setting information over the network/usb.

 

However, whenever I go to initialize the shell, the code asserts during

 shell_status_t SHELL_Init(shell_handle_t shellHandle, serial_handle_t serialHandle, char *prompt)`

 

Specifically, it asserts after

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

  status here is "kStatus_SerialManager_Busy"

 

I have tried this with both non-blocking transfers as well as blocking transfers.

 

Here is my side of the init code

s_shellHandle = &s_shellHandleBuffer[0];

	char * stringthingy = new char[16];	// should be enough for "shell@12345 #\0"

	// this is what will be printed before
	// the prompt
	// like user@computer $ or user@computer#
	// we will make it shell@serialNum #
	sprintf(stringthingy, "shell@%05u #", (unsigned int)GlobalHardware->GetHWInfo().hardwareSerialNum);

    SHELL_Init(s_shellHandle, g_serialHandle, stringthingy);
// never gets beyone here
    SHELL_RegisterCommand(s_shellHandle, SHELL_COMMAND(viewEthernet));
    SHELL_RegisterCommand(s_shellHandle, SHELL_COMMAND(viewSoftware));
    SHELL_RegisterCommand(s_shellHandle, SHELL_COMMAND(viewHardware));
    SHELL_RegisterCommand(s_shellHandle, SHELL_COMMAND(setHardware));
    SHELL_RegisterCommand(s_shellHandle, SHELL_COMMAND(setEthernet));

    //SHELL_Task(s_shellHandle);
}

 

Here is the defines I pass in (as previously stated, have also tried with DEBUG_CONSOLE_TRANSFER_NON_BLOCKING)

GUnderdown_0-1700076015001.png

 

Labels (1)
Tags (2)
0 Kudos
Reply
3 Replies

481 Views
GUnderdown
Contributor III

I guess my biggest question is how do I tell the shell to print to USART6 instead of usart1?

 

0 Kudos
Reply

368 Views
GUnderdown
Contributor III

@Kan_Li 

How would I set it up to select the USART that the shell prints on? I want to have the shell on USART6, not semihost or USART1 (which is the default)

0 Kudos
Reply

487 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @GUnderdown ,

 

I have tried with the similar code on my board, but it works well.

Kan_Li_0-1701064010131.png

 

I tested it based on the Shell demo with RT1024EVK, and debug console on semihost. Have you tried  with the same ?

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply