PicoMod6 + API function SetupComm()

  • Hello,
    I am using a PicoMod6 with WinCE.
    Actually I am trying to change some parameters of a serial port. I would like to change the buffer size via the API function SetupComm().
    But the function fails and I got system error code 50 = ERR_NOT_SUPPORTED.
    In Msdn is written that some devices may not support this function.


    Does the PicoMod support this function in principle?
    Or is there an other way to change the buffer sizes of the serial port? ?(


    Kind regards,
    Melanie

  • Hello,
    according your describtion the function seem really not to be implemeted. But do you really need a larger SW buffer? As far as i remenber the default buffer size is 2048! Use ClearCommError to get occupied size.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    tanks for your answer.


    If I could use a larger buffer it would be a solution for my problem.
    Actually I don't know an other way to handle my problem...


    I already used ClearCommError(). The return value was 0x02 == CE_OVERRUN (A character-buffer overrun has occurred. The next character is lost.)


    Can you tell if there are any other API-functions or registry-settings which can influence the serial-port positively?



    Kind regards,
    Melanie

  • Hello,

    Quote

    The return value was 0x02 == CE_OVERRUN

    This indicates HW buffer overrun not a SW buffer overrun (CE_RXOVER). Note SW buffer is 2048 bytes and you will see the actuell usage by evalute LPCOMSTAT::cbInQue.
    Try to increase the priority of the driver (HKLM\Drivers\BuiltIn\<drivername>\Priority256=DWORD<newprio>) and/or calling thread (by CeSetThreadPrioritiy()).


    PS: set also HKLM\Drivers\BuiltIn\<drivername>\Watermarker=DWORD:1, than the Interrupt in the IST occurs when the first byte is in the HW buffer (default is 8).

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited 3 times, last by fs-support_ZU ().

  • Hello,


    I tried both registry settings and Priority256 seems to be the solution for me.
    Can you tell me what the default priorities of the serial drivers are?
    That would be very helpful.


    Kind regards,
    Melle

  • Hello,
    serial drivers thread priority is in general about158. I would not use values < 101, default for watch dog is 100.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    no, we have no list. It denpends on the application which threads/drivers may be favored and after adjust a special priorities you should test your SW again. I don't know why priorty is not 103, it is set in the MS code! But i think there is not special reason.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.