Getting Started with CutiPy and FreeRTOS

From wiki.emacinc.com
Revision as of 15:16, 13 March 2020 by CBost (talk | contribs)
Jump to: navigation, search

This page outlines a basic guide to getting starting using the Cutipy.

General Information

Tools Required

  • Desktop PC (Windows/Linux/Mac will work)
  • Micro-USB to USB Cable
  • ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor


Setup

1. Download and install STM32CubeIDE (The IDE used for CutiPy FreeRTOS development)
2. Download EMAC's CutiPy FreeRTOS project
3. Connect the ST-Link programmer to the CutiPy board for programming

  • Connect the 10 pin SWD connector (small ribbon cable) to the CutiPy Board HDR6. Ensure the the painted red wire of the cable is on the same side as the arrow. Connect the other end to the adaptor, again ensuring the arrow is aligned with painted red wire. Connect the ST-Link to the adaptor with the large ribbon cable, and connect the ST-LINK to your desktop with it's provide USB cable

4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. 5. Open STM32CubeIDE and import the CutiPy FreeRTOS project 6. Build and upload the firmware

  • On Windows:
    • Open device manager, right click on the new device, and click 'Update driver software'.
    • Browse for 'pybcdc.inf' which should be on the Cutipy (It will show up similar to a USB thumb drive, the directory will be called PYBFLASH), select this file.
    • The device should now show up under 'ports'.
Figure 2: Qt Creator EMAC Project


    • Open PuTTY and select a ‘Serial’ connection type and enter the Comm Port shown on your ‘Device Manager’.
Figure 2: Qt Creator EMAC Project


  • On Linux/Mac:
    • Figure out which tty your device is connected to (Most likely /dev/ttyACM0). You can do this by running 'dmesg -w' and then plugging in the board.
    • Follow these instructions to set up minicom. When setting the 'Serial Device', enter the port you found in the step above.

4. You should now have a REPL session open with the Cutipy. This is identical to a typical Python3 CLI interface.

Developing with the Cutipy

1. Using your choice of text editor / IDE, you can write Micropython scripts.

2. From there, they can be loaded onto the Cutipy by simply moving the python file to the PYBFLASH directory.

3. Run these files by simple typing "import filename" in the REPL session.

Figure 2: Qt Creator EMAC Project



Pages with Related Content

CutiPy Micropython Documentation

Cutipy Test Software

Cutipy-MicroPython Bluetooth LE demo

Micropython

CutiPy-Installing Micropython Firmware