Open colibri PXA's COM5 with windowsCE6

Hi all,

I am doing some developement with a colibri PXA310 running windows CE6.

I want to open the com 5 to conect with a modem on rasmode so the DTR have to be open.
The problem appeares when the program is running the com isn’t open. So, anybody know how to do this in this system ?
To be more clear, i’m using toradex library to open and configure gpios. i try to do it with gpiolib.
any code to be more specific, this is what i’m doing to open gpio’s but it does not workin…

//////////code////////////
GPIOHelper.ResetPinOutput(SODIMM_UARTA_DTR);          
GPIOHelper.ResetPinOutput(SODIMM_UARTA_RTS);          
GPIOHelper.ResetPinOutput(SODIMM_UARTA_DSR);          
GPIOHelper.ResetPinOutput(SODIMM_UARTA_TXD);         

GPIOHelper.DeInit();

//////////////

public static bool ResetPinOutput(Int32 pinNum)
{
    return SetPinLevel(pinNum, false);
}
//////////////

any help will be apreciated.

Thanks a lot in advance.

Dear @Kernel01

You also need to define the alternate function and input/output direction for each pin. I suggest you extend your ResetPinOutput() function:

public static bool ResetPinOutput(Int32 pinNum)
{
    bool fSuccess = TRUE;
    fSuccess &= SetPinLevel(pinNum, false);
    fSuccess &= SetPinAltFn(pinNum, -1 , DIR_OUT); // Configure pin to GPIO Output
    return fSuccess;
}

Please note that the UART driver might modify this pin configurations upon opening and closing the port.


Side Note : Are you aware that the Colibri PXA310 will be discontinued soon? Please refer to the following Product Change Notification:

Regards, Andy

Thanks @andy.tx for your answer.

in my case i put SetPinAltFn(pinNum, -1 , DIR_OUT);, but inside the function SetPinLevel(pinNum, false);

protected static bool SetPinLevel(Int32 pinNum, bool bLevel)
{
    bool bRes = false;
    if WindowsCE
         InitGPIOLib();
    endif
    m_bInit = true;

    if (m_bInit)
    {
        if WindowsCE
            if (SetPinAltFn(pinNum, GPIO_FN, DIR_OUT))
            {
                bRes = SetPinLevel(pinNum, bLevel ? 1 : 0);
            }
        endif
    }
    return bRes;
}

but still this i can’t open the gpio
do you know why this happens?

Regards, Kernel01.

Dear @Kernel01

[ I reformatted your previous message for better understanding. Please do a quick check whether I didn’t mess it up, and complain if I did ]

I don’t see any obvious mistake. I recommend you start the GpioConfig Tool , step through your code and verify line by line that it behaves as expected.
For a first test, you can also use the GpioConfig Tool to set up the pin configurations without code.

Regards, Andy

Hi @andy.tx ,

Is it posible the colibri don’t open the serial port because i have the debug traces activated?
I read in some documentation about this but i am not sure if this is applicable in my system.

I have activated all level traces to debug my application.
Anybody know something about that?

Thanks

Dear @Kernel01
Activating debug messages only blocks COM1, it has no effect on COM5,
Regards, Andy