From a6af52475d525556d9e004d4d6d6c1eb60247176 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Thu, 8 Mar 2018 14:28:07 +0000 Subject: [PATCH] Refs #489. Added readme to LibOpenBLT's Pascal bindings. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@440 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- .../LibOpenBLT/bindings/pascal/README.md | 43 +++++++++++++++++++ .../LibOpenBLT/bindings/python/README.rst | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Host/Source/LibOpenBLT/bindings/pascal/README.md diff --git a/Host/Source/LibOpenBLT/bindings/pascal/README.md b/Host/Source/LibOpenBLT/bindings/pascal/README.md new file mode 100644 index 00000000..f2c933da --- /dev/null +++ b/Host/Source/LibOpenBLT/bindings/pascal/README.md @@ -0,0 +1,43 @@ +### Pascal wrapper for LibOpenBLT +The OpenBLT Host Library ([LibOpenBLT](https://www.feaser.com/openblt/doku.php?id=manual:libopenblt)) contains an application programming interface (API) for communicating with a microcontroller target, running the OpenBLT bootloader, for making firmware updates on the target. The goal of the OpenBLT Host Library is to empower you to quickly and efficiently create your own firmware update tool, in case you don’t prefer the standard MicroBoot and BootCommander tools that are included in the OpenBLT bootloader package. + +This directory contains the pascal wrapper for LibOpenBLT, which enables you to quickly develop your own firmware update tool in the Pascal programming language, for example with the [Lazarus IDE](https://www.lazarus-ide.org/) or [Delphi](https://www.embarcadero.com/products/delphi). + +### Using the wrapper +To use the Pascal wrapper for LibOpenBLT, copy the file **openblt.pas** from this directory to where you have the sources of your Lazarus or Delphi project. Next, add **OpenBlt** to your unit's **uses** section. Now you can call all the **BltXxx** functions and procedures of LibOpenBLT. + +Here is a minimal pascal console program that demonstrates how to display the version of LibOpenBLT: + +```pascal +program MyBootTool; + +uses OpenBlt; + +begin + writeln('LibOpenBLT version: ' + BltVersionGetString); +end. +``` + +### Run-time libraries +Copy the LibOpenBLT related run-time libraries into the directory where your program's executable is located. Refer to the following section on the OpenBLT Wiki for a overview of these run-time libraries: + +https://www.feaser.com/openblt/doku.php?id=manual:libopenblt#run-time_libraries. + +These run-time libraries can be found in the ./Host directory of the OpenBLT bootloader package. These run-time libraries should also be included, when distributing your program. + +### Lazarus specifics on Linux +When running your program under Linux, you will most likely get the following error: +``` +error while loading shared libraries: libopenblt.so: cannot open shared object file. +``` +As opposed to Windows, Linux does not add the directory that your program is running from to the search path (LD_LIBARY_PATH). This is the reason why it cannot locate the LibOpenBLT run-time libraries. + +This can easily be solved by adding the program's directory to the search path in the settings of your Lazarus project. + +- From the Lazarus menu select: **Project -> Project Options..** +- Go to the section **Compiler Options -> Compilation and Linking** +- Check the checkbox **Pass options to linker with "-k", delimiter is space** +- Enter the following in the edit box underneath the checkbox: +``` +-R ./ +``` diff --git a/Host/Source/LibOpenBLT/bindings/python/README.rst b/Host/Source/LibOpenBLT/bindings/python/README.rst index e9b091dd..c7b12837 100644 --- a/Host/Source/LibOpenBLT/bindings/python/README.rst +++ b/Host/Source/LibOpenBLT/bindings/python/README.rst @@ -38,4 +38,4 @@ Copy the LibOpenBLT related run-time libraries into your python program's direct https://www.feaser.com/openblt/doku.php?id=manual:libopenblt#run-time_libraries. -These run-time libraries can be found in the .\Host directory of the OpenBLT bootloader package. These run-time libraries should also be included, when distributing your program. +These run-time libraries can be found in the ./Host directory of the OpenBLT bootloader package. These run-time libraries should also be included, when distributing your program.