- Muchas notas - Fran Acién

20230331 - CSP

Getting started

  1. Update Cmake in your system
  2. Clone libcsp and go to the downloaded directory
  3. Run sudo apt-get install libzmq3-dev libsocketcan-dev meson
  4. Run python3 ./examples/buildall.py posix --build-system=meson
  5. And then go to build/examples
  6. Run ./csp_server_client

Other way to compile the library:

cmake -GNinja -B builddir
cd builddir
ninja

CCSDS and CSP

CSP provides the equivalent of OSI layers 1, 2, 3 and optionally 4.

The CCSDS recommendations have different documents for each of these
layers.

The first layer is the physical layer:
CCSDS 131.0-B-2
TM Synchronization and Channel Coding.

The second layer is the data-link layer:
CCSDS 132.0-B-1
TM Space Data Link Protocol.

And the third layer is the network layer:
CCSDS 133.0-B-1
Space Packet Protocol.

The above publications can be found here:
http://public.ccsds.org/publications/SLS.aspx

CCSDS Space Packet protocol is OSI Layer 2, Data Link Layer.

It seems that a valid option could be to inject CCSDS packets inside CSP.

CSP On ESP32 System example

Here are some general steps that you can follow to compile the Cubesat Space Protocol (CSP) for the ESP32 using the ESP-IDF:

  1. Install the ESP-IDF: Before you can begin compiling CSP for the ESP32, you will need to install the ESP-IDF toolchain and development environment on your computer. You can follow the instructions in the ESP-IDF documentation to set up your development environment.
  2. Download the CSP source code: You can download the CSP source code from the official CSP repository on GitHub. Make sure to download the version of CSP that is compatible with your ESP-IDF version.
  3. Add CSP to your project: Once you have downloaded the CSP source code, you can add it to your ESP-IDF project by copying the relevant source files to your project directory.
  4. Configure your project: You will need to configure your ESP-IDF project to include the necessary libraries and dependencies for CSP. This may involve modifying your CMakeLists.txt file and adding the relevant components and libraries to your project configuration.
  5. Build and flash your project: Finally, you can build and flash your ESP32 project using the ESP-IDF tools. You will need to use the make command to build your project, and the idf.py flash command to flash it to your ESP32 device.
cd
git clone -b v5.0.1 --recursive https://github.com/espressif/esp-idf.git esp-idf-v5.0.1
cd esp-idf-v5.0.1/
bash install.sh

After a looooot of hours wihtout being able to compile the project, I have some outputs:

  • It is necessary to run the esp-idf framework and not arduino because on the compiling process it is necessary to run cmake. doc about cmake and espidf

I used this documentation to learn how to compile a Library on Cmake. https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20a%20Library.html

UPDATE 04042023:

After talking with Nicolai there are some conclusions:

  1. I need to cross compile the library for Freertos with the ESP32 architecture
  2. Basically ies the libcsp/libcsp-freertos but not on a POSIX machine port of freertos, but on a esp32 port of freertos.

After 2 days trying to compile the project I have some conclusions:

  • It is very difficult to compile CSP in ESP32 because the freertos distributions is not compiling
  • Maybe is easier to use another port like in AVR
  • I tried to compile for atmega teh freertos, but I had a lot of errors

In general the complexity of the project increases a lot because of the use of freertos on the framework of the vendor of the microcontroller.