GithubHelp home page GithubHelp logo

luishowin / monocle-micropython Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brilliantlabsar/monocle-micropython

0.0 0.0 0.0 14.87 MB

Micropython ported to the Monocle

License: ISC License

Python 5.06% C 93.25% Makefile 1.69%

monocle-micropython's Introduction

MicroPython for Monocle

A custom deployment of MicroPython designed specifically for Monocle. Check out the user docs here.

For those of you who want to modify the standard firmware, keep on reading.

Getting started with development

  1. Ensure you have the ARM GCC Toolchain installed.

  2. Ensure you have the nRF Command Line Tools installed.

  3. Clone this repository along with submodules and build the mpy-cross toolchain:

    git clone https://github.com/brilliantlabsAR/monocle-micropython.git
    cd monocle-micropython
    
    git submodule update --init
    git -C micropython submodule update --init lib/micropython-lib
    
    make -C micropython/mpy-cross
  4. You should now be able to build the project by calling make from the monocle-micropython folder.

    make
  5. Before flashing an nRF5340, you may need to unlock the chip first.

    nrfjprog --recover
  6. You should then be able to flash the device.

    make flash

Debugging

  1. Open the project in VSCode.

    There are some build tasks already configured within .vscode/tasks.json. Access them by pressing Ctrl-Shift-P (Cmd-Shift-P on MacOS) → Tasks: Run Task.

    1. Build
    2. Build & Flash Chip
    3. Erase & Unlock Chip
    4. Clean
  2. Connect your debugger as described here.

  3. You many need to unlock the device by using the Erase Chip task before programming or debugging.

  4. To enable IntelliSense, be sure to select the correct compiler from within VSCode. Ctrl-Shift-P (Cmd-Shift-P on MacOS) → C/C++: Select IntelliSense ConfigurationUse arm-none-eabi-gcc.

  5. Install the Cortex-Debug extension for VSCode in order to enable debugging.

  6. A debugging launch is already configured within .vscode/launch.json. Run the J-Link launch configuration from the Run and Debug panel, or press F5. The project will automatically build and flash before launching.

  7. To monitor the logs, run the task RTT Console and ensure the J-Link launch configuration is running.

Generating final release .hex and DFU .zip files

  1. Download and install nrfutil including the nrf5sdk-tools package:

    chmod +x nrfutil
    # Make sure to add nrfutil to your path
    nrfutil install nrf5sdk-tools
  2. Generate a settings file:

    nrfutil settings generate --family NRF52 --application build/application.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 build/settings.hex
  3. Download and install the mergehex tool which is a part of the nRF Command Line Tools.

  4. Merge the settings, bootloader, softdevice and application hex files:

    mergehex -m build/settings.hex build/application.hex softdevice/s132_nrf52_7.3.0_softdevice.hex bootloader/build/nrf52832_xxaa_s132.hex -o build/release.hex
  5. Create the DFU zip package using the command:

    nrfutil pkg generate --hw-version 52 --application-version 0 --application build/application.hex --sd-req 0x0124 --key-file bootloader/published_privkey.pem build/release.zip

FPGA

For information on developing and flashing the FPGA binary. Check the Monocle FPGA repository.

monocle-micropython's People

Contributors

andypiper avatar josuah avatar rohitrathnam avatar siliconwitch avatar vr2045 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.