Menu

rs232 serial driver for embedded systems

ldesp
2012-12-06
2012-12-13
  • ldesp

    ldesp - 2012-12-06

    this topic addresses questions relative to the integration of the RS232 serial driver in embedded systems with constrained resources (cpu several hundreds of Mips, memory several tenth of Mbytes)

     
  • ldesp

    ldesp - 2012-12-06

    Hi,

    Some parameters have impact on CPU load and memory size.
    How have you chosen the values defined in com_coronis_sdk_domain\generic_constants.h and the value of MAX_LISTENER_THREADS
    Kinds regards

    Lydie

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2012-12-13

    Reply of previous response of vmacari

    Hello Lydie
    The parameter MAX_LISTENER_THREADS does not mean that all the time the driver will create and use a MAX_LISTENER_THREADS of thread. This is the maximal number of threads that will be created to call your Listener call back events. After your user code will exit from callback, the thread will be removed.
    In case if your code does not exit from callback handlers (for any reason) and the number of active threads will reach MAX_LISTENER_THREADS, then any future events (like frame reception) will be ignored, and the user code will not receive notifications.

     

    Last edit: Thierry CHOMAUD 2012-12-13
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2012-12-13

    Reply of previous response of vmacari

    You can view in Log file the status of this thread's pool:
    DEBUG Pool is 0% full
    If this pool is 100% full, then something is wrong in the code.

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2012-12-13

    Lydie,

    Here are the comments that have been added to constants MAX_DRIVER_NUM and MAX_PROTOCOL_NUM in generic_constants.h. Moreover in the preparing package the max number have been reduced from 32 to 5.

    // Maximum number of serial port connection for each serial driver library
    // This value could be adapted if the system need a known number of SerialDriver instance

    define MAX_DRIVER_NUM 5

    // Maximum number of protocol instances for each protocol library
    // This value could be adapted if the system need a known number of Protocol instance

    define MAX_PROTOCOL_NUM 5

    Si of course you can reduce this value to the number of connection you expect to manage.
    Concerning the MAX_SPY_NUM, the memory impact is minimal. But this parameter is used only for spy listener feature. So it could be reduced also.

     

Log in to post a comment.

MongoDB Logo MongoDB