This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/MSPBSL: Building BSL Scripter for ARM Embedded Linux Processor

Part Number: MSPBSL

Tool/software: Linux

Hi,

i want to use the BSL-Scripter on an embedded ARM machine running debian.

How do i build my own scripter on this machine using the source code provided for a linux 32Bit?

On the readme.txt file i found this:

2. Linux
-------------------------------------------------------------------------------
2.1 Development environment
-------------------------------------------------------------------------------
* You will need the GNU tool chain (GCC 4.6.3 or higher) to use the
existing Makefile.
-------------------------------------------------------------------------------
2.2. Dependencies
-------------------------------------------------------------------------------
In order to compile the BSL Scripter with GCC you will need:

* boost
-Download from http://www.boost.org
-Version used in official build is 1.56
-Only libboost_system.a/so and libboost_filesystem.a/so
libboost_program_options-xxx.a/so are required

* hidapi
-Download and build (github.com/.../releases)
-Version used in official build is 0.8.0-rc1
-The BSL Scripter project assumes hidapi being built against libusb-1.0
(the default used in the Makefile coming with hidapi 0.8.0-rc1)
-hidapi.h must be copied to ThirdParty/include/
-hid-libusb.o must be copied to ThirdParty/lib/

So should i copy the source code to my embedded linux and try to build it from there?

