Getting Started With STM32f767zi Cube IDE and Upload You Custom Sketch
by ANKL in Circuits > Microcontrollers
3429 Views, 3 Favorites, 0 Comments
Getting Started With STM32f767zi Cube IDE and Upload You Custom Sketch
BUY (click the test to buy/visit the web page)
SUPPORTED SOFTWARE
· EWARM IAR EMBEDDED WORKBENCH
There are various software available which can be used to program STM microcontrollers.
But some of then have limitations. STM32 Cube IDE is good when compared to others so today in this tutorial I am using Cube IDE to program the stm32microcontroller.
Each STM32 development board is preloaded with a demonstration sketch make sure you demonstration sketch works properly and then proceed with our tutorials.
- Install STM32 cube IDE
- program a simple led blink sketch
- program a demonstration sketch provided in the examples.(see my YouTube video)
Supplies
STM32CUBE IDE SOFTWARE INSTALLATION PROCEDURE
1. Launch the product
installer (STM32CUBEIDE.EXE).
2. During the installation process, the operating system may display a dialog stating: “Do you want to allow this app to make changes to your device?” with info “Verified publisher: STMicroelectronics Software AB”. Accept ([YES]) to let the installer continue.
3. Wait for the installer Welcome dialog to be displayed and click[Next>].
4. Read the license
agreement. Click [I Agree] to accept the terms of the agreement, or [Cancel] to abort the installation. If the agreement is accepted, the installation wizard continues.
5. In this dialog, the user selects the location for the installation. It is recommended to choose a short path to avoid facing Windows® limitations with too long paths for theworkspaceand click [next].
6. Wait for the Choose Components dialog to be displayed. Select the GDB Server components to be installed together with STM32CubeIDE. A server is needed for each type of JTAG probe used for debugging with STM32CubeIDE.
7. Click [Install] to start the installation. The drivers that were selected are installed in parallel with this installation of STM32CubeIDE from here on.
8. Click [Next] to continue to the final step of the installation process. That is a Confirmation dialog informing the user that the installation is finished. Once the user clicks [Finish], the installation process in complete.
STM32CUBE IDE PROGRAMMING PROCEDURE
- Software requirement: - cube IDE & ST utility link (latest version).
- Open cube ide software and choose the directory you want; I choose default location(1) and click launch (2).
- Click file (3)->new (4)->STM32 project (5).
- STM32 project window popup in that click board selector (6) and search the board (7) you want. In this case type select this board NUCLEO-F767ZI (8) and click next (9).
- Type project name (10) and select targeted language as C++(11).
- Click finish (12).
- Board project window popup, click yes (13) and Internet connection is required to download firmware for first time and if firmware is already downloaded another window popup (open associated perspective), click yes .
- In project workspace, click Pinout and configuration and select the required pins, for this demo I create ADC program so click analog (14) -> ADC1 (15) -> IN1 single ended (16) ->you can see that PA0 analog pin enabled (17)
- click device configuration tool code generator icon (18) to create main.c file.
- Open associate windows popups click yes (19).
- main.c file generated and to find the main.c file location by clicking the project name (20)->core (21)->src (22)->main.c (23).Edit the main.c file as required.
- click build icon (24) to check the program for errors and click debug icon (25) to upload the program to the STM32F767ZI board.
- In live expression add the variable you want to see, here adcval show the adc output (26).
LED Blink
Follow the above procedure and start a new project
see the images and add the following codes inside the main function
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0);
HAL_Delay(1000);<br>
here HAL_GPIO_Togglepin(GPIOx,GPIO_PIN);
where
GPIOx - x determines there port if you want to select port A it will be GPIOA
GPIO_PIN - determines the specific pin number of that port
int main(void){ /* USER CODE BEGIN 1 */
/* 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(); MX_ETH_Init(); MX_USART3_UART_Init(); MX_USB_OTG_FS_PCD_Init(); /* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop * /* USER CODE BEGIN WHILE */ uint32_t wait = 0;
while (1) { /* USER CODE END WHILE */ HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0);
HAL_Delay(1000); /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }
you final code should appear something like this.
if you are not getting output you can comment some unwanted functions like
MX_ETH_Init();