Skip to content
/ mtos Public

memory transfer over serial (uart) for espressif devices (esp-idf)

Notifications You must be signed in to change notification settings

javoerro/mtos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MToS - Memory Transfer over Serial

MToS is a library for the ESP-IDF framework that enables the transfer of memory blocks between two ESP32 devices using the UART (Universal Asynchronous Receiver-Transmitter) serial communication protocol. It provides a convenient and efficient way to exchange data between devices over a serial connection.

Features

  • Efficient transfer of memory blocks over UART.
  • Supports both blob (arbitrary data) and array (fixed-size element) transfers.
  • Various string and memory manipulation functions available for data processing.
  • Seamless integration with the ESP-IDF framework.
  • Simplified API for easy usage and configuration.
  • Operates on a master/slave scheme, allowing independent functionality for each shared memory block.

Requirements

  • ESP-IDF framework (version 4.4.3 or higher)
  • Two ESP32 devices with UART interfaces.
     ESP32 #1                   ESP32 #2
+---------------+          +---------------+
|               |          |               |
|    GPIO TX    |--------->|    GPIO RX    |
|    GPIO RX    |<---------|    GPIO TX    |
|               |          |               |
+---------------+          +---------------+

Installation

  1. Clone the MToS repository:
git clone https://github.com/javoerro/mtos.git
  1. Test the exaple or copy components/mtos into your project

  2. Run 'menuconfig' to configure library parameters, such as the UART GPIOs to be used, among others.

  3. Build and flash your ESP32 project as usual using the ESP-IDF build system.

Usage

  1. Include the MToS library header file in your source code:
#include "mtos.h"
  1. Initialize the MToS library and UART communication:
mtos_init(evt_callback);
  1. Create memory blocks and arrays for data transfer:
mtos_new_blob(name, length, slave, trigger, pattern);
mtos_new_array(name, n, size, slave, trigger, pattern);

The lookup of memory blocks is performed using pre-shared trigger and pattern keys

  1. Request data block from remote device:
//only from master
mtos_call(name, timeout_ms, max_chunk_size);
  1. Access and manipulate memory blocks:
mtos_grab_mb(name, ticks, &ptr, &length);
mtos_return_mb(name);
  1. Perform various string and memory operations:
mtos_strcat(name, src);
mtos_strchr(name, chr);
mtos_strcmp(name, src);
mtos_strcpy(name, src);
mtos_strlen(name);
mtos_strncat(name, src, n);
mtos_strncmp(name, src, n);
mtos_strncpy(name, src, n);
mtos_strpbrk(name, src);
mtos_strrchr(name, chr);
mtos_strstr(name, src);
mtos_strtok(name, src);
mtos_memset(name, chr, n);
mtos_memcpy(name, src, n);
mtos_memmove(name, src, n);

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please create an issue in the GitHub repository. Pull requests are also encouraged.

About

memory transfer over serial (uart) for espressif devices (esp-idf)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published