#define WKUP_PADCONFIG 50 #define M4_PINMUX_VALUE(_rxActive, _pullType, _pull, _mux) ((_rxActive << 18) | (_pullType << 17) | (_pull << 16) | (_mux << 0)) #define M4_WKUP_PADCONFIG 0x4301C000 #define M4_RX_ACTIVE 1 #define M4_RX_INACTIVE 0 #define M4_PULL_DOWN 0 #define M4_PULL_UP 1 #define M4_PULL_ENABLED 0 #define M4_PULL_DISABLED 1 #define M4_MUX_MODE_0 0x0 #define M4_MUX_MODE_1 0x1 #define M4_MUX_MODE_7 0x7 // ---> MUX MODE 7 to configure the PIN as GPIO volatile uint32_t *LOCK7_KICK0 = (uint32_t *) 0x4301d008; uint32_t * padconfig = (uint32_t *) M4_WKUP_PADCONFIG; volatile uint32_t * dir01 = (uint32_t *) 0x42110010; volatile uint32_t * outData01 = (uint32_t *) 0x42110014; inside the function { //unlock ctrl mmr LOCK7_KICK0[0] = 0x68EF3490; LOCK7_KICK0[1] = 0xD172BC5A; // configure GPIO pad, write to ctrl mmr padconfig[WKUP_PADCONFIG] = M4_PINMUX_VALUE(M4_RX_INACTIVE, M4_PULL_UP, M4_PULL_DISABLED, M4_MUX_MODE_7); // set as output *dir01 &= 0xffff0000; // drive low *outData01 &= 0xffff0000; //Delay (You could use your own way to add delay) appLogWaitMsecs(1000); // drive high *outData01 |= 0x0000ffff; }