Unable to build XDot examples

I am trying to build and run some of the Xdot examples from GitHub - MultiTechSystems/dot-examples: Example programs for MultiTech Dot devices demonstrating how to use the Dot devices and the Dot libraries for LoRa communication.

I verified the MBED OS version. I carefully follow the instructions to import the project and add the library. I also updated the MBED OS version carefully to match the version of the library. I get the following link errors if I try to build with stable version of library. I

Error: L6218E: Undefined symbol mts::Text::bin2hexString(std::__2::vector<unsigned char, std::__2::allocator > const&, char const*, bool, bool) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setNetworkId(std::__2::vector<unsigned char, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setNetworkKey(std::__2::vector<unsigned char, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setNetworkName(std::__2::basic_string<char, std::__2::char_traits, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setDataSessionKey(std::__2::vector<unsigned char, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setNetworkAddress(std::__2::vector<unsigned char, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setNetworkPassphrase(std::__2::basic_string<char, std::__2::char_traits, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::setNetworkSessionKey(std::__2::vector<unsigned char, std::__2::allocator > const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol mDot::send(std::__2::vector<unsigned char, std::__2::allocator > const&, bool const&, bool const&) (referred from BUILD/XDOT_L151CC/ARMC6/examples/src/dot_util.o).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::compare(unsigned int, unsigned int, char const*, unsigned int) const (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::__vector_base_common::__throw_length_error() const (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::__init(char const*, unsigned int) (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::append(char const*, unsigned int) (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::assign(char const*) (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::~basic_string__sub_object() (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::operator=(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) (referred from ./libxdot/libxDot-ARMC6.ar(mDot.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::find_first_of(char const*, unsigned int, unsigned int) const (referred from ./libxdot/libxDot-ARMC6.ar(MTSText.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::find(char, unsigned int) const (referred from ./libxdot/libxDot-ARMC6.ar(MTSText.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::append(char const*) (referred from ./libxdot/libxDot-ARMC6.ar(MTSText.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::push_back(char) (referred from ./libxdot/libxDot-ARMC6.ar(MTSText.o)).
Error: L6218E: Undefined symbol std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned int, unsigned int, std::__1::allocator const&) (referred from ./libxdot/libxDot-ARMC6.ar(MTSText.o)).
Finished: 0 information, 1 warning and 22 error messages.

I try with developer version of library and get compiler error. Unable to find “Random_Channel.h” file

Could you please help me in running the Dot examples?

Hi,

I cloud reproduce the error. When I use GCC to build the example project, I’ve got no error (I am using CLI for build), but Arm compiler build generated errors below:

$ mbed compile -m XDOT_L151CC -t arm    
[mbed] Working path "/Users/toywat01/dev/dot-examples" (program)
Building project dot-examples (XDOT_L151CC, ARMC6)
Scan: dot-examples
Using ROM regions bootloader, application in this build.
  Region bootloader: size 0xcf00, offset 0x8000000
  Region application: size 0x33000, offset 0x800d000
Link: dot-examples
[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
[Error] @0,0: L6218E: Undefined symbol mts::Text::bin2hexString(std::__2::vector<unsigned char, std::__2::allocator<unsigned char> > const&, char const*, bool, bool) (referred from BUILD/XDOT_L151CC/ARM/examples/src/dot_util.o).
[Error] @0,0: L6218E: Undefined symbol mDot::setNetworkId(std::__2::vector<unsigned char, std::__2::allocator<unsigned char> > const&) (referred from BUILD/XDOT_L151CC/ARM/examples/src/dot_util.o).

(snip)

I also found that closed issue in the libxDot repo here:

This is very similar case, but version down for MbedStudio is not good workaround as valid license always support latest version.

Maybe you can raise new issue here: Issues · MultiTechSystems/libxDot · GitHub

Thanks,
Toyo

Thank you soo much @MACRUM

Sorry, this might be a silly question since I am a rookie. Could you please let me know the command i need to use with Mbed CLI to compile with gcc? Any steps I need to follow?

Also, if possible, could you please let me know how I can get older versions of MBED studio?

Regards
Sachin

Hi Sachin,

Could you please let me know the command i need to use with Mbed CLI to compile with gcc? Any steps I need to follow?

Installation steps are described here:
https://os.mbed.com/docs/mbed-os/v6.15/build-tools/install-and-set-up.html

  • Download and install python 3.7.x
  • Download and install git
  • Install mbed-cli as below (don’t use the installer, it is very old)
python3 -m pip install mbed-cli

Build the example

$ mbed import https://github.com/MultiTechSystems/dot-examples
$ cd dot-examples/examples
$ mbed add https://github.com/MultiTechSystems/libxDot
$ cd libxDot
$ mbed update 4.0.1
$ cd ../../
$ mbed compile -m XDOT_L151CC -t gcc_arm

I hope this helps.

Regards,

Toyo

Hi Toyo,

Thanks a Lot for your detailed information.

I followed the steps religiously. However, when I compile the examples using the command below

mbed compile -m XDOT_L151CC -t gcc_arm

I get that some python library is not installed. It tries to auto install
Auto-installing missing Python modules (jsonschema, mbed_cloud_sdk, pyelftools, manifest_tool, icetea, pycryptodome, pyusb, hidapi, cmsis_pack_manager, pywin32, wmi, psutil, cryptography, click, cbor).

and later I get the below error

I run “pip install -r requirements.txt” to satisfy, but it says it is already satisfied

In fact this is a known issue : mbed deploy auto installs missing Python modules · Issue #945 · ARMmbed/mbed-cli · GitHub
Could you please help me with this, I am stuck on this all day

Regards
Sachin

Hi Sachin,

I run “pip install -r requirements.txt” to satisfy, but it says it is already satisfied

hmm, In that case, I recommend to use virtualenv.

# install
C:\> python3 -m pip install virtualenv
# setup
C:\Users\user1> python3 -m virtualenv py3env
#activate
C:\Users\user1> C:\Users\user1\py3env\Scripts\activate.bat

And then, you can install mbed-cli and other python modules.

python3 -m pip install mbed-cli
python3 -m pip install -r mbed-os/requrements.txt

Thanks,
Toyo

Thank you so much Toyo for your immediate response.

I just tried it. It is showing me that it cannot install pywin32 library.

Could you please let me know if I am missing anything? Also, could you please assist if there is any proven procedure to compile with the latest version of libraries and MBED OS version?

Regards
Sachin

Hi Sachin,

I am not using Windows platform, but I think the pywin32 is not mandatory required for application build. You can just comment out the pywin32 from requrements.txt file and install rest of modules.

could you please assist if there is any proven procedure to compile with the latest version of libraries and MBED OS version?

If you use published version of example code by others, you don’t need to change the mbed-os (and other library) version, because they are (should be) tested the version. To checked the library version, you can use mbed ls command in your project file. For example, I’ve got information below:

$ mbed ls
[mbed] Working path "/Users/toywat01/dev/dot-examples" (program)
dot-examples (#8492d740b3f9)
|- examples/lib/ISL29011 (#953adca17438, tag: tip)
|- examples/libxDot (#d07c6a8801ab, tag: 4.0.1)
`- mbed-os (#a6207cadad0a, tags: mbed-os-6.1.0, mbed-os-6.1.0-rc1)

If you are really confident to update library version, you can use mbed update command.

cd mbed-os 
mbed update mbed-os-6.16.0
cd ..

Thanks,
Toyo

hi Toyo,

My MBED studio version is 1.4.4
Compiler is ARM C6 - (XDOT_L151CC, ARMC6)

I imported xdot examples from GitHub - MultiTechSystems/dot-examples: Example programs for MultiTech Dot devices demonstrating how to use the Dot devices and the Dot libraries for LoRa communication.

I imported the library in Mbed Studio from GitHub - MultiTechSystems/libxDot: Stable version of the xDot library for mbed-os. This version of the library is suitable for deployment scenarios. - selected the version as 4.1.4

MBED OS is 6.1.6

Selected build profile for debug, develop and release versions

I get the same error.

Could you please help me where I am doing wrong? Is there any github repository where everything runs smoothly? I am stuck with this for a long time and unable to start working with my Xdot board.

Regards
Sachin

I am very grateful for your help.

There is also no published version of others for windows platform. Could you please help me get a version which works?

I remove pywin32, I get the below issue

I am worried about this.

Regards
Sachin

Hi Sachin,

Could you please help me where I am doing wrong? Is there any github repository where everything runs smoothly?

The problem seems to be missing symbols in the static library (libxDot-ARMC6.ar) for ARM compiler build. Since we can not access the source code of this library (probably it is MultiTech’s property), we cannot get build the example by ARMC6 (i.e. MbedStudio).

Two possible workarounds:

I remove pywin32, I get the below issue

Your log shows that you are not activating virtualenv and wrongly using Python 2.7.x. Can you check my early post?

Regards,
Toyo

Hi Toyo,

I tried the below steps using a published version

download and install
https://github.com/ARMmbed/mbed-cli-windows-installer/releases/download/v0.4.10/Mbed_installer_v0.4.10.exe
download and install
https://developer.arm.com/-/media/Files/downloads/compiler/DS500-BN-00024-r5p0-15rel0.zip
mbed import http://os.mbed.com/teams/L-TEK/code/Dot-Examples/
cd Dot-Examples
mkdir libxDot-dev-mbed5
download and unzip
https://github.com/MultiTechSystems/libxDot-dev-mbed5/tree/9f5eab049dc97f9a0ab12219e9871c60f7efb427
mbed add mbed-os-5.6.2
modify example_config.h to run OTA_EXAMPLE
modify ota_example.cpp deep_sleep=true public_network=true and change
network ID and network key and make it use those
mbed compile -m XDOT_L151CC -t GCC_ARM

It worked for me. Thanks a lot for your support!

Thanks
Sachin