2016-10-13 03:24 AM
Hi everybody
I have read something about GPIOx_LCKR register in RM0008 page 173-174. Those pages are about pin lock configuration in STM32f0xx. As you know when we lock a pin, it's state should not be changed by configuring as high or low in pushpull. but my codes can't achieve that goal. Can you tell me what the problem is? int main(void) { HAL_GPIO_LockPin(GPIOD,GPIO_PIN_7); while (1) { HAL_GPIO_TogglePin(GPIOD,GPIO_PIN_7); HAL_Delay(200); } } ///////////////////////////////////////////////////// int main() { uint32_t tmp = 0x00010000; tmp |= 0x00000080; // Set LCKK bit GPIOD->LCKR = tmp; // Reset LCKK bit GPIOD->LCKR = 0x00000080; // Set LCKK bit GPIOD->LCKR = tmp; // Read LCKK bit tmp = GPIOD->LCKR; // Read LCKK bit tmp = GPIOD->LCKR; while(1) { GPIOD->BSRR &= ~0x00000080; GPIOD->BSRR |= 0x00000080; delay(1000000); GPIOD->BSRR &= ~0x00800000; GPIOD->BSRR |= 0x00800000; delay(1000000); } } ////////////////////////////////////////////////// at above codes LED PD.7 keeps blinking.2016-10-31 06:01 AM
Hi shafeeshad.mehdi,
Based on and (STM32F0 reference manuals), the locking mechanism is available only for ports A and B (not port D).-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.