Repository: incubator-mynewt-site Updated Branches: refs/heads/asf-site 6f0c3cea7 -> af2656ceb tutorials: Add missing directions and fix cflags for BLE commands via console Author: Xue Liu <liuxuenetmail@gmail.com Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/af2656ce Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/af2656ce Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/af2656ce Branch: refs/heads/asf-site Commit: af2656ceb0aaa6af1e67a65c99763a72746fd676 Parents: 6f0c3ce Author: aditihilbert <ad...@runtime.io> Authored: Fri Apr 8 17:44:03 2016 -0700 Committer: aditihilbert <ad...@runtime.io> Committed: Fri Apr 8 17:44:03 2016 -0700 ---------------------------------------------------------------------- mkdocs/search_index.json | 6 +++--- os/tutorials/bletiny_project/index.html | 8 +++++++- sitemap.xml | 26 +++++++++++++------------- 3 files changed, 23 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/af2656ce/mkdocs/search_index.json ---------------------------------------------------------------------- diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json index c6ad0f4..383df2e 100644 --- a/mkdocs/search_index.json +++ b/mkdocs/search_index.json @@ -657,7 +657,7 @@ }, { "location": "/os/tutorials/bletiny_project/", - "text": "Check stats on a BLE device\n\n\n\n\nThis tutorial explains how to run an example BLE app on a board and command it to scan and spew some stats. The stats will be seen over a serial port, not a BLE wireless connection.\n\n\n\n\nPre-Requisites\n\n\n\n\nEnsure you have installed \nnewt\n and that the \nnewt command is in your system path. \n\n\nYou must have Internet connectivity to fetch remote Mynewt components.\n\n\nYou must \ninstall the compiler tools\n to \nsupport native compiling to build the project this tutorial creates. \n\n\nYou have a board with BLE radio that is supported by Mynewt. We will use an nRF52 Dev board in this tutorial.\n\n\nCable to establish a serial USB connection between the board and the laptop\n\n\n\n\n\n\nCreate a project\n\n\nUse the Newt tool to create a new project directory containing a skeletal Mynewt framework. Change into the newly created directory.\n\n\n$ newt new myapp1\nDownloading project skeleton from apache/incubator- mynewt-blinky...\nInstalling skeleton in myapp1...\nProject myapp1 successfully created.\n$ cd myapp1\n\n\n\n\n\n\n\nCreate a target\n\n\n$ newt target create myble\nTarget targets/myble successfully created\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug\ntargets/myble\n\n\n\n\n\n\n\nDefine the target further. Note that you are using the example app \nbletiny\n. \n\n\n$ newt target set myble bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\nTarget targets/myble successfully set target.bsp to @apache-mynewt-core/hw/bsp/nrf52pdk\n$ newt target set myble app=@apache-mynewt-core/apps/bletiny\nTarget targets/myble successfully set target.app to @apache-mynewt-core/apps/bletiny\n$ newt target set myble build_profile=optimized\nTarget targets/myble successfully set target.build_profile to optimized\n$ newt target set myble cflags=DSTATS_NAME_ENABLE\nTarget targets/myble successfully set pkg.cflags to DSTATS_NAME_EN ABLE\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug\ntargets/myble\n app=@apache-mynewt-core/apps/bletiny\n bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\n build_profile=optimized\n cflags=DSTATS_NAME_ENABLE \n\n\n\n\n\n\n\nThen build the target.\n\n\n$ newt build myble\nCompiling hci_common.c\nCompiling util.c\nArchiving nimble.a\nCompiling os.c\n\nsnip\n\n\n\n\n\n\n\n\nLoad the image\n\n\nMake sure the USB connector is in place and the power LED on the board is lit. Use the Power ON/OFF switch to reset the board after loading the image.\n\n\n$ newt load myble\n\n\n\n\n\n\n\nEstablish serial connection\n\n\nYou will now look for some BLE related stats over a serial connection and see the radio is actually working. The picture below shows a serial connector set up.\n\n\n\n\n\n\nYou may use any terminal emulation program to communicate with the board. This tutorial shows a Minicom set up. You w ill have to find out what the usbserial port number is on your laptop, of course.\n\n\n$ minicom -D /dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\nWhen the Minicom screen comes up, type in \n?\n\n\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/tty.usbserial-AJ03HAQQ, 09:57:17\n\nPress Meta-Z for help on special keys\n\n\n?\n\n4828455:log echo ? tasks mempools date \n4828457:stat b \n\n\n\n\n\n\n\nTry the \nstat\n command. \n\n\nstat\n\n4973017:Must specify a statistic name to dump, possible names are:\n4973021: stat\n4973022: ble_l2cap\n4973024: ble_att\n4973026: ble_gap\n4973027: ble_gattc\n4973029: ble_gatts\n4973031: ble_hs\n4973032: ble_ll_conn\n4973034: ble_ll\n\n\n\n\n\n\n\nTry specifying a BLE related stat, for example \nble_ll\n. You should see some HCI (Host Controller Interface) command counts. \n\n\nstat ble_ll\n\n4986297:hci_cmds: 5\n4986297:hci_cmd_er rs: 0\n4986299:hci_events_sent: 5\n4986301:bad_ll_state: 0\n4986303:bad_acl_hdr: 0\n4986306:rx_adv_pdu_crc_ok: 0\n4986308:rx_adv_pdu_crc_err: 0\n4986311:rx_adv_bytes_crc_ok: 0\n4986314:rx_adv_bytes_crc_err: 0\n4986317:rx_data_pdu_crc_ok: 0\n4986319:rx_data_pdu_crc_err: 0\n4986322:rx_data_bytes_crc_ok: 0\n\nsnip\n\n\n\n\n\n\n\n\nFor a more exciting output, try scanning your surroundings for BLE adverstisements. The HCI command shown below specifies a scan duration in ms, sets discovery mode to general (as opposed to limited), the filter to no-whitelist, and type of scan to passive. You should see some scan data flying by!\n\n\nb scan dur=10000 disc=gen filt=no_wl type=passive\n\n\n5301227:[ts=5301227ssb, mod=4 level=1] host_hci_cmd_send: ogf=0x08 ocf=0x0b len=7\n5301233:[ts=5301233ssb, mod=4 level=1] Command Complete: cmd_pkts=1 ogf=0x8 ocf=0xb status=0\n5301241:[ts=5301241ssb, mod=4 level=1] host_hci_cmd_send: ogf=0x08 ocf=0x0c len=2\n5301248:[ts=5301248ssb, mod=4 level=1] Command C omplete: cmd_pkts=1 ogf=0x8 ocf=0xc status=0\nGAP procedure initiated: discovery; disc_mode=2 filter_policyLE advertising report. len=38 num=1 evtype=3 addr9\n5301270:[ts=5301270ssb, mod=4 level=1] 02 01 06 03 03 aa fe 12 \n5301276:[ts=5301276ssb, mod=4 level=1] 16 aa fe 10 f6 02 67 2e \n5301281:[ts=5301281ssb, mod=4 level=1] 63 6f 2f 62 65 61 63 6f \n5301287:[ts=5301287ssb, mod=4 level=1] 6e 73 \n5301291:[ts=5301291ssb, mod=64 level=2] received advertisement; event_type=3 addr_type=1 addr=0xa0:0x0d:0xec:0:\n5301316:[ts=5301316ssb, mod=64 level=2] flags=0x06\n5301321:[ts=5301321ssb, mod=64 level=2] uuids16(complete)=0xfeaa \n5301327:[ts=5301327ssb, mod=64 level=2] svc_data_uuid16=\n\nsnip", + "text": "Check stats on a BLE device\n\n\n\n\nThis tutorial explains how to run an example BLE app on a board and command it to scan and spew some stats. The stats will be seen over a serial port, not a BLE wireless connection.\n\n\n\n\nPre-Requisites\n\n\n\n\nEnsure you have installed \nnewt\n and that the \nnewt command is in your system path. \n\n\nYou must have Internet connectivity to fetch remote Mynewt components.\n\n\nYou must \ninstall the compiler tools\n to \nsupport native compiling to build the project this tutorial creates. \n\n\nYou have a board with BLE radio that is supported by Mynewt. We will use an nRF52 Dev board in this tutorial.\n\n\nCable to establish a serial USB connection between the board and the laptop\n\n\n\n\n\n\nCreate a project\n\n\nUse the Newt tool to create a new project directory containing a skeletal Mynewt framework. Change into the newly created directory.\n\n\n$ newt new myapp1\nDownloading project skeleton from apache/incubator- mynewt-blinky...\nInstalling skeleton in myapp1...\nProject myapp1 successfully created.\n$ cd myapp1\n\n$ newt install -v \napache-mynewt-core\nDownloading repository description for apache-mynewt-core... success!\n...\napache-mynewt-core successfully installed version 0.7.9-none\n\n\n\n\n\n\n\nCreate a target\n\n\n$ newt target create myble\nTarget targets/myble successfully created\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug\ntargets/myble\n\n\n\n\n\n\n\nDefine the target further. Note that you are using the example app \nbletiny\n. \n\n\n$ newt target set myble bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\nTarget targets/myble successfully set target.bsp to @apache-mynewt-core/hw/bsp/nrf52pdk\n$ newt target set myble app=@apache-mynewt-core/apps/bletiny\nTarget targets/myble successfully set target.app to @apache-mynewt-core/apps/bletiny\n$ newt target set myble build_profile=optimized\nTarget tar gets/myble successfully set target.build_profile to optimized\n$ newt target set myble cflags=DSTATS_NAME_ENABLE\nTarget targets/myble successfully set pkg.cflags to DSTATS_NAME_ENABLE\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug\ntargets/myble\n app=@apache-mynewt-core/apps/bletiny\n bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\n build_profile=optimized\n cflags=-DSTATS_NAME_ENABLE \n\n\n\n\n\n\n\nThen build the target.\n\n\n$ newt build myble\nCompiling hci_common.c\nCompiling util.c\nArchiving nimble.a\nCompiling os.c\n\nsnip\n\n\n\n\n\n\n\n\nLoad the image\n\n\nMake sure the USB connector is in place and the power LED on the board is lit. Use the Power ON/OFF switch to reset the board after loading the image.\n\n\n$ newt load myble\n\n\n\n\n\n\n\nEstablish serial connection\n\n\nYou will now look for some BLE related stats over a serial connection and see the radio is actually working. The picture below shows a serial connector set up.\n\n\n\n\n\n\nYou may use any terminal emulation program to communicate with the board. This tutorial shows a Minicom set up. You will have to find out what the usbserial port number is on your laptop, of course.\n\n\n$ minicom -D /dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\nWhen the Minicom screen comes up, type in \n?\n\n\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/tty.usbserial-AJ03HAQQ, 09:57:17\n\nPress Meta-Z for help on special keys\n\n\n?\n\n4828455:log echo ? tasks mempools date \n4828457:stat b \n\n\n\n\n\n\n\nTry the \nstat\n command. \n\n\nstat\n\n4973017:Must specify a statistic name to dump, possible names are:\n4973021: stat\n4973022: ble_l2cap\n4973024: ble_att\n4973026: ble_gap\n4973027: ble_gattc\n4973029: ble_gatts\n4973031: ble_hs\n4973032: ble_ll_conn\n4973034: ble_ll\n\n\n\n\n\n\n\nTry sp ecifying a BLE related stat, for example \nble_ll\n. You should see some HCI (Host Controller Interface) command counts. \n\n\nstat ble_ll\n\n4986297:hci_cmds: 5\n4986297:hci_cmd_errs: 0\n4986299:hci_events_sent: 5\n4986301:bad_ll_state: 0\n4986303:bad_acl_hdr: 0\n4986306:rx_adv_pdu_crc_ok: 0\n4986308:rx_adv_pdu_crc_err: 0\n4986311:rx_adv_bytes_crc_ok: 0\n4986314:rx_adv_bytes_crc_err: 0\n4986317:rx_data_pdu_crc_ok: 0\n4986319:rx_data_pdu_crc_err: 0\n4986322:rx_data_bytes_crc_ok: 0\n\nsnip\n\n\n\n\n\n\n\n\nFor a more exciting output, try scanning your surroundings for BLE adverstisements. The HCI command shown below specifies a scan duration in ms, sets discovery mode to general (as opposed to limited), the filter to no-whitelist, and type of scan to passive. You should see some scan data flying by!\n\n\nb scan dur=10000 disc=gen filt=no_wl type=passive\n\n\n5301227:[ts=5301227ssb, mod=4 level=1] host_hci_cmd_send: ogf=0x08 ocf=0x0b len=7\n5301233:[ts=5301233ssb, mod=4 level=1] Comma nd Complete: cmd_pkts=1 ogf=0x8 ocf=0xb status=0\n5301241:[ts=5301241ssb, mod=4 level=1] host_hci_cmd_send: ogf=0x08 ocf=0x0c len=2\n5301248:[ts=5301248ssb, mod=4 level=1] Command Complete: cmd_pkts=1 ogf=0x8 ocf=0xc status=0\nGAP procedure initiated: discovery; disc_mode=2 filter_policyLE advertising report. len=38 num=1 evtype=3 addr9\n5301270:[ts=5301270ssb, mod=4 level=1] 02 01 06 03 03 aa fe 12 \n5301276:[ts=5301276ssb, mod=4 level=1] 16 aa fe 10 f6 02 67 2e \n5301281:[ts=5301281ssb, mod=4 level=1] 63 6f 2f 62 65 61 63 6f \n5301287:[ts=5301287ssb, mod=4 level=1] 6e 73 \n5301291:[ts=5301291ssb, mod=64 level=2] received advertisement; event_type=3 addr_type=1 addr=0xa0:0x0d:0xec:0:\n5301316:[ts=5301316ssb, mod=64 level=2] flags=0x06\n5301321:[ts=5301321ssb, mod=64 level=2] uuids16(complete)=0xfeaa \n5301327:[ts=5301327ssb, mod=64 level=2] svc_data_uuid16=\n\nsnip", "title": "BLE commands via console" }, { @@ -672,12 +672,12 @@ }, { "location": "/os/tutorials/bletiny_project/#create-a-project", - "text": "Use the Newt tool to create a new project directory containing a skeletal Mynewt framework. Change into the newly created directory. $ newt new myapp1\nDownloading project skeleton from apache/incubator-mynewt-blinky...\nInstalling skeleton in myapp1...\nProject myapp1 successfully created.\n$ cd myapp1", + "text": "Use the Newt tool to create a new project directory containing a skeletal Mynewt framework. Change into the newly created directory. $ newt new myapp1\nDownloading project skeleton from apache/incubator-mynewt-blinky...\nInstalling skeleton in myapp1...\nProject myapp1 successfully created.\n$ cd myapp1\n\n$ newt install -v \napache-mynewt-core\nDownloading repository description for apache-mynewt-core... success!\n...\napache-mynewt-core successfully installed version 0.7.9-none", "title": "Create a project" }, { "location": "/os/tutorials/bletiny_project/#create-a-target", - "text": "$ newt target create myble\nTarget targets/myble successfully created\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug\ntargets/myble Define the target further. Note that you are using the example app bletiny . $ newt target set myble bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\nTarget targets/myble successfully set target.bsp to @apache-mynewt-core/hw/bsp/nrf52pdk\n$ newt target set myble app=@apache-mynewt-core/apps/bletiny\nTarget targets/myble successfully set target.app to @apache-mynewt-core/apps/bletiny\n$ newt target set myble build_profile=optimized\nTarget targets/myble successfully set target.build_profile to optimized\n$ newt target set myble cflags=DSTATS_NAME_ENABLE\nTarget targets/myble successfully set pkg.cflags to DSTATS_NAME_ENABLE\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug \ntargets/myble\n app=@apache-mynewt-core/apps/bletiny\n bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\n build_profile=optimized\n cflags=DSTATS_NAME_ENABLE Then build the target. $ newt build myble\nCompiling hci_common.c\nCompiling util.c\nArchiving nimble.a\nCompiling os.c snip", + "text": "$ newt target create myble\nTarget targets/myble successfully created\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug\ntargets/myble Define the target further. Note that you are using the example app bletiny . $ newt target set myble bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\nTarget targets/myble successfully set target.bsp to @apache-mynewt-core/hw/bsp/nrf52pdk\n$ newt target set myble app=@apache-mynewt-core/apps/bletiny\nTarget targets/myble successfully set target.app to @apache-mynewt-core/apps/bletiny\n$ newt target set myble build_profile=optimized\nTarget targets/myble successfully set target.build_profile to optimized\n$ newt target set myble cflags=DSTATS_NAME_ENABLE\nTarget targets/myble successfully set pkg.cflags to DSTATS_NAME_ENABLE\n$ newt target show\ntargets/my_blinky_sim\n app=apps/blinky\n bsp=@apache-mynewt-core/hw/bsp/native\n build_profile=debug \ntargets/myble\n app=@apache-mynewt-core/apps/bletiny\n bsp=@apache-mynewt-core/hw/bsp/nrf52pdk\n build_profile=optimized\n cflags=-DSTATS_NAME_ENABLE Then build the target. $ newt build myble\nCompiling hci_common.c\nCompiling util.c\nArchiving nimble.a\nCompiling os.c snip", "title": "Create a target" }, { http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/af2656ce/os/tutorials/bletiny_project/index.html ---------------------------------------------------------------------- diff --git a/os/tutorials/bletiny_project/index.html b/os/tutorials/bletiny_project/index.html index 846e920..d852d68 100644 --- a/os/tutorials/bletiny_project/index.html +++ b/os/tutorials/bletiny_project/index.html @@ -524,6 +524,12 @@ Downloading project skeleton from apache/incubator-mynewt-blinky... Installing skeleton in myapp1... Project myapp1 successfully created. $ cd myapp1 + +$ newt install -v +apache-mynewt-core +Downloading repository description for apache-mynewt-core... success! +... +apache-mynewt-core successfully installed version 0.7.9-none </pre></div> @@ -559,7 +565,7 @@ targets/myble app=@apache-mynewt-core/apps/bletiny bsp=@apache-mynewt-core/hw/bsp/nrf52pdk build_profile=optimized - cflags=DSTATS_NAME_ENABLE + cflags=-DSTATS_NAME_ENABLE </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/af2656ce/sitemap.xml ---------------------------------------------------------------------- diff --git a/sitemap.xml b/sitemap.xml index 0e79fbf..7732d55 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,7 +4,7 @@ <url> <loc>http://mynewt.apache.org/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -12,7 +12,7 @@ <url> <loc>http://mynewt.apache.org/about/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -20,7 +20,7 @@ <url> <loc>http://mynewt.apache.org/documentation/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -28,7 +28,7 @@ <url> <loc>http://mynewt.apache.org/download/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -36,7 +36,7 @@ <url> <loc>http://mynewt.apache.org/community/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -44,7 +44,7 @@ <url> <loc>http://mynewt.apache.org/events/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -53,7 +53,7 @@ <url> <loc>http://mynewt.apache.org/os/get_started/introduction/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -93,7 +93,7 @@ <url> <loc>http://mynewt.apache.org/newt/newt_intro/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -105,7 +105,7 @@ <url> <loc>http://mynewt.apache.org/newt/newt_operation/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -121,13 +121,13 @@ <url> <loc>http://mynewt.apache.org/newtmgr/overview/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> <url> <loc>http://mynewt.apache.org/newtmgr/installing/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> @@ -143,13 +143,13 @@ <url> <loc>http://mynewt.apache.org/os/tutorials/how_to_edit_docs/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url> <url> <loc>http://mynewt.apache.org/faq/answers/</loc> - <lastmod>2016-04-05</lastmod> + <lastmod>2016-04-08</lastmod> <changefreq>daily</changefreq> </url>