- 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
- 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 withmbed-os 6.13.0
, but we will use the latest version, which ismbed-os 6.15.1
. It's recommended to set up a shared instance of Mbed OSv6.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.
- 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
- Give the program a name, e.g.,
- 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
-
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-os
library 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
- Development board: B-L072Z-LRWAN1
- B-L072Z-LRWAN1 = STM32L0 Discovery kit LoRa, Sigfox, low-power wireless
- Microcontroller: STM32L072CZ
- Board datasheet
- Microcontroller datasheet
- Board pinout
- Docs: os.mbed.com/docs
- make sure you have selected the documentation for v6.15
- API