Skip to content
/ msut Public

Learning material and examples for course TK402 at FE Tuzla

Notifications You must be signed in to change notification settings

semir-t/msut

Repository files navigation

  • Github pages build

Microprocessor systems in telecommunications

Learning material and examples for course TK402 at FE Tuzla

Software requirements

For this course you need to have:

  • Linux operating system (Ubuntu),
  • Code editor (Geany,Vim,etc...)

Hardware requirements

For this course we will need following components:

Toolchain setup

  1. Install editor of your choice. We will be using Geany. To install geany run following commands in the terminal
sudo apt-get update
sudo apt-get install geany
  1. Open geany and go to the Edit->Preferences->Tools. Change the line
x-terminal-emulator -e "/bin/sh %c"

to

gnome-terminal -x "/bin/sh" %c

Save the changes and inside the terminal run the following command:

sudo apt-get install libvte-dev

After this, restart the geany and in the left bottom corner you should see the tab Terminal.

  1. Clone the GitHub repository.
  2. Copy the udev rules by executing following command
sudo cp docs/49-stlinkv2.rules /etc/udev/rules.d/
udevadm control --reload-rules && udevadm trigger
  1. Change the directory to examples/LAB01/blink-soft-circle/ and runk the following command
make

You should see following output:

arm-none-eabi-objcopy -O ihex main.elf main.hex
arm-none-eabi-objcopy -O binary main.elf main.bin
ls -l main.bin
-rwxrwxr-x 1 student student 3484 Nov 5 13:23 main.bin
  1. Install the Linux system libraries
sudo apt-get install build-essential git flex bison libgmp3-dev libmpfr-dev
sudo apt-get install libncurses5-dev libhidapi-hidraw0
sudo apt-get install libmpc-dev autoconf texinfo libtool libftdi-dev
sudo apt-get install libusb-1.0-0-dev zlib1g zlib1g-dev python-yaml
sudo apt-get install libc6-i386
  1. Connect you STM32 Disco board

  2. Run the following command

make upload

You should see following output:

      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.6.0
      -------------------------------------------------------------------

ST-LINK SN  : 066DFF505252836687075844
ST-LINK FW  : V2J37M26
Board       : STM32F4DISCOVERY
Voltage     : 2,90V
SWD freq    : 4000 KHz
Connect mode: Normal
Reset mode  : Software reset
Device ID   : 0x413
Revision ID : Rev Y
Device name : STM32F405xx/F407xx/F415xx/F417xx
Flash size  : 1 MBytes (default)
Device type : MCU
Device CPU  : Cortex-M4



Memory Programming ...
Opening and parsing file: main.bin
  File          : main.bin
  Size          : 3148 Bytes
  Address       : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:00.357
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.6.0
      -------------------------------------------------------------------

ST-LINK SN  : 066DFF505252836687075844
ST-LINK FW  : V2J37M26
Board       : STM32F4DISCOVERY
Voltage     : 2,90V
SWD freq    : 4000 KHz
Connect mode: Normal
Reset mode  : Software reset
Device ID   : 0x413
Revision ID : Rev Y
Device name : STM32F405xx/F407xx/F415xx/F417xx
Flash size  : 1 MBytes (default)
Device type : MCU
Device CPU  : Cortex-M4


Hard reset is performed

If you see following output instead of the above one, you need to performe firmware upgrade procedured described in the next section.

      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.6.0
      -------------------------------------------------------------------
Error: Old ST-LINK firmware version. Upgrade ST-LINK firmware
Error: Old ST-LINK firmware version. Upgrade ST-LINK firmware
Error: Old ST-LINK firmware! Please upgrade it.

Makefile:53:recipe for target 'upload' failed
make: *** [upload] Error 1
  1. You should see LEDs turning On and Off on your disco board.

  2. Install the picocom by running following command in terminal

sudo apt-get install picocom

ST-Link Firmware upgrade

  1. Connect you STM32 Disco board
  2. Change your current position to the stmcubeprog/bin folder
cd stmcubeprog/bin/
  1. Run the STMCubeProg by executing following command.
sudo ./STM32CubeProgrammer
  1. Click on the firmware upgrade button ST-Link firmware upgrade
  2. You should see following window. Click on the Open in update mode. ST-Link firmware upgrade
  3. You should be able to click on the Upgrade button. ST-Link firmware upgrade
  4. Wait for the upgrade procedure to finish. If the upgrade procedure was successfull you should see following output. ST-Link firmware upgrade
  5. You should be able now to successfully run command make upload from the terminal.

About

Learning material and examples for course TK402 at FE Tuzla

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published