This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Serial port communication in WinCE 6.0 R3/OMAP3530/BSP6.15

Hello,

Would anyone please help me point out what I am missing here because I could not get COM1 and COM2 to work with a test application but only in XLDR.  Below are what I did:

-

- Setup pin-mux for UART1 and UART2 in platform.c

- Enable the clock for UART1 and UART2 in platform.c as followings:

OMAP_PRCM_CORE_CM_REGS* pPrcmCoreCM = OALPAtoUA(OMAP_PRCM_CORE_CM_REGS_PA);

SETREG32(&pPrcmCoreCM->CM_FCLKEN1_CORE, CM_CLKEN_MCSPI3|CM_CLKEN_UART2|CM_CLKEN_UART1); 

SETREG32(&pPrcmCoreCM->CM_ICLKEN1_CORE, CM_CLKEN_MCSPI3|CM_CLKEN_UART2|CM_CLKEN_UART1);

- Add functions in file serial.c to read and write data from/to UART1 and UART2 in the same way as for UART3

- Reading and writing of both COM ports work with the modified XLDR

- Remove the added functions

- Create a sub-project with code from  Adeneo testSerial.c and also from another posting in this Forum.

- Can not send anything to Hyperterminal or read anything from Hyperterminal

I appreciate your advice very much,

Luan

  • Can you explain exactly what scenario you are trying to achieve by implementing serial communication in XLDR?

    You need to know that XLDR has a limited size of 128 KB and the default XLDR delivered with the BSP almost reaches this limit. Adding some functions for handling serial communication will most likely result in a XLDR file that is too big (easy to figure out, look inside your flat release directory, if you see XLDRNAND.nb1 then you went too far). If you really need to implement some sort of serial communication in the bootloader, I suggest you implement them in EBOOT which has a lot more space allocated.

  • Hi Adeneo Embedded support team,

    I added 4 functions to the files serial.c.  They are identical to the existing functions (without '2' at the end of the function name) except that I have an input parameter I use to pass in the value for UART1 or UART2.  The prototypes are as shown below:

    BOOL OEMDebugInit2(UINT8 port);
    VOID OEMWriteDebugByte2(UINT8 port, UINT8 ch);
    INT OEMReadDebugByte2(UINT8 port, UINT8 ch);
    VOID OEMWriteDebugString2(UINT8 port, UINT16 *string);

    I am not sure if serial.c is linked to the XLDR or EBOOT.  I do not get XLDRNAND.nb1 as you mentioned above.

    I comments out some UART3 debug outputs in XLDR main.c to have more space.  I tested UART1 and UART2 reading/writing by calling these added functions from

    XLDR main.c and they work.  However, they do not work with my test app.

     

    I have also built my OS with the ARM A8 Unified BSP 1.0.  Just selecting UART1 and UART2 from the catalog and using the same test app, both serial ports work fine.

    I am still using BSP6.15 because I still could not get the touchscreen to work.  I have asked for help in another post.  At this time, I need to get BSP6.15 to work with UART1 and UART2 so that my guys can work on the application while I am debugging the touchscreen issue.

    Thanks very much for your help,

    Luan

  • Luan,

    Are UART1 and UART2 enabled in ti_evm_3530.bat file?

    thanks,

    Tao

  • Hi Tao,

    Yes, both are enabled as below:

    set BSP_NOCOM=
    set BSP_NOCOM1=
    set BSP_NOCOM2=

    I confirmed that uart.dll is included in NK.bin.

    Thanks,

    Luan

     

     

  • One last thing you can check to make sure your UART drivers are correctly loaded is to verify that your registry contains the following keys:

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart1]
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart2]

    You can connect with the remote registry editor or open your nk.bin from Platform Builder to find out. If the registry is ok, then your drivers are probably loaded at startup and the testserial app should work. When it fails, can you detail exactly what is the failing step and what error messgae you get?

     

  • Hi Adeneo Embedded support team,

    I have confirmed that the registry on my device contains

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart1]
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart2]

    I do not see any error during testing - just nothing happens for both reading and writing.

    I tried to remove (not add) some code that I put in the XLDR to turn on the backlight at power on and that caused the XLDR to hang.  I am not sure why;  may be it has something to do with the size of the XLDR as you mentioned in the previous post; may be the UART pins are not configured correctly.

    Would you or someone at TI please give me a recipe on how to enlarge the XLDR space for the BSP6.15?

    Thanks,

    Luan