{"id":21058974,"url":"https://github.com/robotdad/imx6-bluetooth","last_synced_at":"2026-04-22T18:32:42.110Z","repository":{"id":75329100,"uuid":"137430631","full_name":"robotdad/imx6-Bluetooth","owner":"robotdad","description":"Demo project showing how to use containers for a cross compile toolchain for build and deploying/debugging on a Toradex Colibri IMX6ULL device","archived":false,"fork":false,"pushed_at":"2018-11-30T07:53:12.000Z","size":880,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T06:21:16.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotdad.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-15T02:15:30.000Z","updated_at":"2018-06-15T06:03:21.000Z","dependencies_parsed_at":"2023-06-06T04:15:43.892Z","dependency_job_id":null,"html_url":"https://github.com/robotdad/imx6-Bluetooth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robotdad/imx6-Bluetooth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fimx6-Bluetooth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fimx6-Bluetooth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fimx6-Bluetooth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fimx6-Bluetooth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotdad","download_url":"https://codeload.github.com/robotdad/imx6-Bluetooth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotdad%2Fimx6-Bluetooth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32149488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T17:09:37.211Z","updated_at":"2026-04-22T18:32:42.103Z","avatar_url":"https://github.com/robotdad.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Visual Studio 2017 with a Toradex Colibri i.MX 6UUL device\n## Prerequisites\n* [Colibri with Wifi/BT](https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-imx6ull) and an [Aster Carrier Board](https://www.toradex.com/products/carrier-boards/aster-carrier-board)\n* [Setup your board](https://developer.toradex.com/getting-started?som=colibri-imx6ull\u0026board=aster-carrier-board)\n* [TI SensorTag](http://www.ti.com/ww/en/wireless_connectivity/sensortag/)\n* [Visual Studio 2017](https://www.visualstudio.com/vs/) (any edition) with the [Linux workload](http://aka.ms/vslinux) installed \n* [Docker for Windows](https://store.docker.com/editions/community/docker-ce-desktop-windows)\n\n## Create a VS Project\nGet started by creating a blank Linux project. Go to File \u003e New \u003e Project, then select Visual C++ \u003e Cross Platform \u003e Linux and select the blank template. Here we are naming the project imx6-Bluetooth.\n\n![Create blank project](images/01-blankproject.png)\n\n## Create a build container\nFor this demo we are going to use containers for setting up our build enviornment. First pull the container image locally from the registry.\n```\ndocker pull jeremiascordoba/development:SDK\n```\n\nWe created the project first so we have our directory where our source will live. We will map that into the container. I saved mine here: `C:\\source\\repos\\imx6-Bluetooth\\imx6-Bluetooth`. Note that is the project directory, not the top level solution directory. In the next command adjust that value to match where you saved your project.\n```\ndocker run -d -p 2222:22 --name colibri_sdk -v C:\\source\\repos\\imx6-Bluetooth\\imx6-Bluetooth:/root/projects/imx6-Bluetooth jeremiascordoba/development:SDK\n```\nYou should now have a running container named colibri_sdk on your system that contains the build tools and has an open SSH port for Visual Studio to issue commands over.\n\n## Connect Visual Studio to the container and device\nIn Visual Studio go to Tools \u003e Options \u003e Connection Manager\n\n![Connection Manager dialog](images/02-connection.png)\n\nClick add and enter \n* Host name: localhost \n* Port: 2222 \n* User: root \n* Password: toradex_sdk\n\n![Add connection dialog](images/03-remote.png)\n\nVisual Studio automatically queries the compiler to get include locations and compiler flags to provide machine specific IntelliSense. However the cross compilers we are using are not built with this information. We can manually provide the include locations though. After the connection is complete expand the node under Connection Manager and select Remote Headers IntelliSense Manager.\n\n![Remote IntelliSense Headers dialog](images/04-remoteisense.png)\n\nSelect Explore. This brings up Windows Explorer. Copy the file settings.xml.unused and name it settings.xml. Open the file in a text editor and change the value of useCompiler to false. Now add the following location to includeDirs at the beginning of the CDATA block:\n```\n/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include;\n```\n\nSave the file. Keep this explorer window open though as you will need this path later in the instructions. \n\nIn Visual Studio click Update in the Remote Headers IntelliSense Manager. You'll notice this will take a moment longer than when we established the connection as we're now getting a full set of headers back. When it is done click Connection Manager and add the connection to your device. Use the IP address, root for the user and leave password blank. You will get an error that Visual Studio could not find the compiler to get the headers from the target. That's OK as we're not going to compile on this device, only deploy.\n\n![Remote IntelliSense error, g++ not found](images/05-error.png)\n\nSelect Close to dismiss the error, and OK again to exit the Options dialog.\n\n## Add some source and cross compile it in a container\nWe're using a sample from this SensorTag repo: [durovsky/SensorTag2650](https://github.com/durovsky/SensorTag2650). We only using the source here for talking to the SensorTag, not the whole project. Copy src\\senortag.cpp and include\\filepaths.h locally into your VS project directory. Right click the project in the solution explorer and click add \u003e existing item. Select the files you just added. You project should now look like this.\n\n![Solution view](images/06-solution.png)\n\nLook at filepaths.h. Make sure the path to where the file will live on your device exists. \n\nNow we need to tell Visual Studio how to compile for the ARM target board. Right click the project and click properties. We have mapped our project directory into the container, so select the copy sources node and change the default to no. The build container we are using has aliased gcc to the cross compilers, so we do not need to override the default values for the compiler in this project. Expand the c++ node and select command line. Add the following:\n```\n-march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi \n```\nExpand the Linker node and under General change Copy Output to No. Select command line and add the same line as above.\n```\n-march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi \n```\n\nNow try and build the project to validate things work so far. If anything is amiss carefully check the your settings against the above.\n\nSo far we have setup a build container, connected it and our device to Visual Studio, and cross compiled an executable in the container that can run on the ARM development board. Now we need to get the output to the board.\n\n## Copying the cross compiled output to the i.MX 6ULL device\nWe are going to add another project to copy the cross compiled output to our remote device. In the Solution Explorer, right click the solution, then Add \u003e New Project. In the dialog select Makefile. \n\n![Add a makefile project](images/07-makefile.png)\n\nWe are organizing our solution such that there is a project used for building and debugging source (imx6-Bluetooth), and another (CopyFiles) to copy outputs to a remote ARM target. The trick here is that we use the x64 configuration for build and ARM for debug. In the solution properties under Project Dependencies we will set the project CopyFiles to depend on CrossCompileProject. Right click the solution and select properties. Now select Project Dependencies and set CopyFiles to depend on imx6-Bluetooth.\n\n![Project dependencies](images/08-projdepend.png)\n\nNow under configuration properties change CopyFiles to use ARM but leave everything else x64.\n\n![x64 config](images/09-x64config.png)\n\nWhile we are here change Platform to ARM and unselect Build for everything. This allows us to change the imx6-Bluetooth platform to ARM for debugging the device but not kick off a build. That's what our x64 project using the cross compilers in the container is for.\n\n![ARM config](images/10-armconfig.png)\n\nClose the solution property pages.\n\nNow, right click the imx6-Bluetooth project and select properties. Make sure the x64 platform is active. Go to Build events \u003e Post Build Events and add the following command line.\n```\ncopy \"$(ProjectDir)bin\\$(Platform)\\$(Configuration)\\$(ProjectName).out\" \"$(ProjectDir)bin\\ARM\\$(Configuration)\\$(ProjectName).out\"\n```\n![post build](images/11-postbuild.png)\n\nWhat this is going to do is put the output binary in a default location for use by gdb when we are debugging later. You could skip this if you overrode the defaults in the project properties for the ARM platform configuration.\n\nNow in the project properties for CopyFiles on the General page change the remote build machine to your device. \n\n![general](images/12-general.png)\n\nNow go to Build Events \u003e Pre-Build Event. Make sure the platform has ARM active. Add the following command to additional files to copy.\n```\n..\\imx6-Bluetooth\\bin\\x64\\Debug\\imx6-Bluetooth.out:=/home/root/projects/imx6-Bluetooth/imx6-Bluetooth.out\n```\n![pre build](images/13-prebuild.png)\n\nNow under Remote Post-Build Event we need to set the execute bit for the binary.\n```\nchmod +x /home/root/projects/imx6-Bluetooth/bin/ARM/Debug/imx6-Bluetooth.out\n```\n\n![remote post build](images/14-remotepostbuild.png)\n\nLet's make sure everything builds and copies correctly. Right click the solution and click Build Solution.\n\nIf you get an error that the output of the x64 project could not be copied because of a path not found, open the project location in Explorer and create the subdirectories ARM\\Debug under the bin folder.\n\nOnce everything is building let's get Debugging working.\n\n## Deploy and debug on the iMX.6 ULL device\n\nFirst turn on your SensorTag and connect to your Colibri IMX6ULL device and run the following command\n```\nhcitool lescan\n```\nMake a note of the address your get back for your SensorTag.\n```\nroot@colibri-imx6ull:~# hcitool lescan\nLE Scan ...\nA0:E6:F8:C3:2C:84 (unknown)\n```\n\nNow in Visual Studio change the platform to ARM.\n\n![arm platform](images/15-armplatform.png)\n\nNow in the project properties for imx6-Bluetooth on the General tab change the remote computer from local host to your device. \n\n![arm general properties](images/16-armgeneral.png)\n\nTo configure debugging go to the Debugging property page. In program arguments provide your SensorTag address. The device does not have gdb installed, so change debugging mode to gdbserver.\n\n![arm debugger properties](images/17-armdebug.png)\n\nSince this connection doesn't have headers you won't have IntelliSense. If you would like to get it back go to VC++ Directories project properties. Go to the location where your headers were saved for the container connection. Navigate to the subdirectory `usr\\local\\oecore-x86_64\\sysroots\\armv7at2hf-neon-angstrom-linux-gnueabi\\usr\\include`. Now copy the entire path and put the value into the Include Directories field. \n\n![arm vc directories properties](images/18-armvcdirs.png)\n\nSet a breakpoint around line 319 where the flag for new_measurement is cleared. Now launch the debugger via F5. \n\nYou should see something like the following.\n\n![debugging the imx6](images/19-debugimx6.png)\n\n## Conclusion\nNow that you have all of this working you can use these techniques to target this or other embedded Linux ARM devices.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotdad%2Fimx6-bluetooth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotdad%2Fimx6-bluetooth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotdad%2Fimx6-bluetooth/lists"}