Skip to content

sjkeller/ACPS-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with STM32 LoRa Board

Prerequisites

  • Git installed, see git_tutorial.md
  • Signed up in
    • GitLab
    • GitHub
  • SSH Key Setup (recommend but not mandatory), see generate_ssh_key.md
  • Cloned your group repository from GitLab

Setup

  • Download and install Mbed Studio Version 1.4.3
  • Notes:
    • When starting Mbed Studio for the first time, you are asked to to sign up (create a free account) on mbed.com to use the IDE.
    • Mbed Studio V1.4.3 comes with mbed-os 6.13.0, but we will use the latest version, which is mbed-os 6.15.1. It's recommended to set up a shared instance of Mbed OS v6.15.1 to save hard disk space, see the instructions below. You may skip this step and do it later, if you prefer to run the hello world program first.

Hello World

  • Start Mbed Studio
  • Connect your device
    • Wait a moment until Mbed Studio has auto-detected the platform
    • If it does not detect the device automatically, select Target: disco_l072cz_lrwan1
  • File -> Open Workspace -> Select the folder workspace in your repository
  • File -> New Program -> empty MBED OS program
    • Give the program a name, e.g., example-blinky
  • We have prepared a .mbedignore file that will save you some compilation time. Copy it into your program folder.
  • Here is the code for the blinky example. Copy and replace the content of main.cpp file:
#include "mbed.h"

// Blinking rate in milliseconds
#define BLINKING_RATE 1000ms 

// main() runs in its own thread in the OS
int main()
{
    // Initialize the digital pin LED1 as an output
    DigitalOut led(LED1);

    while (true) {        
        led = !led;
        ThisThread::sleep_for(BLINKING_RATE);
    }
}
  • Run the program (build and upload to board)
  • Expected Output: LED1 should Blink at 1 Hz

Shared instance of Mbed OS

  • Setting up a shared instance of Mbed OS that is used by across multiple programs will save space on your hard disk.

  • Step 1: Clone the Mbed OS repository from GitHub (using SSH):

      git clone git@github.com:ARMmbed/mbed-os.git
      cd mbed-os
      git fetch --tags
      git checkout mbed-os-6.15.1 -b my-mbed-os-6.15.1
    
    • If you prefer using HTTPS URL instead of SSH then the clone command is:

        git clone https://github.com/ARMmbed/mbed-os
      
  • Step 2: Whenever you create a new program you need to link/specify the location of the Mbed OS repository on your hard disk. Of course it is also possible to link/unlink the mbed-oslibrary at any time afterwards.

  • See also: shared-instance-of-mbed-os

Notes

  • If you don't use shared instances of Mbed OS, then by default Mbed Studio will create an instance of Mbed OS of the version, which Mbed Studio is shipped with.
  • see latest release

Technical references

MBed OS Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published