Hot!Multiple Console Dynamic/ Multiple Uart Dynamic Example?

Author
bob3er4
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2007/08/28 10:07:46
  • Location: 0
  • Status: offline
2015/10/15 10:51:46 (permalink)
0

Multiple Console Dynamic/ Multiple Uart Dynamic Example?

First off: thanks to everyone for the support on the Harmony roll out!
 
Second: For those crying about harmony documentation:
Help Microchip support us. We are all on same team and want to get product out there and make money. I would prefer new/beta code and new(and more) code examples are released ASAP and that people understand that this is work in progress so we can all get to working together sooner. 
I would love a video of microchip showing us how the Console System Service and related Library is built out from current fixed DRV_USART_INDEX_0 version to the first dynamic version. Lots of voice over and discussion. This would be great so that we can understand what your developers thought processes are and be able to contribute or work with betas and provide support feedback. Luc's "Creating a TCP/IP Project from Scratch" was GREAT! 
 
XC32 1.40
MPLAB 3.10
Harmony 1.06 
PIC32MZ2048EFM144 w PHY_8740a on EF starter kit with off board TTL to RS232 ICs and 2221 bridge disabled.
 
This thread is about the Console System Service Library and DYNAMIC implementation with multiple Consoles and UARTS. 
(see System Service Libraries.pdf v1.06
Console Service Software Abstraction Block Diagram)
 
For CONTEXT:
I am trying to instantiate multiple Console System Services.
Using Harmony:
(2) Applications
(2) Usarts
(2) System Console Cores
(2) Command Processors
(1) File System
(1) Debug service
 
Application 1 uses Usart 1 and supports command processing of commands coming from Usart 1RX and responds on Usart 1TX. Usart 1 also contains debug data output.
Application 2 uses Usart 2 and supports INDEPENDENT command processing and response.
(Thus, I am looking for (2) or more Consoles that function independantly)
 
I will gladly provide testing on this if Microchip or anyone else is working on it. I do not understand Harmony architecture and Objective C/C++ enough to jump into developing Harmony: But I am willing to learn and try to support Microchip with some help.
 
Questions:
Can we(users and/or Microchip) modify "void Console_UART_Tasks (SYS_MODULE_OBJ object)" to support this?
When will the dynamic version of CONSOLE and related system services be available for beta?
Harmony documentation implies CONSOLE SERVICE will be DYNAMIC ...but the 1.06 implementation is hard coded to DRV_USART_INDEX_0:
 
            /* Open the device layer */
            consUartData.deviceHandle = DRV_USART_Open(DRV_USART_INDEX_0,
                    (DRV_IO_INTENT_READWRITE | DRV_IO_INTENT_NONBLOCKING));

 
SYS_MODULE_OBJ object is passed to Console_UART_Tasks Correct?
 
 
For those asking about my system_init.c:
    sysObj.drvUsart0 = DRV_USART_Initialize(DRV_USART_INDEX_0, (SYS_MODULE_INIT *)&drvUsart0InitData);
 
 
 
    sysObj.drvUsart1 = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT *)&drvUsart1InitData);

and...
    /* Initialize System Services */
    SYS_INT_Initialize();
    sysObj.sysConsole0 = SYS_CONSOLE_Initialize(SYS_CONSOLE_INDEX_0, (SYS_MODULE_INIT *)&consUsartInit0);
    sysObj.sysConsole1 = SYS_CONSOLE_Initialize(SYS_CONSOLE_INDEX_1, (SYS_MODULE_INIT *)&consUsartInit1);

    sysObj.sysDebug = SYS_DEBUG_Initialize(SYS_DEBUG_INDEX_0, (SYS_MODULE_INIT*)&debugInit);

 
 
I currently have a project running but all SYS_CONSOLE_PRINT are now duplicates on same UART.  
 
Comments seem to indicate multiple console dynamic implementation is coming
since the handle is passed to do that.
sys_command.c line 836
// ignore the console handle for now, we support a single system console
 
 
 
