You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cwanda <gi...@git.apache.org> on 2017/03/29 06:56:52 UTC

[GitHub] incubator-mynewt-site pull request #165: More doc updates to reflect 1.0 and...

GitHub user cwanda opened a pull request:

    https://github.com/apache/incubator-mynewt-site/pull/165

    More doc updates to  reflect 1.0 and added RedBear Nano2 blinky tutorial

    1) Added Blinky RedBear Nano 2 tutorial
    2) Updated Blinky for Olimex:
       - Add instruction to use USB-OTG2 port for power source instead of JTG/SWD.
       - Add note that the diagram has USB-OTG2 and USB-OTG1 labels reversed.
    3) Added back and updated Project Slinky for Olimex board
    4) Clarify description for newtmgr_uart in enabling newtmgr app tutorial.
    5) Updated Blinky for Primo:
       - Move Install JlinkExe to Debugger option 1 (using jlink probe)
       - Specify Blinky blinks the orange LED (L13) to distiguish the wifi green led on board the blinks too.
       - Added command to erase flash when using OpenOCD
    6) Updated Add Shell and Console to Blinky tutorial to use default OS eventq and default task instead
       of defining a dedicated task for shell events.
    7) Add install JLink to Blinky NRF52 since it uses the JlinkEXE in the tutorial.
    8) Cleaned Project Slinky Sim tutorial
    9) Fix typo in os_task_remove
    10) Removed Blinky Boot from Olimex SRAM tutorial.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cwanda/incubator-mynewt-site updates_1.0

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-mynewt-site/pull/165.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #165
    
----
commit 3a6e4ff0ef247378aec02ee856fa146b17aab305
Author: cwanda <wa...@happycity.com>
Date:   2017-03-28T17:43:54Z

    1) Added Blinky RedBear Nano 2 tutorial
    2) Updated Blinky for Olimex:
       - Add instruction to use USB-OTG2 port for power source instead of JTG/SWD.
       - Add note that the diagram has USB-OTG2 and USB-OTG1 labels reversed.
    3) Added back and updated Project Slinky for Olimex board
    4) Clarify description for newtmgr_uart in enabling newtmgr app tutorial.
    5) Updated Blinky for Primo:
       - Move Install JlinkExe to Debugger option 1 (using jlink probe)
       - Specify Blinky blinks the orange LED (L13) to distiguish the wifi green led on board the blinks too.
       - Added command to erase flash when using OpenOCD
    6) Updated Add Shell and Console to Blinky tutorial to use default OS eventq and default task instead
       of defining a dedicated task for shell events.
    7) Add install JLink to Blinky NRF52 since it uses the JlinkEXE in the tutorial.
    8) Cleaned Project Slinky Sim tutorial
    9) Fix typo in os_task_remove
    10) Removed Blinky Boot from Olimex SRAM tutorial.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-mynewt-site issue #165: More doc updates to reflect 1.0 and added ...

Posted by utzig <gi...@git.apache.org>.
Github user utzig commented on the issue:

    https://github.com/apache/incubator-mynewt-site/pull/165
  
    Looks good to me. It seems like `docs/os/tutorials/pics/task_lesson.png` lost the transparent background. If that really is the case (not a GH visualization hiccup), I guess it would be great to update it leaving the background transparent instead of white.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-mynewt-site pull request #165: More doc updates to reflect 1.0 and...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-mynewt-site/pull/165


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-mynewt-site pull request #165: More doc updates to reflect 1.0 and...

