0% found this document useful (0 votes)
34 views20 pages

Esd Lab-1 Intro To Nucleo and Keil Studio

Uploaded by

Heshwar Lap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views20 pages

Esd Lab-1 Intro To Nucleo and Keil Studio

Uploaded by

Heshwar Lap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

BECE403E-Embedded System Design

Lab
LAB-1
Introduction to STM32
Nucleo-64 Board & arm Keil
Studio Cloud
INTRODUCTION TO STM32 NUCLEO-64
Nucleo Features
 STM32L152RE ultra-low-power ARM Cortex-M3 based
microcontroller
 Two extension connectors: Arduino Uno and ST Morpho
 Embedded ST –LINK/V2-1 Debugger/Programmer
 Flexible board power supply: 3.3 V, 5 V, 7 - 12 V
 User LED (LD2), Two push buttons: USER and RESET
 MBED Enabled
 Interfaces supported on USB: Virtual COM port, Debug
LAB - port, Mass storage (USB Disk
BECE403E-Embedded Systemsdrive)
Design for drag 'n’ drop 2
STM32 Nucleo-64 - Board Details

Image credit: Zephyr Ref. URL : https://docs.zephyrproject.org/latest/boards/arm/nucleo_l152re/doc/index.html

LAB - BECE403E-Embedded Systems Design 3


STM32 Nucleo-64 - Board Details

Image credit: Zephyr Ref. URL : https://docs.zephyrproject.org/latest/boards/arm/nucleo_l152re/doc/index.html

LAB - BECE403E-Embedded Systems Design 3


STM32 Nucleo-64 - Pin Details (Arduino Headers)

Image credit: arm MBED, Ref. URL : https://os.mbed.com/forum/electronics/topic/15346/?page=1#comment-52189

LAB - BECE403E-Embedded Systems Design 4


STM32 Nucleo-64 - Pin Details (Morpho Headers)

Pins Legend

Image credit: arm MBED, Ref. URL : https://os.mbed.com/forum/electronics/topic/15346/?page=1#comment-52189

LAB - BECE403E-Embedded Systems Design 4


STM32 Nucleo-64 - Pin Details (Morpho Headers)

LAB - BECE403E-Embedded Systems Design 4


INTRODUCTION TO STM32L152RE
STM32L152RE Microcontroller Features
 Package Type : LQFP64 (Low-profile Quad Flat Package)
 Instruction set Architecture : RISC (Reduced Instruction Set
Architecture)
 Data bus size : 32-bit
 Address bus size : 32-bit
 Operating Frequency : 32 MHz max
 Operating Voltage : 1.65 V to 3.6 V
 Program memory (flash) : 512 KB
 Data memory (SRAM) : 80 KB
 Data memory (EEPROM) : 16 KB
 Input/output ports : 51(Port A(16), B(16), C(16), D(1),H(2))
 Timers :9
 Interrupts : 56
 ADC modules (12-bit) : 21 channels
 PWM modules : 10
LAB
- Serial communication :BECE403E-Embedded
SPI(8), USART(5), I2C(2)
Systems 5
STM32L152RE - Architecture

STM32L152RE – Pin
diagram

LAB - BECE403E-Embedded Systems 6


INTRODUCTION TO Keil Studio IDE
 Keil Studio Cloud is the successor to the Mbed Online Compiler,
and allows you to develop Mbed 2, Mbed OS 5 and 6 projects on
supported Mbed-enabled boards.
 Free to use, browser-based IDE for the evaluation and
development of embedded, IoT, and Machine Learning software
for Cortex-M devices.
 You can compile projects using Arm Compiler 6, run the projects
directly on supported development boards, and debug from
supported browsers without the need to install any software.
 You can access Keil Studio Cloud using an Arm or Mbed account
(use below link) and get started by opening a reference design to
LAB - evaluate. BECE403E-Embedded Systems 1
BECE403E-Embedded Systems Design
Lab

LAB-1
Working with LED

LAB - BECE403E-Embedded Systems Design 7


LAB TASK-1
Blinking of LED on Board
Write a program to blink an on-board LED (LD2) of the STM32
Nucleo-64 board with 0.5s delay between ON and OFF state
using Keil Studio Cloud IDE.

LAB - BECE403E-Embedded Systems 8


ARM Keil Studio Could IDE Demo for Blink LED

LAB - BECE403E-Embedded Systems 1


INTRODUCTION TO Keil Studio IDE
 Procedure to create a mbed example project
1. Go to ARM Keil Studio (https://studio.keil.arm.com/auth/login/) and
log in
2. Select File → New → Mbed Project
3. Click the Example project drop-down list and select “mbed2-
example-blinky”
4. In Project name field, provide the name of the new project and click
Add project
5. Double click on the “main.cpp” file from the newly created project
folder
LAB - BECE403E-Embedded Systems 1
INTRODUCTION TO Keil Studio IDE
 Procedure (one-time) to connect Nucleo board to Keil
Studio Cloud IDE
1. In Side bar, under Build target drop-down list select “NUCLEO-

L152RE”

2. Then, click on the Connected device option to open the Device

Manager

3. Connect Nucleo Board to the computer using Micro USB Cable

4. Click Add Device button and select device firmware (STLink) and
LAB - BECE403E-Embedded Systems 1
LAB TASK-1
API required:
 DigitalOut Identifier(PinName) - Used configure GPIO pin as digital
output pin
- Identifier: User defined name to access this digital pin
- PinName: Name of the pin as specified in the Nucleo board pin
details
- Examples: DigitalOut myled(LED1); //LED1 is an onboard
LED
DigitalOut myA3(PC_0); //PC_0 is 0th pin of port C

 operator= (int value) - used to set the digital output as 0 or 1. A


shorthand for write() API.
- Example: myA3=1; //set the PC_0 digital output pin value as
HIGH or 1
LAB - BECE403E-Embedded Systems 8
LAB TASK-1
Program: Output:

LAB - BECE403E-Embedded Systems Design 10


LAB TASK-2

Blinking of 4 LEDs alternatively in pairs


Write a program to blink four LEDs in alternatively in pairs
(1010 and 0101 pattern) with 0.5 Sec delay between each.
Implement and verify this logic on the STM32 Nucleo-64 board
using Keil Studio Cloud IDE.

LAB - BECE403E-Embedded Systems 11


LAB TASK-1
Program: Connection
diagram:

LAB - BECE403E-Embedded Systems Design 10


THANK YOU

b y

ka
a

You might also like