STM32C011 unbale to configure nRST pin as GPIO
Hi everyone,
Recently started working on STM32C011J4M3 micro. I'm trying to set PF2-NRST pin as a GPIO. but when I configure it from cube MX as GPIO PIN always reamins in High state that is a 3.28v and i'm unable to toggle the pin or perform any other operation.
int main(void)
{
/* USER CODE BEGIN 1 */
// SET_BIT(FLASH->OPTR,FLASH_OPTR_NRST_MODE_1);
WRITE_REG(FLASH->OPTR,0x2UL << 027U); // Even tried stting nrst mode2.
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
HAL_GPIO_WritePin(GPIOF, GPIO_PIN_2, GPIO_PIN_RESET);
HAL_Delay(3000);
HAL_GPIO_WritePin(GPIOF, GPIO_PIN_2, GPIO_PIN_SET);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
can anyone help me with this,
do I need to add any push-up/pull down specifically to this pin to use as GPIO?
