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.

Reading and writing OMAP35x registers from Windows CE 6 driver

Other Parts Discussed in Thread: OMAP3503

Hi,

 

I wrote a simple kernel mode driver for reading and writing registers on the OMAP3503/3530 processors.  It was needed because our BSP does not provide a driver for the WDT2 watchdog timer and I also use it to enable some of the GPIO pins we use (need to switch them from safe mode to mux mode 4).  It is a stream driver and reading and writing is done through DeviceIoControl() calls.

 

It works fine for reading and writing some registers and not for others.  For example, I can read and write the CONTROL_PADCONF_CAM_D5 (0x48002120) and GPIO_DATAOUT for GPIO4 (0x4905403C) registers that deal with GPIO.

 

I cannot read or write the WSPR register for WDT2.  I need to write a sequence of values to this register in order to enable the watchdog.

 

Here are the important calls in the driver:

 

// Map physical address to virtual address

DWORD *reg = (DWORD*)MmMapIoSpace(regPhysicalAddress, sizeof(DWORD), FALSE);

 

// Read register using CEDDK macro

ULONG regValue = READ_REGISTER_ULONG(reg);

 

The READ_REGISTER_ULONG call throws an exception for the WDT2 registers and some others that I tried but always works for GPIO-related registers.  I can confirm that it works by looking at the GPIO lines with an oscilloscope.  I also tried using BusTransBusAddrToVirtual() instead of MmMapIoSpace() but it returns the same virtual addresses and the same results.

 

Is there some security reason for why I seemingly do not have access to the WDT2 registers?  And what do I need to fix/do in order to get access to them?

 

Thanks,
Ben

 

  • You might want to check if the clocks are enabled for WDT2.  The registers are CM_FCLKEN_WKUP (0x48004C00) bit 5 for the functional clock and CM_ICLKEN_WKUP (0x48004C10) bit 5 for the interface clock.

    Steve K.

  • Thanks Steve.  I checked the clocks using both my bootloader and my Windows driver and the interface clock was enabled in both cases while the functional clock was disabled in both cases.

    However, I am able to enable the watchdog by writing the registers from my bootloader, suggesting that the watchdog's functional clock being disabled is not the problem.  For reference, here are the register values I read using my driver:

    CM_FCLKEN_WKUP = 0x000002C9 from within Windows

    CM_ICLKEN_WKUP  = 0x0000021F from within Windows

    Ben