Coder Social home page Coder Social logo

note-stm32l4's Introduction

note-stm32l4

This is an example of how to use the Notecard and the note-c library with the native STM32 SDK.

The board that I used for testing is the Nucleo-L432KC kit with STM32L432 MCU. This board was selected because of its minimalism and the fact that it has an integrated debug probe.

As a proof-of-concept, it implements the same functions as the note-arduino library's JSON example.

One other notable feature of this example is that it implements a working example of the STM32's extremely low-power STOP2 mode. When running the example, the STM32 draws so little power that it is highly applicable, by using the code here, for battery-powered applications. An extension of this example allows one to hook a wire to one of the STM32's GPIO pins, simulating a button press that will also wake up the STM32 to update its sensor readings.

Hardware Setup

Before you begin using the software, wire your Nucleo development board to the Notecarrier containing the Notecard. You may wire it for Serial, I2C, or both. In order to do so, you'll need some standard female-to-female header wires to jumper between the boards. For reference, the Nucleo's user manual is here

  • Connect the Notecarrier's GND pin to any of the Nucleo's GND pins
  • For Serial
    • Connect the Notecarrier's RX to the Nucleo's D1/TX pin (USART1_TX PA9)
    • Connect the Notecarrier's TX to the Nucleo's D0/RX pin (USART1_RX PA10)
  • For I2C
    • Connect the Notecarrier's SDA pin to the Nucleo's D4 pin (I2C1_SDA PB7)
    • Connect the Notecarrier's SCL pin to the Nucleo's D5 pin (I2C1_SCL PB6)
  • In order to simulate a "button" for testing
    • Connect a wire to the Nucleo's D12 pin (GPIO PB4). You will simulate a button press by temporarily touching it to any Nucleo GND pin.
  • Connect both the Notecarrier and Nucleo to power by using their USB connectors to connect them to your development machine.

Installation of the STMicroelectronics Integrated Development Environment

In order to do development with this example, you will need to download and install STMicroelectronics's free IDE called STM32CubeIDE. During installation it will ask you to specify a directory to contain your projects. Remember this directory path, because that's where you'll download this example.

Installation of this example

Clone this note-stm32l4 repo into the projects folder that you selected during IDE installation, as follows. You'll note that the latest copy of the note-c C library is already loaded by default, as a subdirectory of the note-stm32l4 directory.

STM32CubeIDE projects folder
├ note-stm32l4
  ├ note-c  

In STM32CubeIDE, open the note-stm32l4 project. Make sure that you edit the "my" definitions at the top of example.c so that this example will send data to your notehub.io project, and so that it uses serial or I2C as you wish. By using the standard Debug build configuration, you should be able to build and run the project.

This example has been tested with both UART and with I2C, and it has been verified that the project's STOP2 mode works very reliably. Note that in event.h there is a conditional (defaulted ON) that uses the green LED on the Nucleo to indicate whether or not the STM32 is in STOP2 mode. If it's OFF, it is stopped. (Note that it will never enter STOP2 mode while you are in the debugger, else the debugger would halt.)

Contributing

We love issues, fixes, and pull requests from everyone. By participating in this project, you agree to abide by the Blues Inc code of conduct.

For details on contributions we accept and the process for contributing, see our contribution guide.

More Information

For Notecard SDKs and Libraries, see:

To learn more about Blues Wireless, the Notecard and Notehub, see:

License

Copyright (c) 2019 Blues Inc. Released under the MIT license. See LICENSE for details.

note-stm32l4's People

Contributors

m-mcgowan avatar steffkelsey avatar bsatrom avatar rayozzie avatar gwolffblues avatar haydenroche5 avatar dependabot[bot] avatar

Stargazers

Jim M avatar

Watchers

Scott Frazer avatar Brian Short avatar James Cloos avatar  avatar Ethan Pierce avatar Raul avatar  avatar Caitlin avatar Richard Finn avatar Matt Carpenter avatar Paige Niedringhaus avatar VM avatar

Forkers

haydenroche5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.