TIBLUETOOTHSTACK-SDK: Bluetopia Custom Application

Part Number: TIBLUETOOTHSTACK-SDK

Hello, I am trying to compile custom applications with the Bluetopia API. I am using the bluetopia stack found here https://www.ti.com/tool/TI-BT-4-2-STACK-LINUX-ADDON .

Could you explain a broad overview of how the API is structured? Like where are the necessary .c are and where are the all the .h files so i can write a cmake file.

Or maybe it's simpler to modify the existing make file in the build directory?

  • Hi Andrew,

    What device are you using?

  • I am using the AM335x evaluation board. I have the sdk installed on my work station and can compile, transfer and run apps on the EVM with no problem.

    I have Bluetopia api open in VS code and I am trying to get a cmake to build a simple app which can  make API calls.



  • Hi,

    Are you able to build the Bluetopia stack from the SDK as-is, without any modification, or are you able to do that and just need help with adding your new program to the makefile?

    Have you taken a look at the Bluetopia build guide for Linux? It contains much of the documentation on the structure of the SDK as well as instructions on how to build the SDK.

    As a whole, there some config files you will need to modify for your local workspace and toolchain, but you should base your makefile off of the main makefile provided in the build directory once you run "source configure". I suggest you take a look at the makefiles provided as well as the documentation in the build guide.

    Regards,
    Michael

  • Hi Michael,

    Thank you for the information. Modifying the existing makefile would work.

    I've modified the setup-bt file and proj/toolchain-defs.mak to reflect the following

    setup-bt :
    # Path to local toolchain installation
    export TOOLCHAIN_PATH=/home/acisneros/ti-processor-sdk-linux-am335x-evm-06.03.00.106/linux-devkit/sysroots/

    # Path to SDK compiled kernel
    export KERNEL_PATH=/home/acisneros/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/linux-4.19.94+gitAUTOINC+be5389fd85-gbe5389fd85/

    toolchain-def.mak:
    KERNELDIR=$(KERNEL_PATH)/
    TOOLCHAIN_PATH_NATIVE=$(TOOLCHAIN_PATH)/x86_64-arago-linux/
    TOOLCHAIN_PATH_TARGET=$(TOOLCHAIN_PATH)/armv7at2hf-neon-linux-gnueabi/
    TOOLCHAIN_PREFIX=arm-linux-gnueabihf
    ARCH=arm

    after running source configure.sh, and make clean i end up with this error

    cisneros@ubuntu:~/Wifi-BLE/AM335xBluetopiaLinuxProduction-4.2.1.1.1.0/build$ sudo make
    [sudo] password for acisneros:
    make: *** No rule to make target 'Kernel_2_6/SS1VNETM.c', needed by '/BluetopiaPM/Bluetopia/VNET/SS1VNETM.ko'.  Stop.

    I found a similar issue here : https://e2e.ti.com/support/wireless-connectivity/wifi/f/wi-fi-forum/561987/problem-in-ti-bluetooth-stack-for-wl18xx---build-process-guide
    I've made the changes but I must've missed something.

    Thoughts?

  • Hi,

    Your setup-bt file and toolchain-def.mak look good.

    For the error you're getting, try commenting out the VNET build targets in the platform.mak file. That file should be in build/proj, and by commenting out the TARGETS += $(VNET_TARGETS:%=$(VNETDIR)/%) line you should remove the need to make that SS1VNETM.c file.

    Regards,

    Michael

  • Hi Michael,

    I ran 'make clobber', then 'source configure', then i was able to build. This fixed the build errors.

    However, transferring the newly built binary's to the AM335x evaluation board, and then trying to start the SS1BTPM results in errors. Note that I do not see this errors when i transferred and ran the pre- compiled binaries.

    root@am335x-evm:~/Bluetopia# ./SS1BTPM
    ./SS1BTPM: /lib/libc.so.6: version `GLIBC_2.28' not found (required by ./SS1BTPM)
    root@am335x-evm:~/Bluetopia#

    looks like the GNU c library is a different version than the libc found in the SDK toolchain.

    libc from cross complier toolchain:

    acisneros@ubuntu:~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/lib$ ls libc.so.6
    libc.so.6

  • Hi Andrew,

    On your AM335x EVM, did you load your SD card with the default image following the instructions here:

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Overview/Processor_SDK_Linux_create_SD_card_script.html#sd-card-using-default-images

    A bit strange that despite pointing the Bluetopia build files to your target's filesystem with its libc, you get that error.

    Regards,

    Michael

  • Michael,

    The AM335x EVM was recently purchased directly from Ti and shipped with imaged sd-card.

    I transferred the sdk's libc to the EVM to view the different versions.

    libc shipped with on EVM:

    root@am335x-evm:~# /lib/libc.so.6
    GNU C Library (GNU libc) stable release version 2.21, by Roland McGrath et al.

    libc from SDK (viewed on EVM):

    root@am335x-evm:~# ./libc.so.6
    GNU C Library (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) stable release version 2.28.

    clearly different versions here.

    What would you recommend here? Re-image the sd-card?

  • I made a clone of the sdcard that shipped with the box for back up. Then re imaged my sd card following the provided guide. But after the 'create-sdcard.sh' script finishes the sd card is no longer bootable.

    I attached gparted screenshot before and after. And the create sd card output.

    After create sd card

    Before overwriting sd card:

    ################################################################################

    This script will create a bootable SD card from custom or pre-built binaries.

    The script must be run with root permissions and from the bin directory of
    the SDK

    Example:
     $ sudo ./create-sdcard.sh

    Formatting can be skipped if the SD card is already formatted and
    partitioned properly.

    ################################################################################


    Available Drives to write images to:

    #  major   minor    size   name
    1:   8       16   31166976 sdb
     
    Enter Device Number or n to exit: 1
     
    sdb was selected

    ################################################################################

            **********WARNING**********

        Selected Device is greater then 16GB
        Continuing past this point will erase data from device
        Double check that this is the correct SD Card

    ################################################################################

    Would you like to continue [y/n] : y

     


    /dev/sdb is an sdx device
    Current size of sdb1 2295 bytes
    Current size of sdb2 31164171 bytes

    ################################################################################

        Select 2 partitions if only need boot and rootfs (most users).
        Select 3 partitions if need SDK & other content on SD card.  This is
            usually used by device manufacturers with access to partition tarballs.

        ****WARNING**** continuing will erase all data on sdb

    ################################################################################

    Number of partitions needed [2/3] : 2

     
    Now partitioning sdb with 2 partitions...
     

    ################################################################################

            Now making 2 partitions

    ################################################################################

    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.621908 s, 1.7 MB/s
    DISK SIZE - 31914983424 bytes
    Warning: The resulting partition is not properly aligned for best performance: 1s % 2048s != 0s
    Warning: The resulting partition is not properly aligned for best performance: 4591s % 2048s != 0s

    ################################################################################

            Partitioning Boot

    ################################################################################
    mkfs.fat 4.1 (2017-01-24)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
    mkfs.vfat: unable to open /dev/sdb1: No such file or directory

    ################################################################################

            Partitioning rootfs

    ################################################################################
    mke2fs 1.45.5 (07-Jan-2020)
    The file /dev/sdb2 does not exist and no size was specified.


    ################################################################################

       Partitioning is now done
       Continue to install filesystem or select 'n' to safe exit

       **Warning** Continuing will erase files any files in the partitions

    ################################################################################


    Would you like to continue? [y/n] : y

     
     
    Mount the partitions
    mount: /home/acisneros/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin/boot: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.
    mount: /home/acisneros/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin/rootfs: wrong fs type, bad option, bad superblock on /dev/sdb2, missing codepage or helper program, or other error.
     
    Emptying partitions
     

    Syncing....

    ################################################################################

        Choose file path to install from

        1 ) Install pre-built images from SDK
        2 ) Enter in custom boot and rootfs file paths

    ################################################################################

    Choose now [1/2] : 1

     
    Will now install from SDK pre-built images
    now installing:  ti-processor-sdk-linux-am335x-evm-06.03.00.106

    ################################################################################

       Multiple rootfs Tarballs found

    ################################################################################

         1:tisdk-rootfs-image-am335x-evm.tar.xz
         2:tisdk-docker-rootfs-image-am335x-evm.tar.xz

    Enter Number of rootfs Tarball: 1
     
    ################################################################################

        Copying files now... will take minutes

    ################################################################################

    Copying boot partition



    MLO copied


    u-boot.img copied


    Copying rootfs System partition
                                                                                                                                                                                                

     
    Syncing...
     
    Un-mount the partitions
    umount: boot: not mounted.
    umount: rootfs: not mounted.
     
    Remove created temp directories
     
    Operation Finished
     
    acisneros@ubuntu:~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin$

  • Michael,

    I was able to build a bootable sd card successfully. My problem was i was running Ubuntu 20.04. And the setup script in the SDK was only compatible up to ubuntu 18.04. Created a new VM with 18.04, then ran the setup script and then ran the top level make file (I was missing this step as well) .

    I'm all sorted out now. Thank you.

  • Hi Andrew,

    Glad you got your setup working. Thanks for coming back and explaining the solution to your issue, let me know if you run into any more difficulties using Bluetopia on your AM335x EVM.

    Regards,

    Michael