How to use MapMem WinCE library on Colibri Vybrid VF61?

Hi all.
I should read OCOTP_CFG0 register of Vybrid VF61.
Address is 0x400A5410 according “VFxxx Controller Reference Manual” from NXP site.
This code doesn’t work and Colibri freezes:

DWORD ISOinChip::getUniqueId() {
    DWORD result;
    DWORD *reg;
    HANDLE handle;

    handle = Map_Init();
    reg = (DWORD *)Map_MapMemory((DWORD)0x400A5410, 4);
    result = *reg;

    return result;

May be somebody knows how correctly get a value of phisical register?


You have to enable clock of OCOTP module.
You can do this using this sample code:

clk = (DWORD *)Map_MapMemory((DWORD)0x4006B058,4);
result = *clk;
result |= ((1 << 11) | (1 << 10));
*clk = result;

Before accessing registers of OCOTP module.

It works!
Thanks a lot!