Exporting Applications from Pictorus
Pictorus allows users to export their applications manually instead of using the built in device manager as described in Getting Started with Devices.
This feature is accessed from the "Export App" tab on the left pane of the Pictorus interface. There you may select the "Platform", "Target", and "Output" desired for exporting.
After selecting your desired options you can press "Build" and Pictorus will build your desired output and then offer a link to download the output using the "Download Binary" link.
Additionally, there is a link "Download Source" that provides a zip file of the Rust source code for the application. This functionality is currently in beta and subject to change. For this reason it is restricted to select customers that we have been able to work with directly. If you would like to be included in this beta please reach out to us.
Target
Currently, "Target" can be Linux or Stm32. Support for additional targets is in the works, feel free to reach out if you don't see a target you need and we can discuss what it would take to add support.
Platform
For the Linux target we offer the choice of "LinuxX86" or "LinuxARM". Intel and AMD hardware should use "LinuxX86", while most single board computers and ARM based macs running linux should use "LinuxARM".
Output
All platforms support export as a complete executable or as a static library with C bindings. The LinuxX86 platform additionally supports exporting as a dynamic library with C bindings.
Executable Output
In the case of Linux targets this will output an executable elf file that can be directly run on the target device. For Stm32 targets this will output a binary file that can be flashed to the target device. These are the same binaries that would be deployed to the device using the Pictorus device manager.
Library Output
Currently all static and dynamic library outputs are included with the source code for the application and as such is subject to the same beta restrictions as the source code download. After successful compilation the zip file available at the "Download Source" link will additionally include the compiled .a
(static) or .so
(dynamic) library artifact, a C header file defining its interface and finally a simple example C program that demonstrates usage of the library.
The header file is defined as below:
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
typedef struct AppInterface AppInterface;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
AppInterface *app_interface_new(void);
void app_interface_free(struct AppInterface *app);
void app_interface_update(struct AppInterface *app, double app_time_s);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
It defines a simple interface to the pictorus application. The app_interface_new
function creates a new instance of the application, app_interface_free
frees the instance, and app_interface_update
updates the application state. The app_time_s
parameter is defined as the time in seconds since the application started.
The included exemplar .c
file also has a comment at the top that explains provides an example command to compile and link the library with the example program.