Remember to choose ST-Link as the debugger. To flash the program, you will need to create a Run configuration as shown here It will generate binary file that can be loaded on the STM32. To build your program, click Project > Build Project. HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, 0) // otherwise, turn off led HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, 1) // turn on led If (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) = 1) // button pressed What it does is to check whether the button is pressed and turn on the LED, so that we know it is working properly. You can see available I/O pins of the chip graphically which is quite convenient Adding codeĪdd the following code to main.c in the main loop. Click Save and Yes when it asks you to generate code automatically. Next, open Device Configuration Tool and configure PB13 as output port, PC13 as input port. In the target selector, you need to choose the target chip STM32L433RCT6P then click Next. The first step is to create a new project with STM32CubeIDE. If button is not pressed, we will read value of 0. If button is pressed, we will get 1 when reading the PC13 pin. The button is connected to I/O pin PC13.The LED is connected to I/O pin PB13 and active high, which means writing 1 to PB13 will make the LED turn on and writing 0 to the pin will turn the LED off.In this project, we will use the LED and button available on the board to do the testing. Now to test if everything is working properly and the computer can recognise the board, we will build a simple project to test it out. Running your first programs using STM32CubeIDE There are header pins exposed on two sides of the board that allow us to access the microcontroller’s I/Os. There’s 1 user LED which we could use to test a simple blinky program. The board has 1 user button and 1 reset button, which could be useful to reset the chip to start your program over. What we are interested in is the block diagram of the board which can be found in its User Manual and is shown in the below imageĪs can be seen from the image, the development board is divided into two sections: one with ST Link interface, the other one contains the microcontroller and circuits to access its pins. From there, you can also find necessary documentations about the board. STM32CubeIDE makes it easy to see board information in Target Selection dialog. When installing STM32CubeIDE, you will also install the ST Link driver that is necessary to communicate with the board. The board STM32 Nucleo-64 L433RC-P includes the chip STM32L433RCT6P and integrates ST Link programmer/debugger so you don’t need external programmer to flash program onto the chip. If you are using STM32CubeIDE, you can see these information displayed when you select the target chip, as shown below Board components This microcontroller has the following features: We will take a close look at STM32 Nucleo-64 L433RC-P as shown below MicrocontrollerĪt the heart of the board is the microcontroller STM32L433RCT6P in a 64-pin LQFP package. There are different variants of STM32 Nucleo-64 boards, for example This post is a prepration step for exploring future projects with LC33RC-P board. In this post, we will examine the STM32 Nucleo-64 development board L433RC-P, understand its components and pinouts and build a sample project with STM32CubeIDE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |