Skip to content

Apache Mynewt Sensor Network Application for STM32 Blue Pill and nRF52 with Visual Rust, NB-IoT, GPS, iBeacon, NimBLE, ESP8266 (WiFi Geolocation) and nRF24L01

License

Notifications You must be signed in to change notification settings

lupyuen/stm32bluepill-mynewt-sensor

This branch is 810 commits ahead of, 23 commits behind master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3c8af19 · Oct 3, 2019
Aug 10, 2019
Sep 30, 2019
Oct 1, 2019
Sep 27, 2019
Sep 21, 2019
Oct 3, 2019
Sep 14, 2019
Sep 20, 2019
Oct 1, 2019
Oct 3, 2019
Oct 1, 2019
Jul 24, 2019
Aug 13, 2019
Mar 19, 2019
Mar 18, 2019
Jul 28, 2019
Mar 18, 2019
Mar 18, 2019
Oct 3, 2019
Mar 26, 2019
Jul 23, 2019
Jul 23, 2019
Jul 23, 2019
Aug 16, 2019
Mar 19, 2019
Sep 5, 2019
Jun 1, 2019
Oct 1, 2019

Repository files navigation

iBeacon Sensor Application for nRF52 with Apache Mynewt and Embedded Rust

This nrf52 branch contains the source code for an iBeacon Sensor Application for nRF52 with Apache Mynewt and Embedded Rust that has been tested on the EBYTE E73-TBB Development Board. Refer to the tutorial...

Coding nRF52 with Rust and Apache Mynewt on Visual Studio Code

Fixes for Mynewt type conversion build warnings

These fixes should be applied manually when upgrading Mynewt or installing Mynewt from scratch.

1️⃣ repos/apache-mynewt-core/kernel/os/include/os/os_mutex.h line 122

    return mu->mu_level;

Change to

    return (os_error_t) mu->mu_level;

2️⃣ repos/apache-mynewt-core/hw/sensor/include/sensor/sensor.h line 847

    return (sensor->s_types & sensor->s_mask & type);

Change to

    return (sensor_type_t) (sensor->s_types & sensor->s_mask & type);

3️⃣ repos/apache-mynewt-core/encoding/tinycbor/include/tinycbor/cbor.h line 201

    {   return encoder->writer->bytes_written; }

Change to

    {   return (CborError) encoder->writer->bytes_written; }

Installation, Build, Flash and Debug Logs

Sample logs for Windows may be found in the logs folder

Contents

This repository contains...

rust: Rust Application

Cargo.toml: Rust Build Settings

.cargo: Rust Target Settings

my_sensor_app: Mynewt Application Stub

boot_stub: Mynewt Bootloader Stub

adc_stm32f1: Mynewt Driver for ADC on STM32 F103 (Blue Pill). Used by temp_stm32 internal temperature sensor.

adc_stm32l4: Mynewt Driver for ADC on STM32 L476. Used by temp_stm32 internal temperature sensor.

bc95g: Mynewt Driver for Quectel BC95 NB-IoT module

buffered_serial: Buffered Serial Library used by bc95g NB-IoT driver and gps_l70r GPS driver

custom_sensor: Custom Sensor Definitions for Raw Temperature and Geolocation

esp8266: Mynewt Driver for ESP8266 WiFi module

gps_l70r: Mynewt Driver for Quectel L70-R GPS module

hmac_prng: HMAC pseudorandom number generator with entropy based on internal temperature sensor

low_power: Low Power functions for STM32 F103 (Blue Pill)

mynewt_rust: Helper functions for hosting Rust on Mynewt

nrf24l01: Mynewt Driver for nRF24L01

remote_sensor: Mynewt Driver for Remote Sensor

rust_app: Stub library that will be replaced by the compiled Rust application and Rust crates

rust_libcore: Stub library that will be replaced by the Rust Core Library

semihosting_console: Mynewt Console for Arm Semihosting

sensor_coap: Sensor CoAP Library

sensor_network: Sensor Network Library

temp_stm32: Mynewt Driver for Internal Temperature Sensor on STM32

temp_stub: Mynewt Driver for Stub Temperature Sensor that returns a fixed value

tiny_gps_plus: TinyGPS++ Library ported from Arduino. Used by gps_l70r GPS driver.

scripts: Install, build and deploy scripts

.vscode: Visual Studio Code macros for install, build and deploy

View Rust Documentation

How This Application Was Created

The Windows version of the newt command-line tool in newt/newt.exe was created from

github.com/lupyuen/mynewt-newt

The Mynewt application was originally based on:

mynewt.apache.org/latest/tutorials/sensors/sensor_thingy_lis2dh12_onb.html

mynewt.apache.org/latest/tutorials/sensors/sensor_nrf52_bno055.html

cd /mnt/c
newt new stm32bluepill-mynewt-sensor
cd stm32bluepill-mynewt-sensor
cat project.yml

newt install
newt pkg new -t app apps/my_sensor_app
newt pkg new -t lib libs/semihosting_console

newt target create bluepill_boot
newt target set bluepill_boot bsp=@apache-mynewt-core/hw/bsp/bluepill
newt target set bluepill_boot app=@apache-mynewt-core/apps/boot
newt target set bluepill_boot build_profile=optimized

newt target create bluepill_my_sensor
newt target set bluepill_my_sensor bsp=@apache-mynewt-core/hw/bsp/bluepill
newt target set bluepill_my_sensor app=apps/my_sensor_app
newt target set bluepill_my_sensor build_profile=debug

project.yml should contain

project.name: "my_project"

project.repositories:
    - apache-mynewt-core

repository.apache-mynewt-core:
    type: github
    vers: 1.7.0
    user: apache
    repo: mynewt-core