Loading...
 
Skip to main content

System Workbench for STM32


PA0 Pin HIGH on STM32L0+

Hi,
I am not sure, if this forum is right place to post such questions, but me as a beginner in STM32 facing the following problem.
I have connected LED to PA0 pin in nucleo STM32L073RZ board.
This is a main.c code, which I compile and flash board:

  1. include "stm32l0xx_hal.h"


int main(void){
volatile uint32_t *GPIOA_MODER=0x0, *GPIOA_ODR=0x0;

GPIOA_MODER = (uint32_t*)0x50000000;
GPIOA_ODR = (uint32_t*)(0x50000000+0x14);

__HAL_RCC_GPIOA_CLK_ENABLE();

*GPIOA_MODER = *GPIOA_MODER | 0x1;
*GPIOA_ODR = *GPIOA_ODR | 0x1;
while(1);
}

Kindly advice , what I am doing wrong as LED doesn’t go HIGH.

BR