static void SendCommandMessage(const void* cmdIoParam, const char* message)
{
    int consoleIndex = 0;

    for (consoleIndex = 0; consoleIndex < SYS_CONSOLE_DEVICE_MAX_INSTANCES; ++consoleIndex)
    {
        SYS_CONSOLE_Write(consoleIndex, STDOUT_FILENO, message, strlen(message));
    }
}

 
 
post edited by bob3er4 - 2015/10/15 11:25:17
#1

7 Replies Related Threads

    MHGC
    Super Member
    • Total Posts : 205
    • Reward points : 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2015/10/20 10:13:51 (permalink)
    0
    Hi bob3er4,
     
    Thank you for your detailed and precise questions.  There had been plans for multiple console and command support at some point in the past.  But development was halted as our resources were prioritized for other development.
     
    The hardcoded-ness fo the UART console is really bad and we will look to fix that in a future release.
     
    I will do some investigation and see if something can be done.
     
    Thanks,
    Bill
    #2
    jkellar
    Super Member
    • Total Posts : 223
    • Reward points : 0
    • Joined: 2015/03/20 07:37:13
    • Location: 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2016/01/04 13:34:25 (permalink)
    0
    Any new news on directing the console to other UARTs? If its still hard coded to UART0 that's fine but can I hard code it myself to UART1 for instance? I've searched through the framework trying to find where the UART handle is obtained by the console but cannot locate it. Where is it in the file structure please?
    #3
    PICster80
    Junior Member
    • Total Posts : 93
    • Reward points : 0
    • Joined: 2014/09/15 08:43:00
    • Location: 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2016/01/05 10:06:39 (permalink)
    3 (1)
    Hi,
     
    In sys_console_usart.c under the function Console_UART_Tasks,
     

                consUartData.deviceHandle = DRV_USART_Open(DRV_USART_INDEX_0,
                        (DRV_IO_INTENT_READWRITE | DRV_IO_INTENT_NONBLOCKING));
     
                  //change this to DRV_USART_INDEX_1

     
    Thanks.

    Best Regards
    #4
    jkellar
    Super Member
    • Total Posts : 223
    • Reward points : 0
    • Joined: 2015/03/20 07:37:13
    • Location: 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2016/01/05 10:20:54 (permalink)
    0
    Thanks PICster80, I searched that file and never saw it, geez. I guess I was tired.
     
    I'll also mention just below that line in sys_console_usart.c the baudrate is set which may need to be revised as well depending on whether there are different baud rates set.
     
     
    /* Set the baud rate */
                DRV_USART_BaudSet(consUartData.deviceHandle, DRV_USART_BAUD_RATE_IDX1);

     
    Thanks again!
    #5
    Emcy
    Super Member
    • Total Posts : 541
    • Reward points : 0
    • Joined: 2008/01/09 03:37:06
    • Location: 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2018/04/16 06:02:40 (permalink)
    0
    Hi,
    bill.li The hardcoded-ness fo the UART console is really bad and we will look to fix that in a future release.

    There is always the same problem or Harmony has been updated ?
    I woulkd like to do USB/UART/Telnet console : it is the best way to use this library to do it ?
     
    post edited by Emcy - 2018/04/16 06:04:22
    #6
    jkellar
    Super Member
    • Total Posts : 223
    • Reward points : 0
    • Joined: 2015/03/20 07:37:13
    • Location: 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2018/04/16 06:28:55 (permalink)
    0
    I haven't worked with Harmony in several years now. I don't know if that has been resolved or not.
     
    If its still fixed in code, if you can find in Harmony where its being set, sys_console_usart.c, you can add features (routine or whatnot) to make the baudrate selection more flexible.
    #7
    Emcy
    Super Member
    • Total Posts : 541
    • Reward points : 0
    • Joined: 2008/01/09 03:37:06
    • Location: 0
    • Status: offline
    Re: Multiple Console Dynamic/ Multiple Uart Dynamic Example? 2018/04/16 08:25:50 (permalink)
    0
    ok, thanks
    #8
    Jump to:
    © 2018 APG vNext Commercial Version 4.5