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.

How to write a value to the Omap???

Other Parts Discussed in Thread: OMAPL138

Hello

 

Am working with the omapL138 with win ce as the os. and i want to know how to write a value to the omapL138 and i want to read the value from the board . for example i know what value i want to write and to which register,,

but i dont know the syntax for writing and reading the register.  can any body tell me the steps for this it will be helpful for me.


Vinoth.

  • Vinoth,

    We are having difficulty trying to understand your question. Given some of your other recent issues, I sense that perhaps our forums may not be the most productive way to provide you with the assistance you're seeking. I'd like to have somebody from our field support team work directly with you to help you out. Please provide your region so I can help you connect with the right person.

    Gary

  •  

    Hello

    I have a few questions. I have bought the omapl138 devkit fro to get accustomed to windows CE on omapl138. I want to use the header pins given to connect LCD panel as GPIO pins.

    1. Having gone through the documentation and pinmux utility I have found out that I would have to modify the values of the registers for pinmux to enable this change.I have also gone through the gpio test routine which can be run at the bootloader level .I want to modify the gpio test routine so that I can have a gpio test which will toggle the voltage at any pin on the header file. 
    2. My actual goal is to write a routine and build an app so that I can do the similar toggling thing from within the operating system (WIN CE).
    • As far as I have learned I feel one needs to write to a register address in the omapl138 to toggle a pin to high or low.Can you please let me know if there is any routine or documentation available which can help me get my task.

    It would be great if you can guide me in modifying the existing file.

    Am from india(chennai)

     


    Regards

    Vinoth

  • Vinoth,

    Please contact Tony Francis: tonyf@ti.com +91-22-67102200

    Regards, Gary

  • Hello Gary

     

    Thanks for the information that you provided  i ll be in touch with that person whom you suggested.

     

    Regards

    Vinoth.

  • Hello Gary

     

    The person whom you referred is not know abt the win ce., Am posting my issue can you help me to solve this issue out.

    Can you suggest or find me a support person to help out with my issues that am facing.the following things are which i tried so far,

     We were able to find few examples in the design kit and followed it for our example. We had some linking issues too, but once we pointed to the right library, link also went through. It looks like we have to use the HalTranslateBusAddress command in conjunction with the MmMapIoSpace command as per the MSDN guidelines. We saw an example and tried the following:

     

        HalTranslateBusAddress(Internal,0, PortAddress,&inIoSpace,&PortAddress);
        m_pUPPRegs = (OMAPL13X_UPP_REGS*)MmMapIoSpace(PortAddress, sizeof(OMAPL13X_UPP_REGS), FALSE);
        printf("value of virtual address base in hexal = 0x%X\n", m_pUPPRegs);
        printf("value of register in hexal = 0x%X\n", *(m_pUPPRegs));

    We have defined PortAddress as the base address for the UPP register section in the Omap L138 which is 0x01E16000. This register is read only and has the value 0x44231100. So we thought it would be a good exercise to just map this physical address to a virtual address and then read the value of the virtual address and check that we can get this 0x44231100. When we run the program, we get the virtual address as 0. Secondly, when we try to access the content of m_pUPPRegs, the execution crashes with the following coming on the display:



      48838 PID:6ce000a TID:6cf000a value of virtual address base in hexal = 0x0
      48838 PID:6ce000a TID:6cf000a Exception 'Data Abort' (4): Thread-Id=06cf000a(pth=8277c000), Proc-Id=06ce000a(pprc=82774d88) 'UPPTest.exe', VM-active=06ce000a(pprc=82774d88) 'UPPTest.exe'
      48839 PID:6ce000a TID:6cf000a PC=000119a8(UPPTest.exe+0x000019a8) RA=0001199c(UPPTest.exe+0x0000199c) SP=0002fd60, BVA=00000000

    We are not sure what exactly is the mistake here in the code since virtual address comes out as 0 and then when we try to pull out the content of the virtual address which should be equivalently the content of the UPP base address of 0x01E16000, the failure occurs.

    Can you please look into the code above and give your thoughts?

     Regards

     

    Vinoth

  • Hey Gary,

    We have been able to resolve the issue with some support from Microsoft and TI, bangalore support team. It took us time to understand the WINCE driver structure to figure out how to get access to physical registers on the OMAP L138.

     

    Thnx and regards

    Vinoth.

     

  • Gary -

    What was the end result / solution to this issue?  I'm also trying to get access to the OMAPL138 CPU registers, preferably from a simple user-space app.  I'm trying to write a DLL that wraps a call to MmMapIOSpace but it's returning NULL (GetLastError() = 87).  The call I'm making is MmMapIOSpace(0x01C14000, 400, 1).

    It seems like the BSP might include this kind of API but I haven't been able to find it.

    Any advice would be great.

     

    Thanks,

    Chris

     

  • Chris,

    Not sure which module's register you want to access.  You can try ioctl function calls from an application in user space to pass the register id/location and the value you want to write to the driver of the module.  

    One of the many such examples is the DeviceIoControl( ... WAVIOCTL_SET_INPUT_VOLUME ...) function call in the test app wavtest.cpp.  This function call eventually leads to the wavedev2 driver's TLV320AIC3106CodecConfig::SetInputVolume() which does a i2c write.  But if the register you want to write is mem mapped, you can access the register like those m_pMcASPRegs->XINTCTL in audio_mcasp.cpp of the same driver.

    WM

  • Hi Chris,

    As there is change in Windows CE 6.0 MEmory Architecture we will not be able to access registers from a User Application using MmMapIoSpace.

    You can add a test driver which is running in kernel mode. Add some custom IOCTL's to the test driver. From the application you can call those custom IOCTL's which will write / read to / from the registers.

    The following forum is best place to discuss this topic http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/threads?prof=required

    Thank You & Regards,

    GSR