MCUSEL write ignored

Code is on APP processor. It is in secure mode, verified using this method: https://community.arm.com/support-forums/f/architectures-and-processors-forum/13548/for-armv8-m-is-there-a-system-register-indicating-the-security-state-of-the-core

So i try to set a pin to peripheral mode, it is ignored...

	NRF_P1_S->PIN_CNF[8] = t = (NRF_P1_S->PIN_CNF[8] &~ (GPIO_PIN_CNF_MCUSEL_Msk | GPIO_PIN_CNF_PULL_Msk | GPIO_PIN_CNF_DRIVE_Msk | GPIO_PIN_CNF_INPUT_Msk | GPIO_PIN_CNF_DIR_Msk)) |
		(GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos) | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) |
		(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
	
	printf("CNF=0x%08x, wrote 0x%08x\n", NRF_P1_S->PIN_CNF[8], t);

result is 

CNF=0x00000003, wrote 0x30000003

Docs say that to write this, i need ot be in secure mode, which i am. my code is on the app processor, to which the pin is indeed assigned. what is going on?

Parents Reply Children
Related