Posted by utzig <gi...@git.apache.org>.
Github user utzig commented on a diff in the pull request:

    https://github.com/apache/incubator-mynewt-site/pull/165#discussion_r108910367
  
    --- Diff: docs/os/tutorials/rbnano2.md ---
    @@ -0,0 +1,206 @@
    +## Blinky, your "Hello World!", on RedBear Nano 2
    +
    +<br>
    +
    +### Objective
    +
    +Learn how to use packages from a default application repository of Mynewt to build your first *Hello World* application (Blinky) on a target board. Once built using the *newt* tool, this application will blink the LED lights on the target board.
    +
    +Create a project with a simple application that blinks an LED on a RedBear Nano 2 board.  Download the application to the target and watch it blink!
    +
    +<br>
    +
    +### Prerequisites
    +
    +Ensure that you have met the following prerequisites before continuing with this tutorial:
    +
    +* Have a RedBear Nano 2 board. 
    +* Have Internet connectivity to fetch remote Mynewt components.
    +* Have a computer to build a Mynewt application and connect to the board over USB.
    +* Install the Newt tool and toolchains (See [Basic Setup](/os/get_started/get_started.md)).
    +* Create a project space (directory structure) and populated it with the core code repository (apache-mynewt-core) or know how to as explained in [Creating Your First Project](/os/get_started/project_create).
    +* Read the Mynewt OS [Concepts](/os/get_started/vocabulary.md) section.
    +
    +**Note:** You must install a patched version of OpenOCD .10.0 (See [Debugger Option 2 in the Arduino Primo Blinky Tutorial](/os/tutorials/blinky_primo)).
    +
    +### Create a Project  
    +Create a new project if you do not have an existing one.  You can skip this step and proceed to [create the targets](#create_targets) if you already have a project created.  
    +
    +Run the following commands to create a new project:
    +
    +```no-highlight
    +    $ mkdir ~/dev
    +    $ cd ~/dev
    +    $ newt new myproj
    +    Downloading project skeleton from apache/incubator-mynewt-blinky...
    +    Installing skeleton in myproj...
    +    Project myproj successfully created.
    +    $ cd myproj
    +    $ newt install
    +    apache-mynewt-core
    +    $
    +``` 
    +
    +<br>
    +
    +### <a name="create_targets"></a>Create the Targets
    +
    +Create two targets for the RedBear Nano 2 board - one for the bootloader and one for the Blinky application.
    +
    +Run the following `newt target` commands, from your project directory, to create a bootloader target. We name the target `rbnano2_boot`:
    +
    +```no-highlight
    +$ newt target create rbnano2_boot
    +$ newt target set rbnano2_boot app=@apache-mynewt-core/apps/boot
    +$ newt target set rbnano2_boot bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +$ newt target set rbnano2_boot build_profile=optimized
    +```
    +
    +<br>
    +Run the following `newt target` commands to create a target for the Blinky application. We name the target `nrf52_blinky`.
    +
    +```no-highlight
    +$ newt target create rbnano2_blinky
    +$ newt target set rbnano2_blinky app=apps/blinky
    +$ newt target set rbnano2_blinky bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +$ newt target set rbnano2_blinky build_profile=debug
    +```
    +<br>
    +You can run the `newt target show` command to verify the target settings:
    +
    +```no-highlight
    +$ newt target show 
    +targets/rbnano2_blinky
    +    app=apps/blinky
    +    bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +    build_profile=debug
    +targets/rbnano2_boot
    +    app=@apache-mynewt-core/apps/boot
    +    bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +    build_profile=optimized
    +```
    +<br>
    +
    +### Build the Target Executables 
    +
    +Run the `newt build rbnano2_boot` command to build the bootloader:
    +
    +```no-highlight
    +$newt build rbnano2_boot
    +Building target targets/rbnano2_boot
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_rsa.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec256.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/loader.c
    +Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aes.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_validate.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/bootutil_misc.c
    +Compiling repos/apache-mynewt-core/apps/boot/src/boot.c
    +
    +      ...
    +
    +Archiving sys_sysinit.a
    +Archiving util_mem.a
    +Linking ~/dev/myproj/bin/targets/rbnano2_boot/app/apps/boot/boot.elf
    +Target successfully built: targets/rbnano2_boot
    +```
    +
    +<br>
    +Run the `newt build rbnano2_blinky` command to build the Blinky application:
    +
    +```no-highlight
    +$newt build rbnano2_blinky
    +Building target targets/rbnano2_blinky
    +Assembling repos/apache-mynewt-core/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s
    +Compiling repos/apache-mynewt-core/hw/drivers/uart/src/uart.c
    +Compiling repos/apache-mynewt-core/hw/cmsis-core/src/cmsis_nvic.c
    +Compiling repos/apache-mynewt-core/hw/bsp/rb-nano2/src/sbrk.c
    +Compiling apps/blinky/src/main.c
    +
    +     ...
    +
    +Archiving sys_sysinit.a
    +Archiving util_mem.a
    +Linking ~/dev/myproj/bin/targets/rbnano2_blinky/app/apps/blinky/blinky.elf
    +Target successfully built: targets/rbnano2_blinky
    +
    +```
    +
    +<br>
    +
    +### Sign and Create the Blinky Application Image 
    +
    +Run the `newt create-image rbnano2_blinky 1.0.0` command to create and sign the application image. You may assign an arbitrary version (e.g. 1.0.0) to the image.
    +
    +```no-highlight
    +$newt create-image rbnano2_blinky 1.0.0
    +App image succesfully generated: ~/dev/myproj/bin/targets/rbnano2_blinky/app/apps/blinky/blinky.img
    +```
    +
    +<br>
    +
    +### Connect to the Board
    +
    +Connect the RedBear Nano 2 USB to a USB port on your computer. You should see an orange LED light up on the board.
    +
    +        
    +### Load the Bootloader and the Blinky Application Image
    +
    +Run the `newt load rbnano2_boot` command to load the bootloader onto the board: 
    +
    +```no-highlight
    +$ newt load rbnano2_boot
    +Loading bootloader
    +$
    +```
    +<br>
    +Note: The flash memory on the RedBear Nano 2 comes write protected from the factory. If you get an error loading the bootloader and you are using a brand new chip, you need to clear the write protection from the debugger and then load the bootloader again.  Run the `newt debug rbnano2_blinky` command and issue the following commands at the highlighted (gdb) prompts.  
    +
    +```hl_lines="8 9 11 14"
    +$newt debug rbnano2_blinky
    +[~/dev/myproj/repos/apache-mynewt-core/hw/bsp/rb-nano2/rb-nano2_debug.sh  ~/dev/myproj/repos/apache-mynewt-core/hw/bsp/rb-nano2 ~/dev/myproj/bin/targets/rbnano2_blinky/app/apps/blinky/blinky]
    +Open On-Chip Debugger 0.10.0-dev-snapshot (2017-03-28-11:24)
    +Licensed under GNU GPL v2
    +
    +     ...
    +
    +(gdb) set {unsigned long}0x4001e504=2
    +(gdb) x/1wx 0x4001e504
    +0x4001e504:0x00000002
    +(gdb) set {unsigned long}0x4001e50c=1
    +Info : SWD DPIDR 0x2ba01477
    +Error: Failed to read memory at 0x00009ef4
    +(gdb) x/32wx 0x00
    +0x0:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x10:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x20:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x30:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x40:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x50:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x60:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x70:0xffffffff0xffffffff0xffffffff0xffffffff
    +(gdb)
    +```
    +
    +<br>
    +Run the `newt load rbnano2_blinky` command to load the Blinky application image onto the board.
    +```no-highlight
    +$ newt load rbnano2_blinky
    +Loading app image into slot 1
    +```
    +
    +You should see a blue LED on the board blink!
    +
    +Note: If the LED does not blink, try resetting your board.
    +
    +
    +### Conclusion
    +
    +You have created, setup, compiled, loaded, and ran your first mynewt application for a RedBear Nano 2 board.
    +
    +We have more fun tutorials for you to get your hands dirty. Be bold and work on the OS with tutorials on [writing a test suite](unit_test.md) or try enabling additional functionality such as [remote comms](project-target-slinky.md) or [Bluetooth Low Energy](bletiny_project.md) on your current board.
    +
    +If you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our [Community Page](../../community.md).
    +
    +Keep on hacking and blinking!
    --- End diff --
    
    Oh Yeah!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-mynewt-site pull request #165: More doc updates to reflect 1.0 and...

Posted by cwanda <gi...@git.apache.org>.
Github user cwanda commented on a diff in the pull request:

    https://github.com/apache/incubator-mynewt-site/pull/165#discussion_r109084324
  
    --- Diff: docs/os/tutorials/rbnano2.md ---
    @@ -0,0 +1,206 @@
    +## Blinky, your "Hello World!", on RedBear Nano 2
    +
    +<br>
    +
    +### Objective
    +
    +Learn how to use packages from a default application repository of Mynewt to build your first *Hello World* application (Blinky) on a target board. Once built using the *newt* tool, this application will blink the LED lights on the target board.
    +
    +Create a project with a simple application that blinks an LED on a RedBear Nano 2 board.  Download the application to the target and watch it blink!
    +
    +<br>
    +
    +### Prerequisites
    +
    +Ensure that you have met the following prerequisites before continuing with this tutorial:
    +
    +* Have a RedBear Nano 2 board. 
    +* Have Internet connectivity to fetch remote Mynewt components.
    +* Have a computer to build a Mynewt application and connect to the board over USB.
    +* Install the Newt tool and toolchains (See [Basic Setup](/os/get_started/get_started.md)).
    +* Create a project space (directory structure) and populated it with the core code repository (apache-mynewt-core) or know how to as explained in [Creating Your First Project](/os/get_started/project_create).
    +* Read the Mynewt OS [Concepts](/os/get_started/vocabulary.md) section.
    +
    +**Note:** You must install a patched version of OpenOCD .10.0 (See [Debugger Option 2 in the Arduino Primo Blinky Tutorial](/os/tutorials/blinky_primo)).
    +
    +### Create a Project  
    +Create a new project if you do not have an existing one.  You can skip this step and proceed to [create the targets](#create_targets) if you already have a project created.  
    +
    +Run the following commands to create a new project:
    +
    +```no-highlight
    +    $ mkdir ~/dev
    +    $ cd ~/dev
    +    $ newt new myproj
    +    Downloading project skeleton from apache/incubator-mynewt-blinky...
    +    Installing skeleton in myproj...
    +    Project myproj successfully created.
    +    $ cd myproj
    +    $ newt install
    +    apache-mynewt-core
    +    $
    +``` 
    +
    +<br>
    +
    +### <a name="create_targets"></a>Create the Targets
    +
    +Create two targets for the RedBear Nano 2 board - one for the bootloader and one for the Blinky application.
    +
    +Run the following `newt target` commands, from your project directory, to create a bootloader target. We name the target `rbnano2_boot`:
    +
    +```no-highlight
    +$ newt target create rbnano2_boot
    +$ newt target set rbnano2_boot app=@apache-mynewt-core/apps/boot
    +$ newt target set rbnano2_boot bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +$ newt target set rbnano2_boot build_profile=optimized
    +```
    +
    +<br>
    +Run the following `newt target` commands to create a target for the Blinky application. We name the target `nrf52_blinky`.
    +
    +```no-highlight
    +$ newt target create rbnano2_blinky
    +$ newt target set rbnano2_blinky app=apps/blinky
    +$ newt target set rbnano2_blinky bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +$ newt target set rbnano2_blinky build_profile=debug
    +```
    +<br>
    +You can run the `newt target show` command to verify the target settings:
    +
    +```no-highlight
    +$ newt target show 
    +targets/rbnano2_blinky
    +    app=apps/blinky
    +    bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +    build_profile=debug
    +targets/rbnano2_boot
    +    app=@apache-mynewt-core/apps/boot
    +    bsp=@apache-mynewt-core/hw/bsp/rb-nano2
    +    build_profile=optimized
    +```
    +<br>
    +
    +### Build the Target Executables 
    +
    +Run the `newt build rbnano2_boot` command to build the bootloader:
    +
    +```no-highlight
    +$newt build rbnano2_boot
    +Building target targets/rbnano2_boot
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_rsa.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec256.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/loader.c
    +Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aes.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_validate.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec.c
    +Compiling repos/apache-mynewt-core/boot/bootutil/src/bootutil_misc.c
    +Compiling repos/apache-mynewt-core/apps/boot/src/boot.c
    +
    +      ...
    +
    +Archiving sys_sysinit.a
    +Archiving util_mem.a
    +Linking ~/dev/myproj/bin/targets/rbnano2_boot/app/apps/boot/boot.elf
    +Target successfully built: targets/rbnano2_boot
    +```
    +
    +<br>
    +Run the `newt build rbnano2_blinky` command to build the Blinky application:
    +
    +```no-highlight
    +$newt build rbnano2_blinky
    +Building target targets/rbnano2_blinky
    +Assembling repos/apache-mynewt-core/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s
    +Compiling repos/apache-mynewt-core/hw/drivers/uart/src/uart.c
    +Compiling repos/apache-mynewt-core/hw/cmsis-core/src/cmsis_nvic.c
    +Compiling repos/apache-mynewt-core/hw/bsp/rb-nano2/src/sbrk.c
    +Compiling apps/blinky/src/main.c
    +
    +     ...
    +
    +Archiving sys_sysinit.a
    +Archiving util_mem.a
    +Linking ~/dev/myproj/bin/targets/rbnano2_blinky/app/apps/blinky/blinky.elf
    +Target successfully built: targets/rbnano2_blinky
    +
    +```
    +
    +<br>
    +
    +### Sign and Create the Blinky Application Image 
    +
    +Run the `newt create-image rbnano2_blinky 1.0.0` command to create and sign the application image. You may assign an arbitrary version (e.g. 1.0.0) to the image.
    +
    +```no-highlight
    +$newt create-image rbnano2_blinky 1.0.0
    +App image succesfully generated: ~/dev/myproj/bin/targets/rbnano2_blinky/app/apps/blinky/blinky.img
    +```
    +
    +<br>
    +
    +### Connect to the Board
    +
    +Connect the RedBear Nano 2 USB to a USB port on your computer. You should see an orange LED light up on the board.
    +
    +        
    +### Load the Bootloader and the Blinky Application Image
    +
    +Run the `newt load rbnano2_boot` command to load the bootloader onto the board: 
    +
    +```no-highlight
    +$ newt load rbnano2_boot
    +Loading bootloader
    +$
    +```
    +<br>
    +Note: The flash memory on the RedBear Nano 2 comes write protected from the factory. If you get an error loading the bootloader and you are using a brand new chip, you need to clear the write protection from the debugger and then load the bootloader again.  Run the `newt debug rbnano2_blinky` command and issue the following commands at the highlighted (gdb) prompts.  
    +
    +```hl_lines="8 9 11 14"
    +$newt debug rbnano2_blinky
    +[~/dev/myproj/repos/apache-mynewt-core/hw/bsp/rb-nano2/rb-nano2_debug.sh  ~/dev/myproj/repos/apache-mynewt-core/hw/bsp/rb-nano2 ~/dev/myproj/bin/targets/rbnano2_blinky/app/apps/blinky/blinky]
    +Open On-Chip Debugger 0.10.0-dev-snapshot (2017-03-28-11:24)
    +Licensed under GNU GPL v2
    +
    +     ...
    +
    +(gdb) set {unsigned long}0x4001e504=2
    +(gdb) x/1wx 0x4001e504
    +0x4001e504:0x00000002
    +(gdb) set {unsigned long}0x4001e50c=1
    +Info : SWD DPIDR 0x2ba01477
    +Error: Failed to read memory at 0x00009ef4
    +(gdb) x/32wx 0x00
    +0x0:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x10:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x20:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x30:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x40:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x50:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x60:0xffffffff0xffffffff0xffffffff0xffffffff
    +0x70:0xffffffff0xffffffff0xffffffff0xffffffff
    +(gdb)
    +```
    +
    +<br>
    +Run the `newt load rbnano2_blinky` command to load the Blinky application image onto the board.
    +```no-highlight
    +$ newt load rbnano2_blinky
    +Loading app image into slot 1
    +```
    +
    +You should see a blue LED on the board blink!
    +
    +Note: If the LED does not blink, try resetting your board.
    +
    +
    +### Conclusion
    +
    +You have created, setup, compiled, loaded, and ran your first mynewt application for a RedBear Nano 2 board.
    +
    +We have more fun tutorials for you to get your hands dirty. Be bold and work on the OS with tutorials on [writing a test suite](unit_test.md) or try enabling additional functionality such as [remote comms](project-target-slinky.md) or [Bluetooth Low Energy](bletiny_project.md) on your current board.
    +
    +If you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our [Community Page](../../community.md).
    +
    +Keep on hacking and blinking!
    --- End diff --
    
    Hi Fabio,
    Thanks for reviewing the doc updates. Yes, the docs/os/tutorials/pics/task_lesson.png lost its transparent background. I committed a new version with a transparent background.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---