Basic Mbed OS MQTT example.
The following boards are required:
This app makes use of the following libraries:
-
Open VS Code IDE.
-
Clone the repository directly in a Dev Container, in the desited volume:
Dev Containers: Clone Repository in Named Container Volume
Important
Cloning to a container volume in WSL increases massively the performance.
-
Clone the project:
git clone https://gitlab.com/catie_estia-students/mbed-os-basic-template.git YOUR_PROJECT_NAME cd YOUR_PROJECT_NAME
-
Open the project in VS Code IDE:
cd YOUR_PROJECT_NAME code .
-
Launch the Dev Container:
Dev Containers: Reopen in Container
-
In a VS Code terminal, export the project:
mbed export -i vscode_gcc_arm
Edit main.cpp
to set your GROUP_NAME
.
The group name is used to select the topics to which the device will subscribe and publish.
Compile the project:
mbed compile
Program the target device (eg. STM32L4A6RG
for the Zest_Core_STM32L4A6RG) with a J-Link
debug probe:
python dist/program.py STM32L4A6RG BUILD/ZEST_CORE_STM32L4A6RG/GCC_ARM/basic-mqtt-example.elf
-
Compile the project:
mbed deploy # Deploy the dependencies mbed compile
-
Program the target device with the compiled binary using a J-Link debug probe:
sixtron_flash
Modify the remote URL to point to your repository and push the source code:
git remote set-url origin YOUR_REPOSITORY_URL
git push -u origin main