Giter Club home page Giter Club logo

stm32_micropython's Introduction

STM32_MicroPython

A collection of tools, board definition, custom code etc for MicroPython, focusing on STM32 MCUs.

Board Definitions

There are a couple of board definitions, and I'll add more every time I experiment with a new (to me) board.

  • WEACT_H743
  • PYBLITEV10 --> This was tested with the PYB411RE UNO The latter has been modified from the original to load the SD card, which wasn't available.

PYB411RE_UNO

WeActStudio_H743

Builds

I have compiled µP for a few boards, including the nRF52840 – pca100059, working on my Nordic Dongle. The builds include my custom code.

Tested on the above and:

  • Nucleo-L476RG: As usual with STM boards, this was a pleasure to code and test on this device.

Nucleo-L476RG

Custom code

The kongduino module has a few functions, mostly AES-related. You need to add one line in Makefile around line 358, to include kongduino.c in the compilation process. Included commands so far:

  • crc: Calculates the CRC32 of a buffer. Original code by Michael Barr. I cut it down to just the CRC32. The idea is to have useful functions without too much overhead.
  • hexdump: My favorite function to show data that may not be ASCII.
  • reverse_array: does exactly what it says. Not very useful but I wrote that function when I started learning about custom C modules for µP.
  • [de|en]cryptAES_[ECB|CBC]: AES encryption / decryption, ECB and CBC, of a buffer whose length is a multiple of 16. I will add padding later. For the moment, DIY

Scripts

  • test_aes.py: a demonstration of the aes functions.
  • test_lzw.py: a demonstration of the lzw.py library.
  • lzw.py: a cut-down implementation of LZW specifically for ASCII (0-127). You can put it in lib/micropython-lib/python-stdlib so that it is included in the firmware, and compiled as lzw.mpy.
  • test_sx1276.py: a script to test the sx127x.py library. The script works on any machine that has an SX1276 connected to it – you just need to set the pins properly. This is set up for a Nucleo-L476RG.
  • sx127x.py: the library. There are several version floating around, and most have issues. I have fixed most of them, and added features like TRNG. It'll do nicely until I write a library in C.

Tools

  • calculate_crc_table.c: In the crc.c file, there's a function to compute the CRC table. I printed it out and initialize it at compile time, to save space, and improve speed.
  • ziphex.sh: a bash script to zip the .hex builds, before pushing to GitHub.

TODO

I plan to add a lightweight LoRa library for sx1276. No plans for LoRaWAN, or sx1262 for now. We'll see...

stm32_micropython's People

Contributors

kongduino avatar

Stargazers

 avatar

Watchers

 avatar

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.