<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.emacinc.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CBost</id>
	<title>wiki.emacinc.com - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.emacinc.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CBost"/>
	<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/wiki/Special:Contributions/CBost"/>
	<updated>2026-04-08T15:14:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy&amp;diff=14426</id>
		<title>Getting Started with MitiPy</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy&amp;diff=14426"/>
		<updated>2020-09-23T21:02:01Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=MitiPy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the MitiPy Industrial IoT Gateway.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
The MitiPy is an Industrial IoT device that is designed to provide a secure, flexible and ruggedized Industrial IOT Gateway solution. The MitiPy is&lt;br /&gt;
built around the STMicroelectronics STM32 microcontroller with 32bit m4 ARM core.The MitiPy provides a comprehensive wireless multi-protocol (Wi-Fi + BT5) connectivity solution.&lt;br /&gt;
Additionally, the MitiPy supports both the Skywire Cellular Module(s) and the MultiConnect mDot LoRa&lt;br /&gt;
module. This module also provides RS232, RS485, CAN, USB and Ethernet to support protocols such as&lt;br /&gt;
Modbus, PROFINET and EtherCAT. A wide range of configurable controller I/O pins are also available, enabling max system utilization.&lt;br /&gt;
&lt;br /&gt;
The MitiPy Currently supports Micropython. A freeRTOS build is currently in development and will be available soon!&lt;br /&gt;
&lt;br /&gt;
[[Getting Started with MitiPy and FreeRTOS|Getting Started with MitiPy and FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy&amp;diff=14423</id>
		<title>Getting Started with MitiPy</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy&amp;diff=14423"/>
		<updated>2020-09-23T20:59:57Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=MitiPy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the MitiPy Industrial IoT Gateway.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
The MitiPy is an Industrial IoT device that is designed to provide a secure, flexible and ruggedized Industrial IOT Gateway solution. The MitiPy is&lt;br /&gt;
built around the STMicroelectronics STM32 microcontroller with 32bit m4 ARM core.The MitiPy provides a comprehensive wireless multi-protocol (Wi-Fi + BT5) connectivity solution.&lt;br /&gt;
Additionally, the MitiPy supports both the Skywire Cellular Module(s) and the MultiConnect mDot LoRa&lt;br /&gt;
module. This module also provides RS232, RS485, CAN, USB and Ethernet to support protocols such as&lt;br /&gt;
Modbus, PROFINET and EtherCAT. A wide range of configurable controller I/O pins are also available, enabling max system utilization.&lt;br /&gt;
&lt;br /&gt;
The MitiPy Currently supports Micropython. A freeRTOS build is currently in development and will be available soon!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=IMX6U Getting Started | desc=The following page can be used to get familiarized with the DEV-IOT6U. | project=OE 5.0 }}&lt;br /&gt;
=== What Comes with the Development Kit ===&lt;br /&gt;
* SoM-IMX6U-120R2 (528MHz iMX6UL 4GB eMMC, 128MB SoM, connected to Carrier Board) &lt;br /&gt;
* SoM-112ES-131R1 (Dlx Carrier with Wifi/BT &amp;amp; Audio) &lt;br /&gt;
* 5V 3A Wall Power Supply&lt;br /&gt;
* 10 Pin Com to DB9 Cable 12&amp;quot;&lt;br /&gt;
* RJ45 to RJ45 Ethernet Cable 7'&lt;br /&gt;
* USB2.0A Male to Micro-USB Male 6'&lt;br /&gt;
* 2.4 &amp;amp; 5GHz 100mm Wifi Antenna&lt;br /&gt;
* MikroBus ROTARY B click&lt;br /&gt;
{{note | Do to a design flaw in the MikroBus Rotary B Click, the card does not allow another SPI device to be present on the SPI Bus. The SoM-IMX6U uses the SPI Bus and the presence of MikroBus Rotary B Card prohibits the SOM from booting. &lt;br /&gt;
'''To alleviate this issue, the pin labeled “SDO” must be cut and jumpers JB5 and JB6 on the Dev Kit Carrier Board (SoM-112) must be set to 3P3''' (see figures below)}}&lt;br /&gt;
&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
* Desktop PC (Linux or Virtual Linux Machine)&lt;br /&gt;
** Instructions for Downloading a [[Getting_Started_With_EMAC_Virtual_LDC#Getting_Started_With_EMAC_Virtual_LDC|Virtual Machine with EMAC OE SDK pre-installed]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
1. Install EMAC OE SDK on your computer.&lt;br /&gt;
* Installation options are linked [[Getting_Started_with_the_EMAC_OE_SDK#Installing_EMAC_SDK|HERE]].&lt;br /&gt;
2. Make the following cable connections using the cables provided:&lt;br /&gt;
* Board Micro-USB to USB Desktop&lt;br /&gt;
* Board Ethernet to Ethernet Network&lt;br /&gt;
* 5V Wall Power Supply to Board Power (may be left unplugged from wall until Step 3)&lt;br /&gt;
3. Open [[Getting_Started_With_Minicom|Minicom]] and create a terminal session with the DEV-IOT6U&lt;br /&gt;
* After supplying power, boot messages will be displayed followed by a '''log in''' prompt.&lt;br /&gt;
** '''somimx6ul login: root'''&lt;br /&gt;
** '''password: emac_inc'''&lt;br /&gt;
* Use command &amp;quot;ifconfig&amp;quot; in the terminal session to find the device's IP address that can be used during the development process.&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
There are two options in development with this device: &amp;lt;/br&amp;gt;&lt;br /&gt;
1. Using the EMAC OE SDK on terminal. [ [[Getting_Started_with_the_EMAC_OE_SDK | Getting Started with the EMAC OE SDK]] ] &amp;lt;/br&amp;gt;&lt;br /&gt;
- or &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Using the EMAC OE SDK on Qt Creator. [ [[Getting_Started_With_Qt_Creator|Getting Started With Qt Creator]] ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
=== MikroBus Rotary B Click ===&lt;br /&gt;
EMAC has provided a MikroBus Rotary B Card which provide a number of LEDs and a Rotary Switch to allow for easy demonstration and interaction of the Eval Kit.&lt;br /&gt;
Demo/Example Software is provided that interacts with this Card. This Software can be modified by the user as an exercise in using the development tools.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Do to a design flaw in the MikroBus Rotary B Card which does not allow another SPI device to be present on the SPI Bus. The SoM-IMX6U uses the SPI Bus and the presence of MikroBus Rotary B Card prohibits the SOM from booting. &lt;br /&gt;
'''To alleviate this issue, the pin labeled “SDO” must be cut and jumpers JB5 and JB6 on the Dev Kit Carrier Board (SoM-112) must be set to 3P3''' (see figures below).&lt;br /&gt;
[[File:RotaryBClickModification.png]] &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:JumpersMikroBus.png]]&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
Proceed to this page for an example demo of the MikroBus Rotary B Click on the DEV-IOT6U: &amp;lt;/br&amp;gt;&lt;br /&gt;
*[[Example_MikroBus_Rotary_on_the_DEV-IOT6U]]&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
* [[DEV-IOT6U | DEV-IOT6U Hardware Main Page]]&lt;br /&gt;
* [[Getting_Started_with_the_EMAC_OE_SDK | Getting Started with the EMAC OE SDK]]&lt;br /&gt;
* [[Getting_Started_With_Qt_Creator|Getting Started With Qt Creator]]&lt;br /&gt;
* [[Getting_Started_With_Minicom|Getting Started with Minicom]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy&amp;diff=14418</id>
		<title>Getting Started with MitiPy</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy&amp;diff=14418"/>
		<updated>2020-09-23T20:42:51Z</updated>

		<summary type="html">&lt;p&gt;CBost: Created page with &amp;quot;{{#seo: |title=Getting Started with MitiPy |titlemode=append |keywords=MitiPy Getting Started |description=The following page can be used to get familiarized with the MitiPy I...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=MitiPy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the MitiPy Industrial IoT Gateway.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the DEV-IOT6U.&lt;br /&gt;
* [[DEV-IOT6U | DEV-IOT6U Hardware Main Page]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=IMX6U Getting Started | desc=The following page can be used to get familiarized with the DEV-IOT6U. | project=OE 5.0 }}&lt;br /&gt;
=== What Comes with the Development Kit ===&lt;br /&gt;
* SoM-IMX6U-120R2 (528MHz iMX6UL 4GB eMMC, 128MB SoM, connected to Carrier Board) &lt;br /&gt;
* SoM-112ES-131R1 (Dlx Carrier with Wifi/BT &amp;amp; Audio) &lt;br /&gt;
* 5V 3A Wall Power Supply&lt;br /&gt;
* 10 Pin Com to DB9 Cable 12&amp;quot;&lt;br /&gt;
* RJ45 to RJ45 Ethernet Cable 7'&lt;br /&gt;
* USB2.0A Male to Micro-USB Male 6'&lt;br /&gt;
* 2.4 &amp;amp; 5GHz 100mm Wifi Antenna&lt;br /&gt;
* MikroBus ROTARY B click&lt;br /&gt;
{{note | Do to a design flaw in the MikroBus Rotary B Click, the card does not allow another SPI device to be present on the SPI Bus. The SoM-IMX6U uses the SPI Bus and the presence of MikroBus Rotary B Card prohibits the SOM from booting. &lt;br /&gt;
'''To alleviate this issue, the pin labeled “SDO” must be cut and jumpers JB5 and JB6 on the Dev Kit Carrier Board (SoM-112) must be set to 3P3''' (see figures below)}}&lt;br /&gt;
&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
* Desktop PC (Linux or Virtual Linux Machine)&lt;br /&gt;
** Instructions for Downloading a [[Getting_Started_With_EMAC_Virtual_LDC#Getting_Started_With_EMAC_Virtual_LDC|Virtual Machine with EMAC OE SDK pre-installed]]&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
1. Install EMAC OE SDK on your computer.&lt;br /&gt;
* Installation options are linked [[Getting_Started_with_the_EMAC_OE_SDK#Installing_EMAC_SDK|HERE]].&lt;br /&gt;
2. Make the following cable connections using the cables provided:&lt;br /&gt;
* Board Micro-USB to USB Desktop&lt;br /&gt;
* Board Ethernet to Ethernet Network&lt;br /&gt;
* 5V Wall Power Supply to Board Power (may be left unplugged from wall until Step 3)&lt;br /&gt;
3. Open [[Getting_Started_With_Minicom|Minicom]] and create a terminal session with the DEV-IOT6U&lt;br /&gt;
* After supplying power, boot messages will be displayed followed by a '''log in''' prompt.&lt;br /&gt;
** '''somimx6ul login: root'''&lt;br /&gt;
** '''password: emac_inc'''&lt;br /&gt;
* Use command &amp;quot;ifconfig&amp;quot; in the terminal session to find the device's IP address that can be used during the development process.&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
There are two options in development with this device: &amp;lt;/br&amp;gt;&lt;br /&gt;
1. Using the EMAC OE SDK on terminal. [ [[Getting_Started_with_the_EMAC_OE_SDK | Getting Started with the EMAC OE SDK]] ] &amp;lt;/br&amp;gt;&lt;br /&gt;
- or &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Using the EMAC OE SDK on Qt Creator. [ [[Getting_Started_With_Qt_Creator|Getting Started With Qt Creator]] ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
=== MikroBus Rotary B Click ===&lt;br /&gt;
EMAC has provided a MikroBus Rotary B Card which provide a number of LEDs and a Rotary Switch to allow for easy demonstration and interaction of the Eval Kit.&lt;br /&gt;
Demo/Example Software is provided that interacts with this Card. This Software can be modified by the user as an exercise in using the development tools.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Do to a design flaw in the MikroBus Rotary B Card which does not allow another SPI device to be present on the SPI Bus. The SoM-IMX6U uses the SPI Bus and the presence of MikroBus Rotary B Card prohibits the SOM from booting. &lt;br /&gt;
'''To alleviate this issue, the pin labeled “SDO” must be cut and jumpers JB5 and JB6 on the Dev Kit Carrier Board (SoM-112) must be set to 3P3''' (see figures below).&lt;br /&gt;
[[File:RotaryBClickModification.png]] &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:JumpersMikroBus.png]]&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
Proceed to this page for an example demo of the MikroBus Rotary B Click on the DEV-IOT6U: &amp;lt;/br&amp;gt;&lt;br /&gt;
*[[Example_MikroBus_Rotary_on_the_DEV-IOT6U]]&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
* [[DEV-IOT6U | DEV-IOT6U Hardware Main Page]]&lt;br /&gt;
* [[Getting_Started_with_the_EMAC_OE_SDK | Getting Started with the EMAC OE SDK]]&lt;br /&gt;
* [[Getting_Started_With_Qt_Creator|Getting Started With Qt Creator]]&lt;br /&gt;
* [[Getting_Started_With_Minicom|Getting Started with Minicom]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=14086</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=14086"/>
		<updated>2020-09-02T19:35:37Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
===What Next?===&lt;br /&gt;
For those unfamiliar with RTOS concepts we recommend checking out the FreeRTOS webpage [https://www.freertos.org/about-RTOS.html HERE]. FreeRTOS is extremely well documented and hence relatively easy to use. PDF documentation is provided [[CutiPy FreeRTOS Documentation | HERE]]. Of the most benefit is the [https://www.freertos.org/wp-content/uploads/2018/07/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf Mastering the FreeRTOS Real Time Kernel] reference document. FreeRTOS FAQs are addressed [https://www.freertos.org/FAQWhat.html#Kernel HERE]&lt;br /&gt;
&lt;br /&gt;
===EMAC and FreeRTOS===&lt;br /&gt;
EMAC's software builds come with FreeRTOS already imported, letting the user jump-in and start using FreeRTOS functionality immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with MitiPy and FreeRTOS | Getting Started with MitiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=14083</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=14083"/>
		<updated>2020-09-02T19:35:16Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
===What Next?===&lt;br /&gt;
For those unfamiliar with RTOS concepts we recommend checking out the FreeRTOS webpage [https://www.freertos.org/about-RTOS.html HERE]. FreeRTOS is extremely well documented and hence relatively easy to use. PDF documentation is provided [[CutiPy FreeRTOS Documentation | HERE]]. Of the most benefit is the [https://www.freertos.org/wp-content/uploads/2018/07/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf Mastering the FreeRTOS Real Time Kernel] reference document. FreeRTOS FAQs are addressed [https://www.freertos.org/FAQWhat.html#Kernel HERE]&lt;br /&gt;
&lt;br /&gt;
===EMAC and FreeRTOS===&lt;br /&gt;
EMAC's software builds come with FreeRTOS already imported, letting the user jump-in and start using FreeRTOS functionality immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with MitiPy and FreeRTOS | Getting Started with MitiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=MitiPy_FreeRTOS_Documentation&amp;diff=14080</id>
		<title>MitiPy FreeRTOS Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=MitiPy_FreeRTOS_Documentation&amp;diff=14080"/>
		<updated>2020-09-02T19:28:35Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Brief ==&lt;br /&gt;
This is the documentation page for the MitiPy FreeRTOS hardware-Software release.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
===MitiPy===&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-MitiPy/Manual/MitiPy_User_Manual_v1.20.pdf MitiPy User Manual] &amp;lt;/br&amp;gt;&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407M-MitiPy/DataSheets/IOT-F407M_MitiPy_Datasheet.pdf MitiPy Data Sheet] &amp;lt;/br&amp;gt;&lt;br /&gt;
===Software===&lt;br /&gt;
[https://www.freertos.org/Documentation/RTOS_book.html FreeRTOS Documentation]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://elm-chan.org/fsw/ff/00index_e.html FatFs] (used with the SD Card)     &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Media:diagramm.png | MitiPy FreeRTOS software diagram]]&lt;br /&gt;
===STM32 Microcontroller===&lt;br /&gt;
[https://www.st.com/resource/en/datasheet/dm00037051.pdf STM32F407 datasheet]&lt;br /&gt;
&lt;br /&gt;
[https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf STM32F407 Reference Manual]&lt;br /&gt;
&lt;br /&gt;
===Redpine Signal RS9116 Radio Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.redpinesignals.com/Products/Hosted_Connectivity/Multi-Protocol_Wireless_SoCs_&amp;amp;_Modules/RS9116_SoCs_&amp;amp;_Modules/RS9116N-SB00-AA1.php RS9116 resources]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[Getting Started with MitiPy and FreeRTOS | Getting Started with MitiPy and FreeRTOS]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14077</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14077"/>
		<updated>2020-09-02T19:25:28Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
{{note|The MitiPy FreeRTOS software build is currently under development and will be available for download in the near future.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
*A method to power the board, either an ethernet cable with POE (Power Over Ethernet) injector, or a power supply a wired connector for ST1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy Board HDR3. 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. This will provide a menu through a serial terminal. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Apply power to the board either by POE or ST1. if using ST1 acceptable input voltages range from 8V to 32V &amp;lt;/br&amp;gt;&lt;br /&gt;
6. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
7. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''MP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains MP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''MP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''MP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''MP_ADC.c''' MP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''MP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - There are 2 buttons on the MitiPy, 1 Reset button + 1 user buttons (PB1 and PB2 respectively). PB2 is interrupt driven (rising and falling edge), hence its respective task only runs when an interrupt generated. A Callback function is provided in '''MP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''MP_BUTTONS.c'''&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''MP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''MP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (MP_COM_A_RX_RecursiveMutexHandle and MP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''MP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (MP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''MP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''MP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(MP_DARLINGTON_OC_PGX_RecursiveMutexHandle). Eight indicator LEDs corresponding to the 8 darlington pairs will light up when the when in the ON position.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Two user LEDs are present on the MitiPy board (USER_LED0 and USER_LED1) located between the ethernet jack and user push button (LD11).  They are controlled through the toggling of GPIO outputs on the MCU. '''MP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''MP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason MP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''MP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''Skywire Cellular (XBee form factor SOCKET)''' Designed with the NimbleLink Skywire embedded cellular modem family in mind, the MitiPy is provisioned with an XBee socket hardware configurable to 3.3 or 3.8 Volts DC.&lt;br /&gt;
&lt;br /&gt;
'''mDot LoRa (XBee form factor SOCKET)''' Designed with the Multitech mDot Long Range LoRa Module in mind, the MitiPy is provisioned with an XBee socket jumper configurable to 3.3 or 5.0 Volts DC. MultiTech mDot is a secure, CE/FCC/RCM/GITEKI certified,Arm® Mbed™ programmable, low-power RF module, that provideslong-range, low bit rate M2M data connectivity to sensors,industrial equipment and remote appliances.The mDot is LoRaWAN® 1.0.2 compliant, providing bi-directional data communication up to 10 miles / 15 km line-of-sight and 1-3 miles / 2 km into buildings**, using sub-GHz ISM bands inNorth America, Europe, Australia and Asia Pacific (AS923). mDots bring intelligence, reduced complexity and a lower overall bill of material cost to the very edge of the network while supporting a variety of electronic interfaces to connect just about any “Thing” for years on battery power.&lt;br /&gt;
&lt;br /&gt;
'''Ethernet''' A POE 10-100 Base-T Ethernet interface provides both power and a wired network connectivity option.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=MitiPy_FreeRTOS_Documentation&amp;diff=14074</id>
		<title>MitiPy FreeRTOS Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=MitiPy_FreeRTOS_Documentation&amp;diff=14074"/>
		<updated>2020-09-02T19:23:20Z</updated>

		<summary type="html">&lt;p&gt;CBost: Created page with &amp;quot;== Brief == This is the documentation page for the MitiPy FreeRTOS hardware-Software release.  == Documentation == ===MitiPy=== [ftp://ftp.emacinc.com/SBC/IOT-F407C-MitiPy/Man...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Brief ==&lt;br /&gt;
This is the documentation page for the MitiPy FreeRTOS hardware-Software release.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
===MitiPy===&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-MitiPy/Manual/MitiPy_User_Manual_v1.20.pdf MitiPy User Manual] &amp;lt;/br&amp;gt;&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-MitiPy/DataSheets/IOT-F407C-MitiPy_Datasheet.pdf MitiPy Data Sheet] &amp;lt;/br&amp;gt;&lt;br /&gt;
===Software===&lt;br /&gt;
[https://www.freertos.org/Documentation/RTOS_book.html FreeRTOS Documentation]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://elm-chan.org/fsw/ff/00index_e.html FatFs] (used with the SD Card)     &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Media:diagramm.png | MitiPy FreeRTOS software diagram]]&lt;br /&gt;
===STM32 Microcontroller===&lt;br /&gt;
[https://www.st.com/resource/en/datasheet/dm00037051.pdf STM32F407 datasheet]&lt;br /&gt;
&lt;br /&gt;
[https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf STM32F407 Reference Manual]&lt;br /&gt;
&lt;br /&gt;
===Redpine Signal RS9116 Radio Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.redpinesignals.com/Products/Hosted_Connectivity/Multi-Protocol_Wireless_SoCs_&amp;amp;_Modules/RS9116_SoCs_&amp;amp;_Modules/RS9116N-SB00-AA1.php RS9116 resources]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[Getting Started with MitiPy and FreeRTOS | Getting Started with MitiPy and FreeRTOS]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14069</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14069"/>
		<updated>2020-09-02T19:15:41Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
{{note|The MitiPy FreeRTOS software build is currently under development and will be available for download in the near future.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
*A method to power the board, either an ethernet cable with POE (Power Over Ethernet) injector, or a power supply a wired connector for ST1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy Board HDR3. 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. This will provide a menu through a serial terminal. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Apply power to the board either by POE or ST1. if using ST1 acceptable input voltages range from 8V to 36V &amp;lt;/br&amp;gt;&lt;br /&gt;
6. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
7. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''MP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains MP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''MP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''MP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''MP_ADC.c''' MP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''MP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - There are 2 buttons on the MitiPy, 1 Reset button + 1 user buttons (PB1 and PB2 respectively). PB2 is interrupt driven (rising and falling edge), hence its respective task only runs when an interrupt generated. A Callback function is provided in '''MP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''MP_BUTTONS.c'''&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''MP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''MP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (MP_COM_A_RX_RecursiveMutexHandle and MP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''MP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (MP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''MP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''MP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(MP_DARLINGTON_OC_PGX_RecursiveMutexHandle). Eight indicator LEDs corresponding to the 8 darlington pairs will light up when the when in the ON position.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Two user LEDs are present on the MitiPy board (USER_LED0 and USER_LED1) located between the ethernet jack and user push button (LD11).  They are controlled through the toggling of GPIO outputs on the MCU. '''MP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''MP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason MP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''MP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''Skywire Cellular (XBee form factor SOCKET)''' Designed with the NimbleLink Skywire embedded cellular modem family in mind, the MitiPy is provisioned with an XBee socket hardware configurable to 3.3 or 3.8 Volts DC.&lt;br /&gt;
&lt;br /&gt;
'''mDot LoRa (XBee form factor SOCKET)''' Designed with the Multitech mDot Long Range LoRa Module in mind, the MitiPy is provisioned with an XBee socket jumper configurable to 3.3 or 5.0 Volts DC. MultiTech mDot is a secure, CE/FCC/RCM/GITEKI certified,Arm® Mbed™ programmable, low-power RF module, that provideslong-range, low bit rate M2M data connectivity to sensors,industrial equipment and remote appliances.The mDot is LoRaWAN® 1.0.2 compliant, providing bi-directional data communication up to 10 miles / 15 km line-of-sight and 1-3 miles / 2 km into buildings**, using sub-GHz ISM bands inNorth America, Europe, Australia and Asia Pacific (AS923). mDots bring intelligence, reduced complexity and a lower overall bill of material cost to the very edge of the network while supporting a variety of electronic interfaces to connect just about any “Thing” for years on battery power.&lt;br /&gt;
&lt;br /&gt;
'''Ethernet''' A POE 10-100 Base-T Ethernet interface provides both power and a wired network connectivity option.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14066</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14066"/>
		<updated>2020-09-02T19:12:57Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
*A method to power the board, either an ethernet cable with POE (Power Over Ethernet) injector, or a power supply a wired connector for ST1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy Board HDR3. 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. This will provide a menu through a serial terminal. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Apply power to the board either by POE or ST1. if using ST1 acceptable input voltages range from 8V to 36V &amp;lt;/br&amp;gt;&lt;br /&gt;
6. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
7. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''MP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains MP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''MP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''MP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''MP_ADC.c''' MP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''MP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - There are 2 buttons on the MitiPy, 1 Reset button + 1 user buttons (PB1 and PB2 respectively). PB2 is interrupt driven (rising and falling edge), hence its respective task only runs when an interrupt generated. A Callback function is provided in '''MP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''MP_BUTTONS.c'''&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''MP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''MP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (MP_COM_A_RX_RecursiveMutexHandle and MP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''MP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (MP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''MP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''MP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(MP_DARLINGTON_OC_PGX_RecursiveMutexHandle). Eight indicator LEDs corresponding to the 8 darlington pairs will light up when the when in the ON position.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Two user LEDs are present on the MitiPy board (USER_LED0 and USER_LED1) located between the ethernet jack and user push button (LD11).  They are controlled through the toggling of GPIO outputs on the MCU. '''MP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''MP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason MP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''MP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''Skywire Cellular (XBee form factor SOCKET)''' Designed with the NimbleLink Skywire embedded cellular modem family in mind, the MitiPy is provisioned with an XBee socket hardware configurable to 3.3 or 3.8 Volts DC.&lt;br /&gt;
&lt;br /&gt;
'''mDot LoRa (XBee form factor SOCKET)''' Designed with the Multitech mDot Long Range LoRa Module in mind, the MitiPy is provisioned with an XBee socket jumper configurable to 3.3 or 5.0 Volts DC. MultiTech mDot is a secure, CE/FCC/RCM/GITEKI certified,Arm® Mbed™ programmable, low-power RF module, that provideslong-range, low bit rate M2M data connectivity to sensors,industrial equipment and remote appliances.The mDot is LoRaWAN® 1.0.2 compliant, providing bi-directional data communication up to 10 miles / 15 km line-of-sight and 1-3 miles / 2 km into buildings**, using sub-GHz ISM bands inNorth America, Europe, Australia and Asia Pacific (AS923). mDots bring intelligence, reduced complexity and a lower overall bill of material cost to the very edge of the network while supporting a variety of electronic interfaces to connect just about any “Thing” for years on battery power.&lt;br /&gt;
&lt;br /&gt;
'''Ethernet''' A POE 10-100 Base-T Ethernet interface provides both power and a wired network connectivity option.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14063</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14063"/>
		<updated>2020-09-02T18:18:01Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - There are 2 buttons on the MitiPy, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the MitiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''Skywire Cellular (XBee form factor SOCKET)''' Designed with the NimbleLink Skywire embedded cellular modem family in mind, the MitiPy is provisioned with an XBee socket hardware configurable to 3.3 or 3.8 Volts DC.&lt;br /&gt;
&lt;br /&gt;
'''mDot LoRa (XBee form factor SOCKET)''' Designed with the Multitech mDot Long Range LoRa Module in mind, the MitiPy is provisioned with an XBee socket jumper configurable to 3.3 or 5.0 Volts DC. MultiTech mDot is a secure, CE/FCC/RCM/GITEKI certified,Arm® Mbed™ programmable, low-power RF module, that provideslong-range, low bit rate M2M data connectivity to sensors,industrial equipment and remote appliances.The mDot is LoRaWAN® 1.0.2 compliant, providing bi-directional data communication up to 10 miles / 15 km line-of-sight and 1-3 miles / 2 km into buildings**, using sub-GHz ISM bands inNorth America, Europe, Australia and Asia Pacific (AS923). mDots bring intelligence, reduced complexity and a lower overall bill of material cost to the very edge of the network while supporting a variety of electronic interfaces to connect just about any “Thing” for years on battery power.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14060</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14060"/>
		<updated>2020-09-01T22:13:12Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - There are 2 buttons on the MitiPy, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the MitiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''Skywire Cellular (XBee form factor SOCKET)''' Designed with the NimbleLink Skywire embedded cellular modem family in mind, the MitiPy is provisioned with an XBee socket hardware configurable to 3.3 or 3.8 Volts DC.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''mDot LoRa (XBee form factor SOCKET)''' Designed with the Multitech mDot Long Range LoRa Module in mind, the MitiPy is provisioned with an XBee socket jumper configurable to 3.3 or 5.0 Volts DC. MultiTech mDot is a secure, CE/FCC/RCM/GITEKI certified,Arm® Mbed™ programmable, low-power RF module, that provideslong-range, low bit rate M2M data connectivity to sensors,industrial equipment and remote appliances.The mDot is LoRaWAN® 1.0.2 compliant, providing bi-directional data communication up to 10 miles / 15 km line-of-sight and 1-3 miles / 2 km into buildings**, using sub-GHz ISM bands inNorth America, Europe, Australia and Asia Pacific (AS923). mDots bring intelligence, reduced complexity and a lower overall bill of material cost to the very edge of the network while supporting a variety of electronic interfaces to connect just about any “Thing” for years on battery power.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14057</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14057"/>
		<updated>2020-09-01T20:56:57Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - There are 2 buttons on the MitiPy, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the MitiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''Skywire Cellular (XBee form factor SOCKET)''' Designed with the NimbleLink Skywire embedded cellular modem family in mind the MitiPy is provisioned with an XB  .The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
'''mDot LoRa (XBee form factor SOCKET)''' The MitiPy comes with a MicroSD slot. The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14054</id>
		<title>Getting Started with MitiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_MitiPy_and_FreeRTOS&amp;diff=14054"/>
		<updated>2020-09-01T19:21:59Z</updated>

		<summary type="html">&lt;p&gt;CBost: Created page with &amp;quot;{{#seo: |title=Getting Started with MitiPy and FreeRTOS |titlemode=append |keywords=Mitipy Getting Started |description=The following page can be used to get familiarized with...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with MitiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Mitipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Mitipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Mitipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Mitipy Getting Started | desc=The following page can be used to get familiarized with the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
*A MitiPy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for MitiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's MitiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/MitiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the MitiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''Connect the 10 pin SWD connector (small ribbon cable) to the MitiPy 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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your MitiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the MitiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Mitipy | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline MitiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the MitiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the MitiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of MitiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC MitiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Mitipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The MitiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''MitiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the MitiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a MitiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''MitiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''MitiPy_Tasks''' contains the header and source files for the MitiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''MitiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the MitiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
MitiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the MitiPy's main peripherals. These are located under '''MitiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''MitiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease MitiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The MitiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the MitiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your MitiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the MitiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the MitiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The MitiPy comes with a MicroSD slot.The MitiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[MitiPy_FreeRTOS_Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[MitiPy FreeRTOS Documentation | MitiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13960</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13960"/>
		<updated>2020-03-24T23:13:56Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''CutiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). Demos are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13957</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13957"/>
		<updated>2020-03-24T17:09:48Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
===What Next?===&lt;br /&gt;
For those unfamiliar with RTOS concepts we recommend checking out the FreeRTOS webpage [https://www.freertos.org/about-RTOS.html HERE]. FreeRTOS is extremely well documented and hence relatively easy to use. PDF documentation is provided [[CutiPy FreeRTOS Documentation | HERE]]. Of the most benefit is the [https://www.freertos.org/wp-content/uploads/2018/07/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf Mastering the FreeRTOS Real Time Kernel] reference document. FreeRTOS FAQs are addressed [https://www.freertos.org/FAQWhat.html#Kernel HERE]&lt;br /&gt;
&lt;br /&gt;
===EMAC and FreeRTOS===&lt;br /&gt;
EMAC's software builds come with FreeRTOS already imported, letting the user jump-in and start using FreeRTOS functionality immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13954</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13954"/>
		<updated>2020-03-24T17:05:03Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What Next?===&lt;br /&gt;
For those unfamiliar with RTOS concepts we recommend checking out the FreeRTOS webpage [https://www.freertos.org/about-RTOS.html HERE]. FreeRTOS is extremely well documented and hence relatively easy to use. PDF documentation is provided [[CutiPy FreeRTOS Documentation | HERE]]. Of the most benefit is the [https://www.freertos.org/wp-content/uploads/2018/07/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf Mastering the FreeRTOS Real Time Kernel] reference document. FreeRTOS FAQs are addressed [https://www.freertos.org/FAQWhat.html#Kernel HERE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13951</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13951"/>
		<updated>2020-03-24T16:58:43Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What Next?===&lt;br /&gt;
For those unfamiliar with RTOS concepts we recommend checking out the FreeRTOS webpage [https://www.freertos.org/about-RTOS.html HERE]. FreeRTOS is extremely well documented and hence relatively easy to use. PDF documentation is provided [[CutiPy FreeRTOS Documentation | HERE]]. Of the most benefit is the [https://www.freertos.org/wp-content/uploads/2018/07/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf Mastering the FreeRTOS Real Time Kernel] reference document.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13948</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13948"/>
		<updated>2020-03-24T16:56:20Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What Next?===&lt;br /&gt;
For those unfamiliar with RTOS concepts we recommend checking out the FreeRTOS webpage [https://www.freertos.org/about-RTOS.html HERE]. FreeRTOS is extremely well documented and hence relatively easy to use. PDF documentation is provided [[CutiPy FreeRTOS Documentation | HERE]]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13945</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13945"/>
		<updated>2020-03-24T16:28:37Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.''&lt;br /&gt;
&lt;br /&gt;
''A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.''&lt;br /&gt;
&lt;br /&gt;
''Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13942</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13942"/>
		<updated>2020-03-24T16:28:14Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
''An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.''&lt;br /&gt;
&lt;br /&gt;
===''What is an RTOS?''===&lt;br /&gt;
''Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]''&lt;br /&gt;
&lt;br /&gt;
''The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).''&lt;br /&gt;
&lt;br /&gt;
''Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''What is FreeRTOS?''===&lt;br /&gt;
''FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.&lt;br /&gt;
&lt;br /&gt;
A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.&lt;br /&gt;
&lt;br /&gt;
Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13939</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13939"/>
		<updated>2020-03-24T16:27:10Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: [https://www.freertos.org/about-RTOS.html What is an RTOS?]==&lt;br /&gt;
&lt;br /&gt;
===''What is a General Purpose Operating System?''===&lt;br /&gt;
An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.&lt;br /&gt;
&lt;br /&gt;
===What is an RTOS?===&lt;br /&gt;
Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]&lt;br /&gt;
&lt;br /&gt;
The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).&lt;br /&gt;
&lt;br /&gt;
Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is FreeRTOS?===&lt;br /&gt;
FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.&lt;br /&gt;
&lt;br /&gt;
A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.&lt;br /&gt;
&lt;br /&gt;
Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13936</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13936"/>
		<updated>2020-03-24T16:25:29Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: What is an RTOS?==&lt;br /&gt;
''&lt;br /&gt;
===What is a General Purpose Operating System?===&lt;br /&gt;
An operating system is a computer program that supports a computer’s basic functions, and provides services to other programs (or applications) that run on the computer. The applications provide the functionality that the user of the computer wants or needs. The services provided by the operating system make writing the applications faster, simpler, and more maintainable. If you are reading this web page, then you are using a web browser (the application program that provides the functionality you are interested in), which will itself be running in an environment provided by an operating system.&lt;br /&gt;
&lt;br /&gt;
===What is an RTOS?===&lt;br /&gt;
Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program.&lt;br /&gt;
The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system (such as Unix) will ensure each user gets a fair amount of the processing time. As another example, the scheduler in a desk top operating system (such as Windows) will try and ensure the computer remains responsive to its user. [Note: FreeRTOS is not a big operating system, nor is it designed to run on a desktop computer class processor, I use these examples purely because they are systems readers will be familiar with]&lt;br /&gt;
&lt;br /&gt;
The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable (normally described as deterministic) execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirements is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline). A guarantee to meet real time requirements can only be made if the behaviour of the operating system’s scheduler can be predicted (and is therefore deterministic).&lt;br /&gt;
&lt;br /&gt;
Traditional real time schedulers, such as the scheduler used in FreeRTOS, achieve determinism by allowing the user to assign a priority to each thread of execution. The scheduler then uses the priority to know which thread of execution to run next. In FreeRTOS, a thread of execution is called a task.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is FreeRTOS?===&lt;br /&gt;
FreeRTOS is a class of RTOS that is designed to be small enough to run on a microcontroller – although its use is not limited to microcontroller applications.&lt;br /&gt;
&lt;br /&gt;
A microcontroller is a small and resource constrained processor that incorporates, on a single chip, the processor itself, read only memory (ROM or Flash) to hold the program to be executed, and the random access memory (RAM) needed by the programs it executes. Typically the program is executed directly from the read only memory.&lt;br /&gt;
&lt;br /&gt;
Microcontrollers are used in deeply embedded applications (those applications where you never actually see the processors themselves, or the software they are running) that normally have a very specific and dedicated job to do. The size constraints, and dedicated end application nature, rarely warrant the use of a full RTOS implementation – or indeed make the use of a full RTOS implementation possible. FreeRTOS therefore provides the core real time scheduling functionality, inter-task communication, timing and synchronisation primitives only. This means it is more accurately described as a real time kernel, or real time executive. Additional functionality, such as a command console interface, or networking stacks, can then be included with add-on components.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13933</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13933"/>
		<updated>2020-03-24T16:24:01Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
==From FreeRTOS's webpage: What is an RTOS?==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13930</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13930"/>
		<updated>2020-03-24T16:23:47Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
====From FreeRTOS's webpage: What is an RTOS?====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13927</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13927"/>
		<updated>2020-03-24T16:23:35Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
===From FreeRTOS's webpage: What is an RTOS?===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13924</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13924"/>
		<updated>2020-03-24T16:23:21Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
===Intro===&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
===From FreeRTOS's webpage: What is an RTOS===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13921</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13921"/>
		<updated>2020-03-24T15:11:03Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13918</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13918"/>
		<updated>2020-03-24T15:10:47Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting started with CutiPy and FreeRTOS | Getting started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13915</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13915"/>
		<updated>2020-03-24T15:10:02Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting started with CutiPy FreeRTOS | Getting started with CutiPy FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13912</id>
		<title>FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=FreeRTOS&amp;diff=13912"/>
		<updated>2020-03-24T15:00:09Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Micropython&lt;br /&gt;
|description=The following page can be used to get familiarized with Micropython on EMAC products.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
FreeRTOS is a lightweight RTOS design for embedded systems. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use. It allows the creation of multiple 'tasks' (multi-threading)&lt;br /&gt;
and provides essential kernel elements for the snychronization between these tasks(Things like Mutexes, Semaphores, queues, etc.) It also enables the implementation of more advanced features like Software timers, and tickless idle for power-saving purposes.&lt;br /&gt;
&lt;br /&gt;
With a focus on compactness and speed of execution, FreeRTOS gives the user precision control over RTOS elements and forgoes the 'fluff' present in a full-blown OS. This allows users to scale their RTOS implementation to the needs of their project.&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Micropython | desc=The following page can be used to get familiarized with Micropython on EMAC products. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
* Desktop PC&lt;br /&gt;
* USB to mini-USB cable&lt;br /&gt;
* Serial to USB converter (optional, may be required if board does not have USB)&lt;br /&gt;
* STLink programmer (optional, may be required if board does not have USB)&lt;br /&gt;
=== Setup === &lt;br /&gt;
* [[STLink | STLink]]&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=EMAC Micropython | desc=The following page can be used to get familiarized with Micropython on EMAC products. | project=OE 5.0 }}&lt;br /&gt;
EMAC has developed multiple drivers and features for our products running Micropython.&lt;br /&gt;
&lt;br /&gt;
Documentation on specific features is listed below: &lt;br /&gt;
&lt;br /&gt;
* [[ Micropython_Bluemix | Micropython with IBM Bluemix ]]&lt;br /&gt;
* [[ Wifi_and_mqtt_on_the_rs9113 | Wifi and MQTT on the RS9113 ]]&lt;br /&gt;
* [http://wiki.emacinc.com/wiki/Cutipy_Test Test Software for CutiPy]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
* [[ Industial_IoT_Boards | Boards that use Micropython ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting started with CutiPy FreeRTOS | Getting started with CutiPy FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[STM32CubeIDE | STM32CubeIDE]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13909</id>
		<title>CutiPy FreeRTOS Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13909"/>
		<updated>2020-03-24T14:55:17Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Brief ==&lt;br /&gt;
This is the documentation page for the CutiPy FreeRTOS hardware-Software release.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
===CutiPy===&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/Manual/CutiPy_User_Manual_v1.20.pdf CutiPy User Manual] &amp;lt;/br&amp;gt;&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/DataSheets/IOT-F407C-CutiPy_Datasheet.pdf CutiPy Data Sheet] &amp;lt;/br&amp;gt;&lt;br /&gt;
===Software===&lt;br /&gt;
[https://www.freertos.org/Documentation/RTOS_book.html FreeRTOS Documentation]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://elm-chan.org/fsw/ff/00index_e.html FatFs] (used with the SD Card)     &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Media:diagramm.png | CutiPy FreeRTOS software diagram]]&lt;br /&gt;
===STM32 Microcontroller===&lt;br /&gt;
[https://www.st.com/resource/en/datasheet/dm00037051.pdf STM32F407 datasheet]&lt;br /&gt;
&lt;br /&gt;
[https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf STM32F407 Reference Manual]&lt;br /&gt;
&lt;br /&gt;
===Redpine Signal RS9116 Radio Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.redpinesignals.com/Products/Hosted_Connectivity/Multi-Protocol_Wireless_SoCs_&amp;amp;_Modules/RS9116_SoCs_&amp;amp;_Modules/RS9116N-SB00-AA1.php RS9116 resources]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=STM32CubeIDE&amp;diff=13906</id>
		<title>STM32CubeIDE</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=STM32CubeIDE&amp;diff=13906"/>
		<updated>2020-03-24T14:54:39Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;background:#00FF00;color:#FF0000;font-size:300%&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Intro =&lt;br /&gt;
STM32CubeIDE is an all in one integrated development environment, possessing MCU Pin Configuration, Middleware selection, code generation, compilation, build analysis, and debugging capabilities. It is based on the ECLIPSE™/CDT framework and GCC toolchain for the development, and GDB for the debugging. It allows the integration of the hundreds of existing plugins that complete the features of the ECLIPSE™ IDE. A full product description is given HERE.&lt;br /&gt;
&lt;br /&gt;
STM32CubeIDE is used for CutiPy FreeRTOS development. Essential feature descriptions are given below. &lt;br /&gt;
&lt;br /&gt;
=== Supported Systems === &lt;br /&gt;
Windows®, Linux®, and macOS®, 64-bit versions only&lt;br /&gt;
&lt;br /&gt;
===Download===&lt;br /&gt;
STM32CubeIDE can be downloaded [https://www.st.com/en/development-tools/stm32cubeide.html HERE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Importing a Project =&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
After intalling STM32CubeIDE to your development machine and downloading an EMAC STM32Cube Project (Like CutiPy_FreeRTOS), import the project as follows: &lt;br /&gt;
1. Open the STM32CubeIDE and navigate to the '''Project Explorer''' window. Right click in the empty window and select '''Import...''', to open the '''Import''' window.&lt;br /&gt;
* Select '''General-&amp;gt;Existing Projects into Workdspace''' and click '''Next&amp;gt;''' to advance.&lt;br /&gt;
* Now select '''Browse''' and navigated to the folder containing the dowloaded project. The project will appear in the '''Projects:''' box. Check the box next to the project name, and then select '''Finish''', the project will then be imported.&lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building and Upload =&lt;br /&gt;
===Setup===&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. Connect the ST-Link programmer to the board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
* Power on your board&lt;br /&gt;
* If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
The project now ready to be built and uploaded.&lt;br /&gt;
===Build and Upload===&lt;br /&gt;
[[File:toolbar.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
The project can be built by selecting the hammer symbol on the upper toolbar. The selected build can also be toggled by clicking on the down arrow next to the hammer. The default options available are Debug (a build with debug symbols, and optimizations turned off), and Release (a build with optimizations ON and no debug sybols).  The project can be built and uploaded by selecting the green bug symbol. After upload this will automatically launch the debug perspective, from which debugging can commence.  &lt;br /&gt;
{{note|In current release of the IDE there is no 'upload without launching debug perspective' option available. ALL uploads are accomplished by the green debug symbol, but meaningful debugging can only be accomplished through upload of a Debug build.}}&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
Debugging is accomplished by building and uploading a Debug build. This done by selecting the '''Debug''' build with the down arrow next to the hammer symbol, then selecting the green bug symbol for upload. The debug perspective should launch automatically. if not the debug perspective can be selected by clicking the green bug symbol in the right hand corner.&lt;br /&gt;
&lt;br /&gt;
===Debug Perspective===&lt;br /&gt;
The debug perspective makes available debug options like start, stop, reset, breakpoint set and reset, step into, step over, etc. The following items on the upper tool bar are of particular use:&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
From left to right these symbol accomplish the following:&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. '''Reset the chip and restart the debug session'''  &lt;br /&gt;
* '''Skip all breakpoints'''&lt;br /&gt;
* '''Terminate and relaunch''', This kills the debug session and re uploads the firmware&lt;br /&gt;
* '''Resume'''  (The play symbol), This option becomes available when code execution is suspended. Selecting this option resumes/continues code execution until the next breakpoint is encountered.&lt;br /&gt;
* '''Suspend''' (The pause symbol), This option becomes available while the code is running (after clicking '''Resume'''), Selecting this option pauses code at the next line to be executed.&lt;br /&gt;
* '''Terminate''' kills the debug session&lt;br /&gt;
* '''Disconnect''' disconnects from the current debug session&lt;br /&gt;
* '''Step into'''  -Steps into a function&lt;br /&gt;
* '''Step Over''' Steps over the current line of code&lt;br /&gt;
* '''Return''' If in a function, this option will exit the function and stop at the next line to be executed (continue and stop)&lt;br /&gt;
&amp;lt;/cl&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar2.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
In the upper right hand corner of the debug perspective are additional debug views. From top to bottom these are:&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. '''variables''' - opening this view while stopped in an active function will reveal variable values and update them as you step through.&lt;br /&gt;
* '''Breakpoints''' -This view shows active breakpoints and their locations. It also allows you to toggle them off and on and delete them.&lt;br /&gt;
* '''expressions''' -Type in an expression (a variable or an equation of variables and constants) and this view will evaluate them for you.&lt;br /&gt;
* '''live expression''' - Updates expression values while the code is running ('live'). Only available with Segger J-link&lt;br /&gt;
* '''SFRs''' - shows values of peripheral registers&lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
Other views are available by navigating to the top of the window and selection '''Window-&amp;gt;Show View''' and selecting one of the available views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Setting Breakpoints===&lt;br /&gt;
Breakpoints are set by opening a file in debug perspective and double clicking the line number at which you'd like to place your breakpoint. A blue circle with a checkmark should appear to the left of the line number-This indicates a breakpoint has been set successfully.&lt;br /&gt;
&lt;br /&gt;
[[File:breakpoint.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The breakpoint can be turned off by double clicking line, or by deleting it through the breakpoint view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX and Code Generation ===&lt;br /&gt;
&lt;br /&gt;
Code generation will result if the projects '''.ioc''' file is modified. Double clicking this file will open it through the STM32CubeMX perspective. There the pinout of the device, configured peripherals, middlewares, and clock information will be available. 'Modification' of the baseline settings is not recommended, though 'additions' by the user should be fine. This feature may be used for configuring header pins in alternate function modes (Something other than ANALOG, INPUT, or OUTPUT). Or configuring various other options. After modifying the .ioc file (Changing the setting in STM32CubeMX), code can be generated by clicking the build symbol on the tool bar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Generation of code will result in the build settings and source folders having to be reset through the IDE. Items needing to be re-set include # Symbols (MACROS), Includes and Source Locations located at ''Properties-&amp;gt;C/C++ General-&amp;gt;Paths and Symbols''. These can be uploaded by importing EMACsettings.xml. This will upload the necessary symbols and includes. Source locations will have to be manually added on an individual folder basis or by selecting ''Source Location-&amp;gt;Add Folder-&amp;gt;&amp;lt;root folder&amp;gt;'' and clicking ''OK'', then ''Apply and Close'' }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=STM32CubeIDE&amp;diff=13903</id>
		<title>STM32CubeIDE</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=STM32CubeIDE&amp;diff=13903"/>
		<updated>2020-03-24T14:54:07Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;background:#00FF00;color:#FF0000;font-size:300%&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Intro =&lt;br /&gt;
STM32CubeIDE is an all in one integrated development environment, possessing MCU Pin Configuration, Middleware selection, code generation, compilation, build analysis, and debugging capabilities. It is based on the ECLIPSE™/CDT framework and GCC toolchain for the development, and GDB for the debugging. It allows the integration of the hundreds of existing plugins that complete the features of the ECLIPSE™ IDE. A full product description is given HERE.&lt;br /&gt;
&lt;br /&gt;
STM32CubeIDE is used for CutiPy FreeRTOS development. Essential feature descriptions are given below. &lt;br /&gt;
&lt;br /&gt;
=== Supported Systems === &lt;br /&gt;
Windows®, Linux®, and macOS®, 64-bit versions only&lt;br /&gt;
&lt;br /&gt;
===Download===&lt;br /&gt;
STM32CubeIDE can be downloaded [https://www.st.com/en/development-tools/stm32cubeide.html HERE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Importing a Project =&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
After intalling STM32CubeIDE to your development machine and downloading an EMAC STM32Cube Project (Like CutiPy_FreeRTOS), import the project as follows: &lt;br /&gt;
1. Open the STM32CubeIDE and navigate to the '''Project Explorer''' window. Right click in the empty window and select '''Import...''', to open the '''Import''' window.&lt;br /&gt;
* Select '''General-&amp;gt;Existing Projects into Workdspace''' and click '''Next&amp;gt;''' to advance.&lt;br /&gt;
* Now select '''Browse''' and navigated to the folder containing the dowloaded project. The project will appear in the '''Projects:''' box. Check the box next to the project name, and then select '''Finish''', the project will then be imported.&lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building and Upload =&lt;br /&gt;
===Setup===&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. Connect the ST-Link programmer to the board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
* Power on your board&lt;br /&gt;
* If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
The project now ready to be built and uploaded.&lt;br /&gt;
===Build and Upload===&lt;br /&gt;
[[File:toolbar.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
The project can be built by selecting the hammer symbol on the upper toolbar. The selected build can also be toggled by clicking on the down arrow next to the hammer. The default options available are Debug (a build with debug symbols, and optimizations turned off), and Release (a build with optimizations ON and no debug sybols).  The project can be built and uploaded by selecting the green bug symbol. After upload this will automatically launch the debug perspective, from which debugging can commence.  &lt;br /&gt;
{{note|In current release of the IDE there is no 'upload without launching debug perspective' option available. ALL uploads are accomplished by the green debug symbol, but meaningful debugging can only be accomplished through upload of a Debug build.}}&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
Debugging is accomplished by building and uploading a Debug build. This done by selecting the '''Debug''' build with the down arrow next to the hammer symbol, then selecting the green bug symbol for upload. The debug perspective should launch automatically. if not the debug perspective can be selected by clicking the green bug symbol in the right hand corner.&lt;br /&gt;
&lt;br /&gt;
===Debug Perspective===&lt;br /&gt;
The debug perspective makes available debug options like start, stop, reset, breakpoint set and reset, step into, step over, etc. The following items on the upper tool bar are of particular use:&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
From left to right these symbol accomplish the following:&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. '''Reset the chip and restart the debug session'''  &lt;br /&gt;
* '''Skip all breakpoints'''&lt;br /&gt;
* '''Terminate and relaunch''', This kills the debug session and re uploads the firmware&lt;br /&gt;
* '''Resume'''  (The play symbol), This option becomes available when code execution is suspended. Selecting this option resumes/continues code execution until the next breakpoint is encountered.&lt;br /&gt;
* '''Suspend''' (The pause symbol), This option becomes available while the code is running (after clicking '''Resume'''), Selecting this option pauses code at the next line to be executed.&lt;br /&gt;
* '''Terminate''' kills the debug session&lt;br /&gt;
* '''Disconnect''' disconnects from the current debug session&lt;br /&gt;
* '''Step into'''  -Steps into a function&lt;br /&gt;
* '''Step Over''' Steps over the current line of code&lt;br /&gt;
* '''Return''' If in a function, this option will exit the function and stop at the next line to be executed (continue and stop)&lt;br /&gt;
&amp;lt;/cl&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar2.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
In the upper right hand corner of the debug perspective are additional debug views. From top to bottom these are:&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. '''variables''' - opening this view while stopped in an active function will reveal variable values and update them as you step through.&lt;br /&gt;
* '''Breakpoints''' -This view shows active breakpoints and their locations. It also allows you to toggle them off and on and delete them.&lt;br /&gt;
* '''expressions''' -Type in an expression (a variable or an equation of variables and constants) and this view will evaluate them for you.&lt;br /&gt;
* '''live expression''' - Updates expression values while the code is running ('live'). Only available with Segger J-link&lt;br /&gt;
* '''SFRs''' - shows values of peripheral registers&lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
Other views are available by navigating to the top of the window and selection '''Window-&amp;gt;Show View''' and selecting one of the available views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Setting Breakpoints===&lt;br /&gt;
Breakpoints are set by opening a file in debug perspective and double clicking the line number at which you'd like to place your breakpoint. A blue circle with a checkmark should appear to the left of the line number-This indicates a breakpoint has been set successfully.&lt;br /&gt;
&lt;br /&gt;
[[File:breakpoint.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The breakpoint can be turned off by double clicking line, or by deleting it through the breakpoint view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX and Code Generation ===&lt;br /&gt;
&lt;br /&gt;
Code generation will result if the projects '''.ioc''' file is modified. Double clicking this file will open it through the STM32CubeMX perspective. There the pinout of the device, configured peripherals, middlewares, and clock information will be available. 'Modification' of the baseline settings is not recommended, though 'additions' by the user should be fine. This feature may be used for configuring header pins in alternate function modes (Something other than ANALOG, INPUT, or OUTPUT). Or configuring various other options. After modifying the .ioc file (Changing the setting in STM32CubeMX), code can be generated by clicking the build symbol on the tool bar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Generation of code will result in the build settings and source folders having to be reset through the IDE. Items needing to be re-set include # Symbols (MACROS), Includes and Source Locations located at ''Properties-&amp;gt;C/C++ General-&amp;gt;Paths and Symbols''. These can be uploaded by importing EMACsettings.xml. This will upload the necessary symbols and includes. Source locations will have to be manually added on an individual folder basis or by selecting ''Source Location-&amp;gt;Add Folder-&amp;gt;&amp;lt;root folder&amp;gt;'' and clicking ''OK'', then ''Apply and Close'' }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting Started with CutiPy FreeRTOS | Getting Started with CutiPy FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=STM32CubeIDE&amp;diff=13900</id>
		<title>STM32CubeIDE</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=STM32CubeIDE&amp;diff=13900"/>
		<updated>2020-03-24T14:53:21Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;background:#00FF00;color:#FF0000;font-size:300%&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Intro =&lt;br /&gt;
STM32CubeIDE is an all in one integrated development environment, possessing MCU Pin Configuration, Middleware selection, code generation, compilation, build analysis, and debugging capabilities. It is based on the ECLIPSE™/CDT framework and GCC toolchain for the development, and GDB for the debugging. It allows the integration of the hundreds of existing plugins that complete the features of the ECLIPSE™ IDE. A full product description is given HERE.&lt;br /&gt;
&lt;br /&gt;
STM32CubeIDE is used for CutiPy FreeRTOS development. Essential feature descriptions are given below. &lt;br /&gt;
&lt;br /&gt;
=== Supported Systems === &lt;br /&gt;
Windows®, Linux®, and macOS®, 64-bit versions only&lt;br /&gt;
&lt;br /&gt;
===Download===&lt;br /&gt;
STM32CubeIDE can be downloaded [https://www.st.com/en/development-tools/stm32cubeide.html HERE]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Importing a Project =&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
After intalling STM32CubeIDE to your development machine and downloading an EMAC STM32Cube Project (Like CutiPy_FreeRTOS), import the project as follows: &lt;br /&gt;
1. Open the STM32CubeIDE and navigate to the '''Project Explorer''' window. Right click in the empty window and select '''Import...''', to open the '''Import''' window.&lt;br /&gt;
* Select '''General-&amp;gt;Existing Projects into Workdspace''' and click '''Next&amp;gt;''' to advance.&lt;br /&gt;
* Now select '''Browse''' and navigated to the folder containing the dowloaded project. The project will appear in the '''Projects:''' box. Check the box next to the project name, and then select '''Finish''', the project will then be imported.&lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building and Upload =&lt;br /&gt;
===Setup===&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. Connect the ST-Link programmer to the board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
* Power on your board&lt;br /&gt;
* If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
The project now ready to be built and uploaded.&lt;br /&gt;
===Build and Upload===&lt;br /&gt;
[[File:toolbar.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
The project can be built by selecting the hammer symbol on the upper toolbar. The selected build can also be toggled by clicking on the down arrow next to the hammer. The default options available are Debug (a build with debug symbols, and optimizations turned off), and Release (a build with optimizations ON and no debug sybols).  The project can be built and uploaded by selecting the green bug symbol. After upload this will automatically launch the debug perspective, from which debugging can commence.  &lt;br /&gt;
{{note|In current release of the IDE there is no 'upload without launching debug perspective' option available. ALL uploads are accomplished by the green debug symbol, but meaningful debugging can only be accomplished through upload of a Debug build.}}&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
Debugging is accomplished by building and uploading a Debug build. This done by selecting the '''Debug''' build with the down arrow next to the hammer symbol, then selecting the green bug symbol for upload. The debug perspective should launch automatically. if not the debug perspective can be selected by clicking the green bug symbol in the right hand corner.&lt;br /&gt;
&lt;br /&gt;
===Debug Perspective===&lt;br /&gt;
The debug perspective makes available debug options like start, stop, reset, breakpoint set and reset, step into, step over, etc. The following items on the upper tool bar are of particular use:&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
From left to right these symbol accomplish the following:&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. '''Reset the chip and restart the debug session'''  &lt;br /&gt;
* '''Skip all breakpoints'''&lt;br /&gt;
* '''Terminate and relaunch''', This kills the debug session and re uploads the firmware&lt;br /&gt;
* '''Resume'''  (The play symbol), This option becomes available when code execution is suspended. Selecting this option resumes/continues code execution until the next breakpoint is encountered.&lt;br /&gt;
* '''Suspend''' (The pause symbol), This option becomes available while the code is running (after clicking '''Resume'''), Selecting this option pauses code at the next line to be executed.&lt;br /&gt;
* '''Terminate''' kills the debug session&lt;br /&gt;
* '''Disconnect''' disconnects from the current debug session&lt;br /&gt;
* '''Step into'''  -Steps into a function&lt;br /&gt;
* '''Step Over''' Steps over the current line of code&lt;br /&gt;
* '''Return''' If in a function, this option will exit the function and stop at the next line to be executed (continue and stop)&lt;br /&gt;
&amp;lt;/cl&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar2.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
In the upper right hand corner of the debug perspective are additional debug views. From top to bottom these are:&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;cl&amp;gt;&lt;br /&gt;
1. '''variables''' - opening this view while stopped in an active function will reveal variable values and update them as you step through.&lt;br /&gt;
* '''Breakpoints''' -This view shows active breakpoints and their locations. It also allows you to toggle them off and on and delete them.&lt;br /&gt;
* '''expressions''' -Type in an expression (a variable or an equation of variables and constants) and this view will evaluate them for you.&lt;br /&gt;
* '''live expression''' - Updates expression values while the code is running ('live'). Only available with Segger J-link&lt;br /&gt;
* '''SFRs''' - shows values of peripheral registers&lt;br /&gt;
&amp;lt;/cl&amp;gt;&lt;br /&gt;
Other views are available by navigating to the top of the window and selection '''Window-&amp;gt;Show View''' and selecting one of the available views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Setting Breakpoints===&lt;br /&gt;
Breakpoints are set by opening a file in debug perspective and double clicking the line number at which you'd like to place your breakpoint. A blue circle with a checkmark should appear to the left of the line number-This indicates a breakpoint has been set successfully.&lt;br /&gt;
&lt;br /&gt;
[[File:breakpoint.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The breakpoint can be turned off by double clicking line, or by deleting it through the breakpoint view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX and Code Generation ===&lt;br /&gt;
&lt;br /&gt;
Code generation will result if the projects '''.ioc''' file is modified. Double clicking this file will open it through the STM32CubeMX perspective. There the pinout of the device, configured peripherals, middlewares, and clock information will be available. 'Modification' of the baseline settings is not recommended, though 'additions' by the user should be fine. This feature may be used for configuring header pins in alternate function modes (Something other than ANALOG, INPUT, or OUTPUT). Or configuring various other options. After modifying the .ioc file (Changing the setting in STM32CubeMX), code can be generated by clicking the build symbol on the tool bar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Generation of code will result in the build settings and source folders having to be reset through the IDE. Items needing to be re-set include # Symbols (MACROS), Includes and Source Locations located at ''Properties-&amp;gt;C/C++ General-&amp;gt;Paths and Symbols''. These can be uploaded by importing EMACsettings.xml. This will upload the necessary symbols and includes. Source locations will have to be manually added on an individual folder basis or by selecting ''Source Location-&amp;gt;Add Folder-&amp;gt;&amp;lt;root folder&amp;gt;'' and clicking ''OK'', then ''Apply and Close'' }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ Getting started with CutiPy FreeRTOS | Getting started with CutiPy FreeRTOS ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13897</id>
		<title>CutiPy FreeRTOS Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13897"/>
		<updated>2020-03-24T14:50:31Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Brief ==&lt;br /&gt;
This is the documentation page for the CutiPy FreeRTOS hardware-Software release.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
===CutiPy===&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/Manual/CutiPy_User_Manual_v1.20.pdf CutiPy User Manual] &amp;lt;/br&amp;gt;&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/DataSheets/IOT-F407C-CutiPy_Datasheet.pdf CutiPy Data Sheet] &amp;lt;/br&amp;gt;&lt;br /&gt;
===Software===&lt;br /&gt;
[https://www.freertos.org/Documentation/RTOS_book.html FreeRTOS Documentation]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://elm-chan.org/fsw/ff/00index_e.html FatFs] (used with the SD Card)     &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Media:diagramm.png | CutiPy FreeRTOS software diagram]]&lt;br /&gt;
===STM32 Microcontroller===&lt;br /&gt;
[https://www.st.com/resource/en/datasheet/dm00037051.pdf STM32F407 datasheet]&lt;br /&gt;
&lt;br /&gt;
[https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf STM32F407 Reference Manual]&lt;br /&gt;
&lt;br /&gt;
===Redpine Signal RS9116 Radio Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.redpinesignals.com/Products/Hosted_Connectivity/Multi-Protocol_Wireless_SoCs_&amp;amp;_Modules/RS9116_SoCs_&amp;amp;_Modules/RS9116N-SB00-AA1.php RS9116 resources]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[Getting started with CutiPy FreeRTOS | Getting started with CutiPy FreeRTOS]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13892</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13892"/>
		<updated>2020-03-23T22:53:51Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''CutiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ STM32CubeIDE | STM32CubeIDE ]]&lt;br /&gt;
&lt;br /&gt;
[[FreeRTOS | FreeRTOS]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13889</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13889"/>
		<updated>2020-03-23T22:52:24Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''CutiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13886</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13886"/>
		<updated>2020-03-23T22:51:03Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''CutiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=File:TestMenu.png&amp;diff=13885</id>
		<title>File:TestMenu.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=File:TestMenu.png&amp;diff=13885"/>
		<updated>2020-03-23T22:49:04Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13882</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13882"/>
		<updated>2020-03-23T22:48:06Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:TestMenu.png]]&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''CutiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13879</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13879"/>
		<updated>2020-03-23T22:41:15Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind.'''CP_FRTOS.c/h''' contains all FreeRTOS element declarations (Task handles, mutex handle, etc.) Here system level tasks and priorities can be adjusted if needed. '''CutiPy_Config.h''', contains options to turn off the menu to save memory space.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13876</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13876"/>
		<updated>2020-03-23T21:46:27Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13873</id>
		<title>CutiPy FreeRTOS Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13873"/>
		<updated>2020-03-23T21:37:57Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Brief ==&lt;br /&gt;
This is the documentation page for the CutiPy FreeRTOS hardware-Software release.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
===CutiPy===&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/Manual/CutiPy_User_Manual_v1.20.pdf CutiPy User Manual] &amp;lt;/br&amp;gt;&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/DataSheets/IOT-F407C-CutiPy_Datasheet.pdf CutiPy Data Sheet] &amp;lt;/br&amp;gt;&lt;br /&gt;
===Software===&lt;br /&gt;
[https://www.freertos.org/Documentation/RTOS_book.html FreeRTOS Documentation]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://elm-chan.org/fsw/ff/00index_e.html FatFs] (used with the SD Card)     &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Media:diagramm.png | CutiPy FreeRTOS software diagram]]&lt;br /&gt;
===STM32 Microcontroller===&lt;br /&gt;
[https://www.st.com/resource/en/datasheet/dm00037051.pdf STM32F407 datasheet]&lt;br /&gt;
&lt;br /&gt;
[https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf STM32F407 Reference Manual]&lt;br /&gt;
&lt;br /&gt;
===Redpine Signal RS9116 Radio Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.redpinesignals.com/Products/Hosted_Connectivity/Multi-Protocol_Wireless_SoCs_&amp;amp;_Modules/RS9116_SoCs_&amp;amp;_Modules/RS9116N-SB00-AA1.php RS9116 resources]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13870</id>
		<title>CutiPy FreeRTOS Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=CutiPy_FreeRTOS_Documentation&amp;diff=13870"/>
		<updated>2020-03-23T21:35:31Z</updated>

		<summary type="html">&lt;p&gt;CBost: /* Redpine Signal RS9116 Radio Module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Brief ==&lt;br /&gt;
This is the documentation page for the CutiPy FreeRTOS hardware-Software release.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
===CutiPy===&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/Manual/CutiPy_User_Manual_v1.20.pdf CutiPy User Manual] &amp;lt;/br&amp;gt;&lt;br /&gt;
[ftp://ftp.emacinc.com/SBC/IOT-F407C-CutiPy/DataSheets/IOT-F407C-CutiPy_Datasheet.pdf CutiPy Data Sheet] &amp;lt;/br&amp;gt;&lt;br /&gt;
===Software===&lt;br /&gt;
[https://www.freertos.org/Documentation/RTOS_book.html FreeRTOS Documentation]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://elm-chan.org/fsw/ff/00index_e.html FatFs] (used with the SD Card)     &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Media:diagramm.png | CutiPy FreeRTOS software diagram]]&lt;br /&gt;
===STM32 Microcontroller===&lt;br /&gt;
[https://www.st.com/resource/en/datasheet/dm00037051.pdf STM32F407 datasheet]&lt;br /&gt;
&lt;br /&gt;
[https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf STM32F407 Reference Manual]&lt;br /&gt;
&lt;br /&gt;
===Redpine Signal RS9116 Radio Module===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.redpinesignals.com/Products/Hosted_Connectivity/Multi-Protocol_Wireless_SoCs_&amp;amp;_Modules/RS9116_SoCs_&amp;amp;_Modules/RS9116N-SB00-AA1.php RS9116 resources]&lt;br /&gt;
&lt;br /&gt;
===Peripheral Hardware datasheets===&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13867</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13867"/>
		<updated>2020-03-23T16:12:34Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
{{note|COM A, the DB9 port may also be used for establishing an RS232 serial connection. It is configured for a baud rate of 115200.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=File:Serial.png&amp;diff=13866</id>
		<title>File:Serial.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=File:Serial.png&amp;diff=13866"/>
		<updated>2020-03-23T16:09:53Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13863</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13863"/>
		<updated>2020-03-23T16:09:31Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
[[File:serial.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
{{note|COM A, the DB9 port may also be used for establishing an RS232 serial connections. It is configured for a baud rate of 115200.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13860</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13860"/>
		<updated>2020-03-23T16:03:50Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
* Using a serial terminal program like '''Putty''' or '''Tera Term''' connect to the port at a baud rate of 115200. &lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
{{note|COM A, the DB9 port may also be used for establishing an RS232 serial connections. It is configured for a baud rate of 115200.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13857</id>
		<title>Getting Started with CutiPy and FreeRTOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Getting_Started_with_CutiPy_and_FreeRTOS&amp;diff=13857"/>
		<updated>2020-03-23T15:59:20Z</updated>

		<summary type="html">&lt;p&gt;CBost: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Getting Started with CutiPy and FreeRTOS&lt;br /&gt;
|titlemode=append&lt;br /&gt;
|keywords=Cutipy Getting Started&lt;br /&gt;
|description=The following page can be used to get familiarized with the Cutipy.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /****************************************  Page Description Text  ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
This page outlines a basic guide to getting starting using the Cutipy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /***************************************** Background Information ****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  General Information  *****************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:geninfo | initials=BS | title=Cutipy Getting Started | desc=The following page can be used to get familiarized with the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
=== Tools Required ===&lt;br /&gt;
*Desktop PC (Windows/Linux/Mac will work)&lt;br /&gt;
*Micro-USB to USB Cable&lt;br /&gt;
*ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 with JTAG 20 pin to SWD 10pin adaptor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup === &lt;br /&gt;
1. Download and install [https://www.st.com/en/development-tools/stm32cubeide.html STM32CubeIDE] (The IDE used for CutiPy FreeRTOS development, For more information on the STM32CubeIDE click [[STM32CubeIDE | HERE]]) &amp;lt;/br&amp;gt;&lt;br /&gt;
2. Download EMAC's CutiPy FreeRTOS project master branch [http://git.emacinc.com/FreeRTOS/CutiPy_FreeRTOS HERE]&amp;lt;/br&amp;gt; &lt;br /&gt;
3. Connect the ST-Link programmer to the CutiPy board for programming &amp;lt;/br&amp;gt;&lt;br /&gt;
*''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 provided USB cable'' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Connect your CutiPy to Desktop using the micro-USB to USB cable. Your board is now powered. &amp;lt;/br&amp;gt;&lt;br /&gt;
5. Open STM32CubeIDE and import the CutiPy FreeRTOS project &amp;lt;/br&amp;gt;&lt;br /&gt;
*If needed, upgrade your ST-LINK firmware by navigating to '''Help''' and selecting '''ST-LINK Upgrade'''. The ST Link upgrade window will open. Select '''refresh device list''', and then select '''Open in update mode''', and finally '''Upgrade''' &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:STLinkUpgrade.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
6. Build and upload the firmware &amp;lt;/br&amp;gt;&lt;br /&gt;
*''To build and upload select the debug symbol (To just build select the hammer symbol)''. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:DebugToolbar1.png]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*****************************************  Using/Working With  ******************************************/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- /*********************************************************************************************************/ --&amp;gt;&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title=Developing with the Cutipy | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
1.The baseline CutiPy FreeRTOS build has now been uploaded. Connect to the USB virtual com port on a serial terminal using Putty or TerraTerm. The USB virtual com port driver should install automatically after plugging the CutiPy to your PC. After successful installation of the driver '''STMMicroelectronics Virtual COM Port''' should be displayed as an available port. Connect to it as you would any normal serial port. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:USBcomPORT.png]]&lt;br /&gt;
&lt;br /&gt;
{{note|The USB virtual com port will adjust it's baud rate to that selected by the terminal. It has been tested to work with standard baud rate selections from 110 to 921600.}}&lt;br /&gt;
&lt;br /&gt;
2.After connecting the CutiPy FreeRTOS menu will be displayed. Navigate to tests for a demonstration of CutiPy functionality.&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:using | initials=BS | title='''EMAC CutiPy FreeRTOS Software Description''' | desc=The following page can be used to get familiarized with Micropython the Cutipy. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Layout ===&lt;br /&gt;
&lt;br /&gt;
The CutiPy_FreeRTOS project was developed using the STM32CubeIDE. It contains auto-generated program files and code along with custom files/folders provided by EMAC.&lt;br /&gt;
{{note|editing of auto-generated code blocks and files should be avoided as these portions of the project will be overwritten if the auto-code generation feature of STM32CubeIDE is used (STM32CubeMX). Instead we recommend the user create their own custom folders in the project or just use the EMAC provided folder, '''CutiPy_User''' for project development.}}&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
Custom EMAC folder include: &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_Drivers''' provides custom written EMAC driver functions geared towards use with the CutiPy device. All functions are documented in their respective source files, hence the user should look here for function usage-rules and functionality. The functions written at a CutiPy module (COM A, COM B, SD_CARD, RS9116 radio, etc.) or individual driver level and were written with ease of use in mind. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''CutiPy_Tasks''' contains the header and source files for the CutiPy freeRTOS for all EMAC provided system tasks. Task descriptions are provided in their respective source files &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''CutiPy_User''' is an empty project folder dedicated for use by the user.&lt;br /&gt;
*'''RS9116_1_2_1''' and ''''''RS9116_1_2_1/examples/utilities''' contain driver files for the Redpine Signals RS9116 radio module.&lt;br /&gt;
&lt;br /&gt;
The only folders of real importance to the user is the CutiPy_Drivers folder. In addition to containing key driver functions it also contains CP_FRTOS.c that lists system task&lt;br /&gt;
priority, handle and size, and &lt;br /&gt;
&lt;br /&gt;
Other project folders include:&lt;br /&gt;
&lt;br /&gt;
*'''Middlewares'''- contains source files for the USB Virtual Com Port, fatfs (used mainly in conjuction with the sd card), and FreeRTOS.  &amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Drivers'''     -contains STMicroelectronic's driver files. The user should look here for driver functionality not covered by the provide emac driver files&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Src'''         -contains initialization functions, and '''main.c'''&amp;lt;/br&amp;gt;&lt;br /&gt;
*'''Inc'''         -contains various include files, but the only one of primary importance  '''FreeRTOSConfig.h''' file  &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Software Overview ===&lt;br /&gt;
[[File:diagrammm.png]]&lt;br /&gt;
&lt;br /&gt;
CutiPy RTOS system-level tasks and synchronization have been provided by EMAC to ease user development.&lt;br /&gt;
&lt;br /&gt;
=== Feature Description ===&lt;br /&gt;
EMAC has provided custom driver functions for the CutiPy's main peripherals. These are located under '''CutiPy_Drivers'''. See the source files for function descriptions. All of EMAC's custom functions will be prefixed by '''CP_''' followed by the the '''DRIVER_NAME'''. Functions with the prefix '''CP_FRTOS''' utilize an RTOS element and should only&lt;br /&gt;
be called with the scheduler running. We recommend user files be added to the '''CutiPy_User''' or that the user add their own custom folders, and not modify the project code directly. EMAC has provide custom system tasks to ease CutiPy use and jump-start user development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ADCs'''- The CutiPy utilizes the STM32F407's 3 internal ADCs. Thirteen ADC pins are available to the user on HDR2. '''CP_ADC.c''' CP_FRTOS functions provide thread safe functionality through mutex control of the 3 ADC's. Aside from 'external' pin sampling this driver file also provide functions for sampling the internal temp sensor, the ram back up battery voltage, and the internal reference voltage (used for calculating the voltage from a raw read)&lt;br /&gt;
&lt;br /&gt;
'''BATTERIES''' -The CuitPy has the option of being powered by an external 3.7 V 1200mah lithium ion rechargeable battery (EMAC Part#: PER-PWR0101PR0). It also has an onboard, jumper-enable 3.3V RTC-Ram Retention battery (See the CutiPy User Manual for more information. '''CP_BATTERIES.c''' contains functions for reading these battery voltages.&lt;br /&gt;
&lt;br /&gt;
''''BUTTONS''' - Depending on the model of your CutiPy there can be up to 5 buttons, 1 Reset button + 4 user buttons (PB1 through PB4). All user buttons except PB3 are interrupt driven (rising and falling edge), hence there respective tasks block (don't run) until the interrupt is generated. PB3 is polled intermittently enough to avoid missed presses, but not so much as to block out other tasks.  Callback functions are provided in '''CP_BUTTONS.C'''. The user may simply edit these functions directly, to implement unique callback functionality. Button Tasks are located in '''C&lt;br /&gt;
&lt;br /&gt;
'''CAN'''-CAN communication is provided through HDR4 CAN1. The CAN1 subsystem consists of the STM32407's onboard CAN1 module an external CAN tranceiver (TCAN334GDCNT). '''CP_CAN.c''' contains easy-to-use functions for message reception/transmission, and module/tranceiver mode manipulation. An example use function is also included, as well as an internal loopback test. Note CAN1 is currently configured for baud rate of 500kHz.&lt;br /&gt;
&lt;br /&gt;
'''COM_A''' COM_A consists of UART2 routed to an external RS-232 transceiver connected to the CN2 (The DB9 port). It is configured for baud rate of 115200. '''CP_COM_A.c''' provide driver functions for transceiver configuration and message transmission and reception. Two seperate mutexes are provided (CP_COM_A_RX_RecursiveMutexHandle and CP_COM_A_TX_RecursiveMutexHandle).    &lt;br /&gt;
&lt;br /&gt;
'''COM_B''' COM_B consists of UART3 an RS232 transceiver and an RS422/485 transceiver. The active transceiver is user selectable, and only one can be active at a time. '''CP_COM_B.c''' provides driver functions for message transmission/receipt and transceiver selection. For thread safe usage a mutex is provided (CP_COM_B_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''DACs''' The STM32F407 two digital analog converter channels are available on HDR2, pins 20 and 21. Driver functions are provided '''CP_DAC.c'''. &lt;br /&gt;
&lt;br /&gt;
'''DARLINGTON OPEN COLLECTOR DRIVERS'''   Eight gpios are connected and control 8 darlington pair open collector transistors. The Darlington pair transistors have superior current sinking capabilities when compared to the on-board GPIOs. (See the ULN2803A datasheet for more information). A pull-up resistor connects the Collector end of the Darlington transistor to V_HIDRV-This is left floating, but can be used by the user to enable digital toggling between GND and V_HIDRV. With V_HIDRV left unconnected the darlington transistor is used as a switch, that sinks current in the ON position. '''CP_DARLINGTON_OC.c''' provides functions for setting/resetting. Thread safe control is achieved through the use of mutexes(CP_DARLINGTON_OC_PGX_RecursiveMutexHandle).&lt;br /&gt;
&lt;br /&gt;
'''LCD''' On some models of the CutiPy an NHD-C12832A1Z-FSW-3V3 Liquid Crystal Display (LCD) Module is available for the display of text and simple images. The LCD communicates with the MCU via SPI2. '''CP_LCD.c''' contains functions for displaying text, writing individual pixels, issuing commands, etc. Note that mutex control of SPI2 is required as it is shared between the radio module and the LCD module. This feature has already been implemented by EMAC, thus all LCD and radio functions can be used together, from multiple threads/tasks without worrying about conflict.&lt;br /&gt;
&lt;br /&gt;
'''LEDs'''  Four LEDs are present on the CutiPy board (LD1 - LD4). They are controlled through the toggling of GPIO outputs on the MCU. '''CP_LEDs.c''' contains easy to use function for the controlling the LEDs (ON, OFF, Toggle)&lt;br /&gt;
&lt;br /&gt;
'''RNG''' The STM32F407 true random number generator (RNG) is pre-initialized. The RNG generates 32 bit random numbers. '''CP_RNG.c''' contains simple 'get value' functions. The radio utilizes the RNG for certain encrpytion purposes, for this reason CP_FRTOS_GetRandomValue() should be use for thread-safe access.&lt;br /&gt;
&lt;br /&gt;
'''RS9116 Wireless Module'''  The external RS9116 Wireless Module enables the development of Bluetooth Low Energy (BLE), Bluetooth (BT) and WLAN applications. In WLAN mode the RS9116 is able function as an access point or a client. The module also has the ability to operate in dual mode (WLAN +BLE). '''RS9116.c''' contains initialization functions for the radio, as well as basic use functions like connect/disconnect and sleep. Other functions and advanced usage is covered in the RS9116 documentation. &lt;br /&gt;
&lt;br /&gt;
'''MicroSD Card'''  The CutiPy comes with a MicroSD slot.The CutiPy_FreeRTOS build comes with FatFs for the manipulation of files (See the FatFs documentation for more information). A Demo functions are provided in '''CP_SD_CARD.c'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
===Documentation===&lt;br /&gt;
&lt;br /&gt;
[[CutiPy_FreeRTOS_Documentation | CutiPy FreeRTOS Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }}&lt;br /&gt;
&lt;br /&gt;
[http://git.emacinc.com/micropython-public/micropython-doc CutiPy Micropython Documentation]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy_Test | Cutipy Test Software ]]&lt;br /&gt;
&lt;br /&gt;
[[ Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo ]] &lt;br /&gt;
&lt;br /&gt;
[[ Micropython | Micropython ]]&lt;br /&gt;
&lt;br /&gt;
[[CutiPy-Installing_MicroPython_Firmware | CutiPy-Installing Micropython Firmware]]&lt;/div&gt;</summary>
		<author><name>CBost</name></author>
		
	</entry>
</feed>