How do i build the source code?

  • Hi,

    so this i what i did untill now but go error at the end:

    On Linux Machine
    1- Send SourceCode Directory to embedded ARM Linux Machine
    2- Download boost and send the /boost directory inside SourceCode
    3- Make ThirdParty directory and inside there make include and lib64 directories
    4- Send hidapi.h to include and hid-libusb.o to lib64 directory (Note: you have to download hidapi from github and do "./boostrap -> ./configure -> make -> make install(as root)" to get '.o' file from '.c' and rename hid.o to hid-lsusb.o)

    On Linux Arm Embedded Machine:
    1-Inside SourceCode Directoy on your embedded device you have to do "make" ->>>>>>>Here is where the error comes


    ./ThirdParty/lib64/hid-libusb.o: file not recognized: File format not recognized
    collect2: error: ld returned 1 exit status
    Makefile:95: recipe for target 'all' failed
    make: *** [all] Error 1


    Whats wrong here? Do i have to make/build the hidapi on my embedded device instead?
  • So i build the hidapi in my embedded linux machine and the "hid-libusb.o" is working but i got new error when running make:

    make: Warning: File 'Makefile' has modification time 526035234 s in the future
    g++ -c -o BSL_Scripter.o BSL_Scripter.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o Util.o Util.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o BslResponseHandler.o BslResponseHandler.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o UsbComm.o UsbComm.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o UartComm.o UartComm.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o Family16bit.o Family16bit.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o Family32bit.o Family32bit.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o BaseCommands.o BaseCommands.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o Timer.o Timer.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o Interpreter.o Interpreter.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o ScripterStream.o ScripterStream.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o FactoryTarget.o FactoryTarget.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -c -o FactoryCommunication.o FactoryCommunication.cpp -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -I./ThirdParty/include -I. -DUNIX -DNDEBUG -DUNIX
    g++ -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -o BSL_Scripter.o Util.o BslResponseHandler.o UsbComm.o UartComm.o Family16bit.o Family32bit.o BaseCommands.o Timer.o Interpreter.o ScripterStream.o FactoryTarget.o FactoryCommunication.o ./ThirdParty/lib64/hid-libusb.o -L./ThirdParty/lib64 -lboost_filesystem -lboost_system -lboost_program_options -lusb-1.0 -lusb-1.0 -lrt -lpthread
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crt1.o: In function `_start':
    (.text+0x28): undefined reference to `main'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `udev_hotplug_event':
    (.text+0x12): undefined reference to `udev_device_get_action'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `udev_hotplug_event':
    (.text+0x2e): undefined reference to `udev_device_get_devnode'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `udev_hotplug_event':
    (.text+0x3a): undefined reference to `udev_device_get_sysname'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `udev_hotplug_event':
    (.text+0x5c): undefined reference to `udev_device_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `udev_hotplug_event':
    (.text+0xb2): undefined reference to `udev_device_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_event_thread_main':
    (.text+0x18c): undefined reference to `udev_monitor_receive_device'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x1be): undefined reference to `udev_new'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x1d2): undefined reference to `udev_monitor_new_from_netlink'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x1e8): undefined reference to `udev_monitor_filter_add_match_subsystem_devtype'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x1fe): undefined reference to `udev_monitor_enable_receiving'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x20c): undefined reference to `udev_monitor_get_fd'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x27a): undefined reference to `udev_monitor_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_start_event_monitor':
    (.text+0x28a): undefined reference to `udev_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_stop_event_monitor':
    (.text+0x388): undefined reference to `udev_monitor_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_stop_event_monitor':
    (.text+0x398): undefined reference to `udev_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x430): undefined reference to `udev_enumerate_new'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x446): undefined reference to `udev_enumerate_add_match_subsystem'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x44c): undefined reference to `udev_enumerate_scan_devices'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x452): undefined reference to `udev_enumerate_get_list_entry'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x45c): undefined reference to `udev_list_entry_get_name'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x46e): undefined reference to `udev_device_new_from_syspath'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x474): undefined reference to `udev_device_get_devnode'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x47e): undefined reference to `udev_device_get_sysname'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x4ae): undefined reference to `udev_device_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x4b4): undefined reference to `udev_list_entry_get_next'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_scan_devices':
    (.text+0x4c0): undefined reference to `udev_enumerate_unref'
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/libusb-1.0.a(libusb_1_0_la-linux_udev.o): In function `linux_udev_hotplug_poll':
    (.text+0x520): undefined reference to `udev_monitor_receive_device'
    collect2: error: ld returned 1 exit status
    Makefile:95: recipe for target 'all' failed
    make: *** [all] Error 1
  • Hi Michael,

    Which TI device you are using? Is it MSP low-power microcontroller?

    Regards,
    Pavel
  • Hi Pavel,

    yes i am using MSP432. But i am not able to get the BSL scripter running on AM335x.
    Its based on debian 8 ARM. I am trying to build the script for ARM CPUs.

    Thanks,

    Michael
  • Michael Liesenberg85 said:
    yes i am using MSP432

    MSP is supported in MSP forum, and I see you already doble post/ask there:

    Michael Liesenberg85 said:
    But i am not able to get the BSL scripter running on AM335x.

    Can you provide more details regarding the problems you have regarding AM335x device?

    Regards,
    Pavel

  • Hi Pavel,

    so the problem is to build the source from BSL Scripter on Debian Distribution.
    I did exactly those steps on AM335x running Debian Jessie and on PC-Linux DebianJessie.
    On both cases i ran into linking errors. The "udev" library references are not defined.
    I know that there is a working BSL Script for linux 32 and 64bit. But i am trying to build it for ARM.
    Now that on Linux PC i get same building errors as on ARM, i think this is not a specific AM335x issue.
    I am stuck in building the script and i think it is a matter of proper link the libraries.
    Is the README steps(Linux) on the SourceCode meant to be used for Ubuntu?
  • Michael Liesenberg85 said:
    so the problem is to build the source from BSL Scripter on Debian Distribution.

    Michael Liesenberg85 said:
    I did exactly those steps on AM335x running Debian Jessie

    This forum support only Arago linux, that comes with the AM335x TI PSDK. Regarding other linux distributions (like Debian), you should check with the Beagle community forums.

    Regards,
    Pavel

  • Beaglebone community has nothing to do with "building errors with BSL Scripter for linux PC". As i said this is not a AM335x issue i am having but building the BSL Scripter for Linux PC.
    I thought someone here could help me on that.
  • OK, I am leaving this thread open for someone to help here.

    Regards,
    Pavel
  • g++ ... -o BSL_Scripter.o Util.o ...
    (.text+0x28): undefined reference to `main'

    There is something wrong with the makefile; the name of the output file (the executable) that should come after "-o" is missing, so gcc overwrites the first object file (BSL_Scripter.o).

  • Hi Clemens,

    i visit yesterday TI at the embedded world and i was talking with the specialist for the MSP430/MSP432 bootloader.
    He said they are working on the MSP432 BSL Scripter solution for ARM based Linux CPU.
    But for now he told me there is a BSL Scripter application note and source code for the MSP430 under ARM Linux.
    So i am trying to find that and will test it on MSP432.
  • - invoke make like 'env BIT32=1 make' (or remove the if else...)

    - use boost and hidapi from the distribution

    - change the pathes in the makefile accordingly

    Regards,

    Dirk

  • Hello,
    we are working on the same issue. For now, we dont get the BSL-Scripter compiled on an ARM-system (debian / 32bit). Did someone find a solution for this by now? We got the same errors mentioned here and don't have have further ideas to solve this. Can anybody confirm it is possible with the right compiler and code-distributions?

    : Did you found the alternative package you mentioned? Where can one find it?
    : Was you able to successfully compile it for an ARM-system with your recommendation?
  • Hi Marcus, Hi Dirk,

    i still dont have it running.

    The fastest way is to implement the scripter on C or C++ using its source code as base.

    The scripter only read the .txt output file and send it UART(BSL) commands on MSP432.

    This is all there written already. If you dont need USB part like me, this is the best way.

    If anyone have time to do this it will be awesome! Dont have any time right now.

    Regards,

    Michael

  • Hi Marcus,

    the BSL-Scripter runs on a BBB with jessie. I tested it with USB2RS232-adapter to programm a MSP432 - it works!

    I just did the steps mentioned before - only changes in the Makefile (pathes) are necessary.

    Regards,

    Dirk

  • Hi  Dirk,

    can you make the BSL scripted for Arm as .deb package available or on github?

    I am also using Debian Jessie but on iMx6.

    Regards,

    Michael

  • Hi Dirk,

    i start building the scripter at begin and am facing a new problem:

    root@:/home/MSP/SourceCode# make

    g++ -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Os -Os -static -o  BSL_Scripter.o Util.o BslResponseHandler.o UsbComm.o UartComm.o Family16bit.o Family32bit.o BaseCommands.o Timer.o Interpreter.o ScripterStream.o FactoryTarget.o FactoryCommunication.o ./ThirdParty/lib64/hid-libusb.o -L./ThirdParty/lib64   -lboost_filesystem -lboost_system -lboost_program_options -lusb-1.0  -lusb-1.0 -lrt -lpthread

    collect2: error: ld terminated with signal 4 [Illegal instruction]

    Makefile:95: recipe for target 'all' failed

    make: *** [all] Error 1

    What did you change excatly? "- change the pathes in the makefile accordingly"

    So this is what i did so far:

    On Linux Machine:

    1- Download BSL Scripter from Ti Page

    2- Unpack and send SourceCode directory to ARM embedded Machine

    On Linux Arm Embedded Machine:

    1- Enter SourceCode Directory

    2- Inside there, download boost version 1.56 with wget direct from the website

    3- Unpack and go inside the directory

    4- aptitude install libusb-dev

    5- aptitude install libusb-1.0-0-dev

    6- Run ./boostrap

    7- Run ./b2 (takes a while)

    8- Copy libboost_filesystem.so, libboost_system and libboost_program_options.so to /usr/local/lib directory

    9- Inside SourceCode directory, make include and lib64 directory

    10- Leave SourceCode Directory and download hipdapi from github

    11- Inside the hidapi directory do: “./bootstrap  -> ./configure -> make -> sudo make install”

    12- Inside “libusb” directory rename “hid.o” to “hid-lsusb.o”

    13- Copy /hidapi/hidapi.h to SourceCode/ThirdParty/include

    14- Copy /libusb/hid-lsusb.o” to SourceCode/ThirdParty/lib64

    15- Inside SourceCode: "make"

    Can you help me on this?

  • So i finally made it to work.

    Since i use Qt creator to deploy my application to the iMx6, i create a new Qt Project and add the SourceCode files from BSL.

    I excluded USBComm .h and .c file since i dont need them and hidapi.

    I didnt change anything else on those files only include the boost libraries in the project.

    In Qt Creator i add the step "make install" and i got an executable.

    Before i was getting all this errors with Makefile and tryied a lot but still couldnt get it to work that way. 

    On Linux Machine:

    1- Download BSL Scripter from Ti Page

    2- Unpack and send SourceCode directory to ARM embedded Machine

    On Linux Arm Embedded Machine:

    1- Enter SourceCode Directory

    2- Inside there, download boost version 1.56 with wget direct from the website

    3- Unpack and go inside the directory

    4- aptitude install libusb-dev

    5- aptitude install libusb-1.0-0-dev

    6- Run ./boostrap

    7- Run ./b2 (takes a while)

    On Linux Machine:

    1- Create new Project under QT Creator

    2- Add Files and delete USBCOmm .h and .c files

    3- Copy the boost folder from iMx6 back to PC into the Qt Project folder

    4- Link and include the libraries from boost

    5- In project add new “make” step with argument install

    6- Build and run it

    7- Copy the executable to iMx6

    On Linux Arm Embedded Machine:

    1- Once QT Project is build and files are in iMx6 do:

    • dpkg-reconfigure locales (de_DE.UTF-8)

    • update-locale LC_ALL=de_DE.UTF-8 LANG=de_DE.UTF-8

    • LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path_of_your_libs"

    • export LD_LIBRARY_PATH

    2- Run executlabe like ./BSL_QT script.text

  • Hi Michael,

    sorry for the delay. Perhaps following steps will help:

    - apt-get install libhidapi-dev libboost-system libboost-filesystem libboost-program-options

    - download and unpack BSL source code from TI

    - change to source code directory

    - in UsbComm.h replace line #include "ThirdParty/include/hidapi.h" with #include "hidapi/hidapi.h"

    - in Makefile remove line CXXFLAGS += -static

    - in Makefile remove line CXXFLAGS += -m32

    - in Makefile change line HIDOBJ := $(LIBTHIRD)/hid-libusb.o to HIDOBJ :=

    - in Makefile change line LIBS += -lusb-1.0 -lrt -lpthread to LIBS += -lusb-1.0 -lhidapi-libusb -lrt -lpthread

    call

    make clean

    env BIT32=1 make

    Dirk

  • Hi Dirk,

    thank you very much!
    It works great!

    Best regards,

    Michael
  • Hi Dirk,

    now it's working fine!
    thank you very much!

    Best regards!

    Sergei