http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/dfb65f62/mkdocs/search_index.json ---------------------------------------------------------------------- diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json index 2100189..172744b 100644 --- a/mkdocs/search_index.json +++ b/mkdocs/search_index.json @@ -96,6 +96,16 @@ "title": "Build your first Mynewt App with Newt" }, { + "location": "/os/get_started/get_started/", + "text": "Quick Start\n\n\nIf you are curious about Mynewt and want to get a quick feel for the project, you've come to the right place. We have three sets of instructions for you to try out.\n\n\n\n\nInstalling Native Tools\n - to run Mynewt OS natively (on your machine)\n\n\nCreating Your First Project\n - on simulated hardware \n\n\nInstalling Cross Tools for ARM\n - to get prepared to play with hardware\n\n\n\n\nSend us an email on the dev@ mailing list if you have comments or suggestions!\n If you haven't joined the mailing list, you will find the links \nhere\n.", + "title": "toc" + }, + { + "location": "/os/get_started/get_started/#quick-start", + "text": "If you are curious about Mynewt and want to get a quick feel for the project, you've come to the right place. We have three sets of instructions for you to try out. Installing Native Tools - to run Mynewt OS natively (on your machine) Creating Your First Project - on simulated hardware Installing Cross Tools for ARM - to get prepared to play with hardware Send us an email on the dev@ mailing list if you have comments or suggestions! If you haven't joined the mailing list, you will find the links here .", + "title": "Quick Start" + }, + { "location": "/os/get_started/native_tools/", "text": "Installing Native Mynewt Tools\n\n\nThis page shows how to install tools for native Mynewt targets. This\nallows you to run Mynewt OS as a native application. It also allows\nyou to run the test suites for all packages not requiring HW support. \n\n\nThis page provides guidance for MAC and Linux. See the relevant sections below.\n\n\nSet up toolchain for Mac\n\n\nInstall Brew\n\n\nif you have not already installed Homebrew from the \n\nnewt\n tutorials pages\n. \n\n\nInstall gcc/libc\n\n\nUse brew to install gcc.\n\n\n $ brew install gcc\n ...\n ...\n ==\n Summary\n \ud83c\udf7a /usr/local/Cellar/gcc/5.2.0: 1353 files, 248M\n\n\n\n\n\nInstall gdb\n\n\n $ brew install gdb\n ...\n ...\n ==\n Summary\n \ud83c\udf7a /usr/local/Cellar/gdb/7.10.1: XXX files,YYM\n\n\n\n\n\nNOTE: When running a program with gdb, you may need to sign your gdb\nexecutable. \nThis page\n\nshows a recipe for gdb signi ng. Alternately you can skip this step and\ncontinue without the ability to debug your mynewt application on your PC.\n\n\nSet up toolchain for Linux\n\n\nInstall gcc/libc that will produce 32-bit executables:\n\n\n $ sudo apt-get install gcc-multilib libc6-i386\n\n\n\n\n\nInstall gdb\n\n\n$sudo apt-get install gdb\n\nReading package lists... Done\nBuilding dependency tree \nReading state information... Done\nSuggested packages:\n gdb-doc gdbserver\nThe following NEW packages will be installed:\n gdb\n...\nProcessing triggers for man-db (2.6.7.1-1ubuntu1) ...\nSetting up gdb (7.7.1-0ubuntu5~14.04.2) ...\n$ \n\n\n\n\n\nAt this point you have installed all the necessary software to build and test code on a simluator for Linux. Proceed to the \nBuild test code on simulator\n section.", "title": "Installing Native Tools" @@ -246,8 +256,83 @@ "title": "Target" }, { + "location": "/os/tutorials/tutorials/", + "text": "Tutorials\n\n\nIf the introduction to Mynewt has piqued your interest and you want to familiarize yourself with some of its functionality, this series of tutorials is for you. The lessons are aimed at the beginner. \n\n\n\n\nBlinky on Arduino Zero hardware\n\n\nBlinky on Olimex/STM32F407ZGT6 Cortex-M4 hardware\n\n\nBlinky on STM32F3 discovery kit from ST Micro\n\n\nBlinky on nRF52 Development Kit from Nordic Semiconductor\n \nNote:\n This supports BLE.\n\n\nAdd a unit Test for a Package\n\n\nAdd an air-quality sensor\n \n\n\nHow to contribute to docs\n\n\n\n\nSend us an email on the dev@ mailing list if you have comments or suggestions!\n If you haven't joined the mailing list, you will find the links \nhere\n.", + "title": "toc" + }, + { + "location": "/os/tutorials/tutorials/#tutorials", + "text": "If the introduction to Mynewt has piqued your interest and you want to familiarize yourself with some of its functionality, this series of tutorials is for you. The lessons are aimed at the beginner. Blinky on Arduino Zero hardware Blinky on Olimex/STM32F407ZGT6 Cortex-M4 hardware Blinky on STM32F3 discovery kit from ST Micro Blinky on nRF52 Development Kit from Nordic Semiconductor Note: This supports BLE. Add a unit Test for a Package Add an air-quality sensor How to contribute to docs Send us an email on the dev@ mailing list if you have comments or suggestions! If you haven't joined the mailing list, you will find the links here .", + "title": "Tutorials" + }, + { + "location": "/os/tutorials/arduino_zero/", + "text": "Running Mynewt on Arduino Zero\n\n\nThis tutorial describes how to run Mynewt OS on Arduino Zero. \n\n\nPrerequisites\n\n\nBefore tackling this tutorial, it's best to read about Mynewt in the \nIntroduction\n section of this documentation.\n\n\nEquipment\n\n\nYou will need the following equipment\n\n\n\n\nAn Arduino Zero board. NOTE: There are many flavors of Arduino. Ensure that \nyou have an Arduino Zero. See below for the verions of Arduino Zero that are\ncompatible with this tutorial\n\n\nA computer that can connect to the Arduino Zero over USB\n\n\nA USB cable (Type A to micro B) that can connect the computer to the Arduino\n\n\nThe Mynewt Release\n\n\n\n\nArduino Boards\n\n\nThis tutorial has been tested on the following two Arduino Zero boards.\n\n\n\n\n\n\nSteps\n\n\nFollow these simple steps and your board will be blinking in no time!\n\n\nInstall Mynewt and Newt\n\n\nIf you have not already done so, install Newt as shown in the \nNewt install tutoria l\n and cloned the Mynewt OS repository as shown in the \nGet Started tutorial for Sim Blinky\n\n\nFetch External Packages for Atmel SAMD21\n\n\nMynewt uses source code provided directly from the chip manufacturer for \nlow level operations. This code is licensed only for Atmel parts, and \ncannot live in the Apache Mynewt repository. Fetch the package from \nthe runtime github repository.\n\n\nTo fetch the package from the runtime git repository, you need to add \nthe repository to the \nproject.yml\n file in your base project directory.\n\n\nHere is an example \nproject.yml\n file with the Arduino Zero repository\nadded:\n\n\n$ more project.yml \nproject.name: \nmy_project\n\n\nproject.repositories:\n - apache-mynewt-core\n - mynewt_arduino_zero\n\nrepository.apache-mynewt-core:\n type: github\n vers: 0-latest\n user: apache\n repo: incubator-mynewt-core\n\nrepository.mynewt_arduino_zero:\n type: github\n vers: 0-latest\n user: runtimeinc\n repo: myne wt_arduino_zero\n$ \n\n\n\n\n\nIn the above, the sections with \nmynewt_arduino_zero\n need to be added to \nyour project file.\n\n\nOnce you've edited your \nproject.yml\n file, the next step is to install the \nproject dependencies, this can be done with the \nnewt install\n command \n(to see more output, provide the \n-v\n verbose option.): \n\n\n$ newt install \napache-mynewt-core\nmynewt_arduino_zero\n$\n\n\n\n\n\nCreate your bootloader Target\n\n\nNext, you need to tell Newt what to build. For the Arduino Zero, we are going to \ngenerate both a bootloader, and an image target.\n\n\nTo generate the bootloader target, you need to specify the following options:\n\n\n$ newt target create arduino_boot \nTarget targets/arduino_boot successfully created\n$ newt target set arduino_boot bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero \nTarget targets/arduino_boot successfully set target.bsp to @mynewt_arduino_zero/hw/bsp/arduino_zero\n$ newt target set arduino_boot app=@apache-mynewt-cor e/apps/boot \nTarget targets/arduino_boot successfully set target.app to @apache-mynewt-core/apps/boot\n$ newt target set arduino_boot features=arduino_zero_pro \nTarget targets/arduino_boot successfully set pkg.features to arduino_zero_pro\n\n\n\n\n\nThese commands do a few things: \n\n\n\n\nCreate a target named \narduino_boot\n, in order to build the Arduino Zero Bootloader.\n\n\nSet the application for the \narduino_boot\n target to the default Apache Mynewt \n bootloader (\n@apache-mynewt-core/apps/boot\n)\n\n\nSet the board support package for the target to \n \n@mynewt_arduino_zero/hw/bsp/arduino_zero\n. This is a reference to the downloaded \n Arduino Zero support from Github.\n\n\nTells the Board Support Package to enable support for the Arduino Zero Pro, and not \n the Arduino Zero. This is done through setting a build feature. If you are building \n for an Arduino Zero, and not a Zero Pro, this feature should be set to \narduino_zero\n.\n\n\n\n\nOnce you 've configured the bootloader target, the next step is to build the bootloader for\nyour Arduino, you can do this by using the \nnewt build\n command:\n\n\n$ newt build arduino_boot \nCompiling asprintf.c\nCompiling atoi.c\nCompiling atol.c\nCompiling atoll.c\nCompiling bsearch.c\nCompiling bzero.c\nCompiling calloc.c\nCompiling fgets.c\nCompiling inline.c\n\nsnip\n\nApp successfully built: myproject/bin/arduino_boot/apps/boot/boot.elf\n\n\n\n\n\nIf this command finishes successfully, you have successfully built the Arduino \nbootloader, and the next step is to build your application for the Arduino \nboard.\n\n\nTo create and download your application, you create another target, this one pointing\nto the application you want to download to the Arduino board. In this tutorial, \nwe will use the default application that comes with your project, \napps/blinky\n:\n\n\n$ newt target create arduino_blinky \nTarget targets/arduino_blinky successfully created\n$ newt target set arduino_bl inky app=apps/blinky \nTarget targets/arduino_blinky successfully set target.app to apps/blinky\n$ newt target set arduino_blinky bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero\nTarget targets/arduino_blinky successfully set target.bsp to @mynewt_arduino_zero/hw/bsp/arduino_zero\n$ newt target set arduino_blinky build_profile=debug \nTarget targets/arduino_blinky successfully set target.build_profile to debug\n$ newt target set arduino_blinky features=arduino_zero_pro \nTarget targets/arduino_blinky successfully set pkg.features to arduino_zero_pro\n$ \n\n\n\n\n\nYou can now build the target, with \nnewt build\n: \n\n\n$ newt build arduino_blinky \nCompiling main.c\nArchiving blinky.a\nCompiling cons_fmt.c\nCompiling cons_tty.c\nArchiving full.a\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\nArchiving testutil.a\n\nsnip\n\nApp successfully built: myproject/bin/arduino_blinky/apps/blinky/blinky.elf\n\n\n\n\n\nCongratulations! You have successfully built your application, now it's \ntime to load the bootloader and application onto the target.\n\n\nConnect the Target\n\n\nConnect your computer to the Arduino Zero (from now on we'll call this the \ntarget) with the Micro-USB cable through the Programming Port as shown below. \nMynewt will download and debug the target through this port. You should see a \nlittle green LED come on. That means the board has power.\n\n\nNo external debugger is required. The Arduino Zero comes with an internal\ndebugger that can be accessed by Mynewt.\n\n\nA image below shows the Arduino Zero Programming Port.\n\n\n\n\n\n\nDownload the Bootloader\n\n\nExecute the command to download the bootloader. \n\n\n \n$\n \nnewt\n \nload\n \narduino_boot\n\n\n\n\n\n\nIf the newt tool finishes without error, that means the bootloader has been \nsuccessfully loaded onto the target.\n\n\nRun the Image\n\n\nNow that the bootloader is downloaded to the target, the next step is to load \nyour image onto the Arduino Zero. The easiest w ay to do this, is to use the \n\nnewt run\n command. \nnewt run\n will automatically rebuild your program\n(if necessary), create an image, and load it onto the target device.\n\n\nHere, we will load our \narduino_blinky\n target onto the device, and we \nshould see it run:\n\n\n$ newt run arduino_blinky 0.0.0 \nDebugging myproject/bin/arduino_blinky/apps/blinky/blinky.elf\nOpen On-Chip Debugger 0.9.0 (2015-09-23-21:46)\nLicensed under GNU GPL v2\nFor bug reports, read\n http://openocd.org/doc/doxygen/bugs.html\nInfo : only one transport option; autoselect \nswd\n\nadapter speed: 500 kHz\nadapter_nsrst_delay: 100\ncortex_m reset_config sysresetreq\nInfo : CMSIS-DAP: SWD Supported\nInfo : CMSIS-DAP: JTAG Supported\nInfo : CMSIS-DAP: Interface Initialised (SWD)\nInfo : CMSIS-DAP: FW Version = 01.1F.0118\nInfo : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1\nInfo : CMSIS-DAP: Interface ready\nInfo : clock speed 500 kHz\nInfo : SWD IDCODE 0x0bc11477\nInfo : at91s amd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints\nGNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\nCopyright (C) 2014 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \nhttp://gnu.org/licenses/gpl.html\n\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \nshow copying\n\nand \nshow warranty\n for details.\nThis GDB was configured as \n--host=x86_64-apple-darwin10 --target=arm-none-eabi\n.\nType \nshow configuration\n for configuration details.\nFor bug reporting instructions, please see:\n\nhttp://www.gnu.org/software/gdb/bugs/\n.\nFind the GDB manual and other documentation resources online at:\n\nhttp://www.gnu.org/software/gdb/documentation/\n.\nFor help, type \nhelp\n.\nType \napropos word\n to search for commands related to \nword\n...\nReading symbols from myproject/bin/arduino_blinky/apps/blinky/blinky.elf...done.\ntarget state: halted\ntarget hal ted due to debug-request, current mode: Thread \nxPSR: 0x21000000 pc: 0x0000030e msp: 0x20008000\nInfo : accepting \ngdb\n connection on tcp/3333\nInfo : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)\n0x0000030e in ?? ()\n(gdb) r\nThe \nremote\n target does not support \nrun\n. Try \nhelp target\n or \ncontinue\n.\n(gdb) c\nContinuing.\n\n\n\n\n\nNOTE:\n The 0.0.0 specified after the target name to newt run, is the version \nof the image to load. If you are not providing remote upgrade, and are just \ndeveloping locally, you can provide 0.0.0 for every image version.\n\n\nIf you want the image to run without the debugger connected, simply quit the \ndebugger and restart the board. The image you programmed will come and run on the \nArduino on next boot! \n\n\nWatch the LED blink\n\n\nCongratulations! You have created a Mynewt operating system running on the \nArduino Zero. The LED right next to the power LED should be blinking. It is toggled by one task running on the Mynewt OS." , + "title": "Blinky on Arduino Zero" + }, + { + "location": "/os/tutorials/arduino_zero/#running-mynewt-on-arduino-zero", + "text": "This tutorial describes how to run Mynewt OS on Arduino Zero.", + "title": "Running Mynewt on Arduino Zero" + }, + { + "location": "/os/tutorials/arduino_zero/#prerequisites", + "text": "Before tackling this tutorial, it's best to read about Mynewt in the Introduction section of this documentation.", + "title": "Prerequisites" + }, + { + "location": "/os/tutorials/arduino_zero/#equipment", + "text": "You will need the following equipment An Arduino Zero board. NOTE: There are many flavors of Arduino. Ensure that \nyou have an Arduino Zero. See below for the verions of Arduino Zero that are\ncompatible with this tutorial A computer that can connect to the Arduino Zero over USB A USB cable (Type A to micro B) that can connect the computer to the Arduino The Mynewt Release", + "title": "Equipment" + }, + { + "location": "/os/tutorials/arduino_zero/#arduino-boards", + "text": "This tutorial has been tested on the following two Arduino Zero boards.", + "title": "Arduino Boards" + }, + { + "location": "/os/tutorials/arduino_zero/#steps", + "text": "Follow these simple steps and your board will be blinking in no time!", + "title": "Steps" + }, + { + "location": "/os/tutorials/arduino_zero/#install-mynewt-and-newt", + "text": "If you have not already done so, install Newt as shown in the Newt install tutorial and cloned the Mynewt OS repository as shown in the Get Started tutorial for Sim Blinky", + "title": "Install Mynewt and Newt" + }, + { + "location": "/os/tutorials/arduino_zero/#fetch-external-packages-for-atmel-samd21", + "text": "Mynewt uses source code provided directly from the chip manufacturer for \nlow level operations. This code is licensed only for Atmel parts, and \ncannot live in the Apache Mynewt repository. Fetch the package from \nthe runtime github repository. To fetch the package from the runtime git repository, you need to add \nthe repository to the project.yml file in your base project directory. Here is an example project.yml file with the Arduino Zero repository\nadded: $ more project.yml \nproject.name: my_project \n\nproject.repositories:\n - apache-mynewt-core\n - mynewt_arduino_zero\n\nrepository.apache-mynewt-core:\n type: github\n vers: 0-latest\n user: apache\n repo: incubator-mynewt-core\n\nrepository.mynewt_arduino_zero:\n type: github\n vers: 0-latest\n user: runtimeinc\n repo: mynewt_arduino_zero\n$ In the above, the sections with mynewt_arduino_zero need to be added to \nyour project file. Once you've edited your project.yml file, the next step is to install the \nproject dependencies, this can be done with the newt install command \n(to see more output, provide the -v verbose option.): $ newt install \napache-mynewt-core\nmynewt_arduino_zero\n$", + "title": "Fetch External Packages for Atmel SAMD21" + }, + { + "location": "/os/tutorials/arduino_zero/#create-your-bootloader-target", + "text": "Next, you need to tell Newt what to build. For the Arduino Zero, we are going to \ngenerate both a bootloader, and an image target. To generate the bootloader target, you need to specify the following options: $ newt target create arduino_boot \nTarget targets/arduino_boot successfully created\n$ newt target set arduino_boot bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero \nTarget targets/arduino_boot successfully set target.bsp to @mynewt_arduino_zero/hw/bsp/arduino_zero\n$ newt target set arduino_boot app=@apache-mynewt-core/apps/boot \nTarget targets/arduino_boot successfully set target.app to @apache-mynewt-core/apps/boot\n$ newt target set arduino_boot features=arduino_zero_pro \nTarget targets/arduino_boot successfully set pkg.features to arduino_zero_pro These commands do a few things: Create a target named arduino_boot , in order to build the Arduino Zero Bootloader. Set the application for the arduino_boot target to the default Apache Mynewt \n bootloader ( @apache-mynewt-core/apps/boot ) Set the board support package for the target to \n @mynewt_arduino_zero/hw/bsp/arduino_zero . This is a reference to the downloaded \n Arduino Zero support from Github. Tells the Board Support Package to enable support for the Arduino Zero Pro, and not \n the Arduino Zero. This is done through setting a build feature. If you are building \n for an Arduino Zero, and not a Zero Pro, this feature should be set to arduino_zero . Once you've configured the bootloader target, the next step is to build the bootloader for\nyour Arduino, you can do this by using the newt build command: $ newt build arduino_boot \nCompiling asprintf.c\nCompiling atoi.c\nCompiling atol.c\nCompiling atoll.c\nCompiling bsearch.c\nCompiling bzero.c\nCompiling calloc.c\nCompiling fgets.c\nCompiling inline.c snip \nApp successfully built: myproject/bin/arduino_boot/apps/boot/boot.elf If this command finishes successfully, you have successfully built the Arduino \nbootloader, and the next step is to build your application for the Arduino \nboard. To create and download your application, you create another target, this one pointing\nto the application you want to download to the Arduino board. In this tutorial, \nwe will use the default application that comes with your project, apps/blinky : $ newt target create arduino_blinky \nTarget targets/arduino_blinky successfully created\n$ newt target set arduino_blinky app=apps/blinky \nTarget targets/arduino_blinky successfully set target.app to apps/blinky\n$ newt target set arduino_blinky bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero\nTarget targets/arduino_blinky successfully set target.bsp to @mynewt_arduino_zero/hw/bsp/arduino_zero\n$ newt target set arduino_blinky build_profile=debug \nTarget targets/arduino_blinky successfully set target.build_profile to debug\n$ newt target set arduino_blinky features=arduino_zero_pro \nTarget targets/arduino_blinky successfully set p kg.features to arduino_zero_pro\n$ You can now build the target, with newt build : $ newt build arduino_blinky \nCompiling main.c\nArchiving blinky.a\nCompiling cons_fmt.c\nCompiling cons_tty.c\nArchiving full.a\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\nArchiving testutil.a snip \nApp successfully built: myproject/bin/arduino_blinky/apps/blinky/blinky.elf Congratulations! You have successfully built your application, now it's \ntime to load the bootloader and application onto the target.", + "title": "Create your bootloader Target" + }, + { + "location": "/os/tutorials/arduino_zero/#connect-the-target", + "text": "Connect your computer to the Arduino Zero (from now on we'll call this the \ntarget) with the Micro-USB cable through the Programming Port as shown below. \nMynewt will download and debug the target through this port. You should see a \nlittle green LED come on. That means the board has power. No external debugger is required. The Arduino Zero comes with an internal\ndebugger that can be accessed by Mynewt. A image below shows the Arduino Zero Programming Port.", + "title": "Connect the Target" + }, + { + "location": "/os/tutorials/arduino_zero/#download-the-bootloader", + "text": "Execute the command to download the bootloader. $ newt load arduino_boot If the newt tool finishes without error, that means the bootloader has been \nsuccessfully loaded onto the target.", + "title": "Download the Bootloader" + }, + { + "location": "/os/tutorials/arduino_zero/#run-the-image", + "text": "Now that the bootloader is downloaded to the target, the next step is to load \nyour image onto the Arduino Zero. The easiest way to do this, is to use the newt run command. newt run will automatically rebuild your program\n(if necessary), create an image, and load it onto the target device. Here, we will load our arduino_blinky target onto the device, and we \nshould see it run: $ newt run arduino_blinky 0.0.0 \nDebugging myproject/bin/arduino_blinky/apps/blinky/blinky.elf\nOpen On-Chip Debugger 0.9.0 (2015-09-23-21:46)\nLicensed under GNU GPL v2\nFor bug reports, read\n http://openocd.org/doc/doxygen/bugs.html\nInfo : only one transport option; autoselect swd \nadapter speed: 500 kHz\nadapter_nsrst_delay: 100\ncortex_m reset_config sysresetreq\nInfo : CMSIS-DAP: SWD Supported\nInfo : CMSIS-DAP: JTAG Supported\nInfo : CMSIS-DAP: Interface Initialised (SWD)\nInfo : CMSIS-DAP: FW Version = 01.1F.0118\nInfo : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1\nInfo : CMSIS-DAP: Interface ready\nInfo : clock speed 500 kHz\nInfo : SWD IDCODE 0x0bc11477\nInfo : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints\nGNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\nCopyright (C) 2014 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html \nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type show copying \nand show warranty for details.\nThis GDB was configured as --host=x86_64-apple-darwin10 --target=arm-none-eabi .\nType show configuration for configuration details.\nFor bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/ .\nFind the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/ .\nFor help, type help .\nType apropos word to search for commands related to word ...\nReading symbols from myproject/bin/arduino_blinky/apps/blinky/blinky.elf...done.\ntarget state: halted\ntarget halted due to debug-request, current mode: Thread \nxPSR: 0x21000000 pc: 0x0000030e msp: 0x20008000\nInfo : accepting gdb connection on tcp/3333\nInfo : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)\n0x0000030e in ?? ()\n(gdb) r\nThe remote target does not support run . Try help target or continue .\n(gdb) c\nContinuing. NOTE: The 0.0.0 specified after the target name to newt run, is the version \nof the image to load. If you are not providing remote upgrade, and are just \ndeveloping locally, you can provide 0.0.0 for every image version. If you want the image to run without the debugger connected, simply quit the \ndebugger and restart the board. The image you programmed will come and run on the \nArduino on next boot!", + "title": "Run the Image" + }, + { + "location": "/os/tutorials/arduino_zero/#watch-the-led-blink", + "text": "Congratulations! You have created a Mynewt operating system running on the \nArduino Zero. The LED right next to the power LED should be blinking. It is toggled by one task running on the Mynewt OS.", + "title": "Watch the LED blink" + }, + { "location": "/os/tutorials/olimex/", - "text": "Blinky, Your Hello World!\n\n\nObjective\n\n\nLearn how to use packages from a default application repository of Mynewt to build your first \nHello World\n application (Blinky) on a target board. Once built using the \nnewt\n tool, this application will blink the LED lights on the target board. Fun stuff!\n\n\nThis tutorial will guide you to achieve the following, assuming you have already set up the environment on your computer to use Mynewt OS and newt tool:\n\n\n\n\nDownload packages and use tools to create a runtime image for a board to make its LED blink. You have two choices here:\n\n\nDownload an image to SRAM\n, or \n\n\nDownload it to flash\n.\n\n\n\n\n\n\n\n\n\n\n Time Requirement\n: Allow yourself a couple of hours for this project if you are relatively new to embedded systems and playing with development boards. Those jumpers can be pesky!\n\n\n\n\nWhat you need\n\n\n\n\nSTM32-E407 development board from Olimex. You can order it from \nhttp://www.mou ser.com\n, \nhttp://www.digikey.com\n, and other places.\n\n\nARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)\n\n\nUSB A-B type cable to connect the debugger to your personal computer\n\n\nPersonal Computer with Mac OS (Mac: OS X Yosemite Version 10.10.5) or Linux box (Ubuntu 14.10: Utopic Unicorn)\n\n\nAn account on Github repository and \ngit\n installed on your computer.\n\n\nIt is assumed you have already installed newt tool. \n\n\nIt is assumed you already installed native tools as described \nhere\n\n\n\n\nAlso, we assume that you're familiar with UNIX shells. Let's gets started!\n\n\n\n\nUse SRAM to make LED blink\n\n\nIf you wish to build the image to run from the onboard SRAM on Olimex board, follow the steps below:\n\n\n\n\nPrepare the Software\n\n\n\n\nMake sure the PATH environment variable includes the $HOME/dev/go/bin directory. \n\n\n\n\n\n\nCreate a project.\n\n\nCreate a new projec t to hold your work. For a deeper understanding, you can read about project creation in \n\nGet Started -- Creating Your First Project\n\nor just follow the commands below.\n\n\n $ mkdir ~/dev\n $ cd ~/dev\n $ newt new myproj\n Downloading project skeleton from apache/incubator-mynewt-blinky...\n Installing skeleton in myproj...\n Project myproj successfully created.\n\n $cd myproj\n\n $ newt install -v \n apache-mynewt-core\n Downloading repository description for apache-mynewt-core... success!\n ...\n apache-mynewt-core successfully installed version 0.7.9-none\n\n\n\n\n\n\n\nCreate a target\n\n\nChange directory to ~/dev/core directory and define the \nblinky\n target inside core, using the \nnewt\n tool. Starting with the target name, assign specific aspects of the project, as shown below, to pull the appropriate packages and build the right bundle or list for the board. For example, we set the build_profile, board support package (bsp), and app.\n\n\n $ newt target create blinky\n Target targets/blinky successfully created\n $ newt target set blinky build_profile=debug\n Target targets/blinky successfully set target.compiler_def to debug\n $ newt target set blinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n Target targets/blinky successfully set target.bsp to ...\n $ newt target set blinky app=@apache-mynewt-core/apps/blinky\n Target targets/blinky successfully set target.app to apps/blinky\n $ newt target show blinky\n targets/boot_olimex\n app=apps/blinky\n bsp=hw/bsp/olimex_stm32-e407_devboard\n build_profile=debug\n\n\n\n\n\n\n\nBuild the image\n\n\nNext, let's build the image with the above values assigned. By default, the linker script within the \nhw/bsp/olimex_stm32-e407_devboard\n package builds an image for flash memory, which we don't want; instead, we want an image for the SRAM, so you need to switch that script with \nrun_from_sram.ld\n. \n \n\n\n(We are working to simplify this scheme whereby an executable for a project will correctly elect the linker scripts and generate the relevant image. For example, the scheme will key on project identity such as bootloader, RAM, Flash (default) and build accordingly.) \n.\n\n\nAfer you build the target, you can find the executable \nblinky.elf\n in the project directory \n~/dev/core/bin/blinky/apps/blinky/.\n \n\n\n $ cd ~/dev/core/hw/bsp/olimex_stm32-e407_devboard\n $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n (some diff will be displayed)\n $ cp run_from_sram.ld olimex_stm32-e407_devboard.ld\n $ cd ~/dev/core\n $ newt build blinky\n Compiling case.c\n Compiling suite.c\n ...\n Linking blinky.elf\n App successfully built:~/dev/core/bin/blinky/apps/blinky/blinky.elf \n $ ls bin/blinky/apps/blinky/\n blinky.elf blinky.elf.bin blinky.elf.cmd \n blinky.elf.lst blinky.elf.map\n\n\n\n\n\n\n\nPrepare the hardwa re to boot from embedded SRAM\n\n\n\n\nLocate the boot jumpers on the board.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nB1_1/B1_0 and B0_1/B0_0 are PTH jumpers. Note that because the markings on the board may not always be accurate, when in doubt, you should always refer to the manual for the correct positioning. Since the jumpers are a pair, they should move together, and as such, the pair is responsible for the boot mode when bootloader is present. \nTo locate the bootloader, the board searches in three places: User Flash Memory, System Memory or the Embedded SRAM. For this Blinky project, we will configure it to boot from SRAM by jumpering \nB0_1\n and \nB1_1\n.\n\n\n\n\n\n\nConnect USB-OTG#2 in the picture above to a USB port on your computer (or a powered USB hub to make sure there is enough power available to the board). \n\n\n\n\n\n\nThe red PWR LED should be lit. \n\n\n\n\n\n\nConnect the JTAG connector to the SWD/JTAG interface on the board. The other end of the cable should be conne cted to the USB port or hub of your computer.\n\n\n\n\n\n\n\n\nLet's Go!\n\n\n\n\nEnsure that you are in the blinky project directory with the \nblinky.elf\n executable. Run the debug command in the \nnewt\n tool. You'll see some status messages as shown below. In case you need to halt the debugging session, you can issue an \n-c \"reset halt\"\n command.\n\n\n\n\n $ cd ~/dev/core\n $ newt debug blinky\n Debugging with ~/dev/core/hw/bsp/olimex_...\n Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 \nhttp://gnu.org/licenses/gpl.html\n\n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x080003c0 msp: 0x10010000\n Info : accepting \ngdb\n connection on tcp/3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes\n\n\n\n\n\n\n\nCheck the value of the msp (main service pointer) register. If it is not 0x10010000 as indicated above, you will have to manually set it after you open the gdb tool and load the image on it. For example, \n\n\n (gdb) set $msp=0x10010000\n\n\n\n\n\n\n\nNow load the image and type \"c\" or \"continue\" from the GNU debugger. \n\n\n (gdb) load ~/dev/core/bin/blinky/apps/blinky/blinky.elf \n Loading section .text, size 0x16b88 lma 0x20000000\n Loading section .ARM.exidx, size 0x18 lma 0x20016b88\n Loading section .data, size 0x9ec lma 0x20016ba0\n Start address 0x200004b8, load size 95628\n Transfer rate: 74 KB/sec, 3825 bytes/write.\n (gdb) c\n Continuing.\n\n\n\n\n\n\n\nVoil\u00e0! The board's LED should be blinking at 1 Hz. Success!\n\n\n\n\n\n\nUse flash to make LED blink\n\n\nIf you wish to build the image to run from the onboard flash memory on Olimex board, follow the step s below:\n\n\n\n\n\n\nConfigure the board to boot from flash by moving the two jumpers together to \nB0_0\n and \nB1_0\n. Refer to the pictures of the board under the section titled \n\"Prepare the hardware to boot from embedded SRAM\"\n.\n\n\nYou will have to reset the board once the image is uploaded to it.\n\n\n\n\n\n\nIf you skipped the first option for the project \n(downloading an image to SRAM)\n, then skip this step. Otherwise, continue with this step. \n\n\n\n\n\n\nBy default, the linker script (\nolimex_stm32-e407_devboard.ld\n) is configured to run from bootloader and flash. However, if you first ran the image from SRAM you had changed \nolimex_stm32-e407_devboard.ld\n to match \nrun_from_sram.ld\n. You will, therefore, return to defaults with \nolimex_stm32-e407_devboard.ld\n linker script matching the contents of 'run_from_loader.ld'. Return to the project directory.\n\n\n $ cd ~/dev/core/hw/bsp/olimex_stm32-e407_devboard\n $ diff olimex_stm32-e407_devboard.ld run _from_sram.ld\n $ diff olimex_stm32-e407_devboard.ld run_from_loader.ld\n (some diff will be displayed)\n $ cp run_from_loader.ld olimex_stm32-e407_devboard.ld\n $ cd ~/dev/core\n\n\n\n\n\n\n\n\n\nIn order to run the image from flash, you need to build the bootloader as well. The bootloader does the initial set up of the Olimex board and then transfers control to the image stored at a location in flash known to it. \n\n\n\n\nLet\ns create boot_olimex:\n\n```no-highlight\n $ newt target create boot_olimex\n Creating target boot_olimex\n Target boot_olimex successfully created!\n $ newt target set boot_olimex build_profile=optimized\n Target boot_olimex successfully set compiler_def to optimized\n $ newt target set boot_olimex @apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n Target boot_olimex successfully set bsp to ...\n $ newt target set boot_olimex app=@apache-mynewt-core/apps/boot\n Target targets/boot_olimex successfully set target.a pp to apps/boot\n $ newt target show boot_olimex\n targets/boot_olimex\n app=app=@apache-mynewt-core/apps/boot\n bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboar\n build_profile=optimized\n\n\n\n\n\n\n\n\n\nNow let's build both targets now.\n\n\n\n\n $ newt build boot_olimex\n ...\n App successfully built: ~/dev/core/bin/boot_olimex/apps/boot/boot_olimex.elf\n $ newt build blinky\n ...\n Linking blinky.elf\n App successfully built: ~/dev/core/bin/blinky/apps/blinky/blinky.elf\n\n\n\n\n\n\n\n\n\nCreate the blinky image and download the bootloader and the image to flash ... in a flash! \nWhen creating an image, you can assign a version number to your image; here we use '1.2.3'\n\n\n\n\n $ newt create-image blinky 1.2.3\n App image successfully generated: ~/dev/core/bin/blinky/apps/blinky/blinky.img\n Build manifest: ~/dev/core/bin/blinky/apps/blinky/manifest.json\n $ newt load boot_olimex\n Downloading ~/dev/core/b in/boot_olimex/apps/boot/boot.elf.bin to 0x08000000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked\n $ newt load blinky\n Downloading ~/dev/core/bin/blinky/apps/blinky/blinky.img to 0x08020000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked\n\n\n\n\n\n\n\n\n\nVoil\u00e0! The LED should be blinking! Success!\n\n\n\n\n\n\nBut wait...not so fast.\n Let's double check that it is indeed booting from flash and making the LED blink from the image in flash. Pull the USB cable off the Olimex JTAG adaptor, severing the debug connection to the JTAG port. Next power off the Olimex board by pulling out the USB cable from the board. Wait for a couple of seconds and plug the USB cable back to the board. \n\n\nThe LED light will start blinking again. Success!\n\n\nNote #1:\n If you want to download the image to flash and a gdb session opened up, use \nnewt debug blinky\n after \nnewt download blinky\n.\n\n\ n $ newt debug blinky\n Debugging with ~/dev/core/hw/bsp/olimex_stm32-e407_...\n Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 \nhttp://gnu.org/licenses/gpl.html\n\n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x08000250 msp: 0x10010000\n Info : accepting \ngdb\n connection from 3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes\n Reset_Handler () at startup_STM32F40x.s:199\n 199 ldr r1, =__etext\n (gdb)\n\n\n\n\n\n\n\nNote #2:\n If you want to erase the flash and load the image again you may use the following commands from within gdb. \nflash erase_sector 0 0 x\n tells it to erase sectors 0 through x. When you ask it to display (in hex notation) the contents of the sector starting at location 'lma,' you should see all f's. The memory location 0x8000000 is the start or origin of the flash memory contents and is specified in the olimex_stm32-e407_devboard.ld linker script. The flash memory locations is specific to the processor.\n\n\n (gdb) monitor flash erase_sector 0 0 4\n erased sectors 0 through 4 on flash bank 0 in 2.296712s\n (gdb) monitor mdw 0x08000000 16\n 0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (gdb) monitor flash info 0\n\n\n\n\n\nConclusion\n\n\nCongratulations! You have now tried out a project on actual hardware. If this is your first time to embedded systems, this must feel like the best hands-on and low-level \"Hello World\" program ever. \n\n\nGood, we have more fun tutorials for you to get your hands dirty. Be bold and try other Blinky-like \ntutorials\n.\n\n\nIf you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our \nCommunity Page\n\n\nKeep on hacking and blinking!", + "text": "Blinky, Your Hello World!\n\n\nObjective\n\n\nLearn how to use packages from a default application repository of Mynewt to build your first \nHello World\n application (Blinky) on a target board. Once built using the \nnewt\n tool, this application will blink the LED lights on the target board. Fun stuff!\n\n\nThis tutorial will guide you to achieve the following, assuming you have already set up the environment on your computer to use Mynewt OS and newt tool:\n\n\n\n\nDownload packages and use tools to create a runtime image for a board to make its LED blink. You have two choices here:\n\n\nDownload an image to SRAM\n, or \n\n\nDownload it to flash\n.\n\n\n\n\n\n\n\n\n\n\n Time Requirement\n: Allow yourself a couple of hours for this project if you are relatively new to embedded systems and playing with development boards. Those jumpers can be pesky!\n\n\n\n\nWhat you need\n\n\n\n\nSTM32-E407 development board from Olimex. You can order it from \nhttp://www.mou ser.com\n, \nhttp://www.digikey.com\n, and other places.\n\n\nARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)\n\n\nUSB A-B type cable to connect the debugger to your personal computer\n\n\nPersonal Computer with Mac OS (Mac: OS X Yosemite Version 10.10.5) or Linux box (Ubuntu 14.10: Utopic Unicorn)\n\n\nAn account on Github repository and \ngit\n installed on your computer.\n\n\nIt is assumed you have already installed newt tool. \n\n\nIt is assumed you already installed native tools as described \nhere\n\n\n\n\nAlso, we assume that you're familiar with UNIX shells. Let's gets started!\n\n\n\n\nUse SRAM to make LED blink\n\n\nIf you wish to build the image to run from the onboard SRAM on Olimex board, follow the steps below:\n\n\n\n\nPrepare the Software\n\n\n\n\nMake sure the PATH environment variable includes the $HOME/dev/go/bin directory. \n\n\n\n\n\n\nCreate a project.\n\n\nCreate a new projec t to hold your work. For a deeper understanding, you can read about project creation in \n\nGet Started -- Creating Your First Project\n\nor just follow the commands below.\n\n\n $ mkdir ~/dev\n $ cd ~/dev\n $ newt new myproj\n Downloading project skeleton from apache/incubator-mynewt-blinky...\n Installing skeleton in myproj...\n Project myproj successfully created.\n\n $cd myproj\n\n $ newt install -v \n apache-mynewt-core\n Downloading repository description for apache-mynewt-core... success!\n ...\n apache-mynewt-core successfully installed version 0.7.9-none\n\n\n\n\n\n\n\nCreate a target\n\n\nChange directory to ~/dev/myproj directory and define the \nblinky\n target inside myproj, using the \nnewt\n tool. Starting with the target name, assign specific aspects of the project, as shown below, to pull the appropriate packages and build the right bundle or list for the board. For example, we set the build_profile, board support package (bsp), and app.\n\n\n $ newt target create blinky\n $ newt target set blinky build_profile=debug\n $ newt target set blinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n $ newt target set blinky app=apps/blinky\n $ newt target show blinky\n targets/boot_olimex\n app=apps/blinky\n bsp=hw/bsp/olimex_stm32-e407_devboard\n build_profile=debug\n\n\n\n\n\n\n\nBuild the image\n\n\nNext, let's build the image with the above values assigned. By default, the linker script within the \nhw/bsp/olimex_stm32-e407_devboard\n package builds an image for flash memory, which we don't want; instead, we want an image for the SRAM, so you need to switch that script with \nrun_from_sram.ld\n. \n\n\n\n(We are working to simplify this scheme whereby an executable for a project will correctly elect the linker scripts and generate the relevant image. For example, the scheme will key on project identity such as bootloader, RAM, Flash (default) and build accordingl y.) \n.\n\n\nAfer you build the target, you can find the executable \nblinky.elf\n in the project directory \n~/dev/myproj/bin/blinky/apps/blinky/.\n \n\n\n $ cd ~/dev/myproj/repos/apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard/\n $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n (some diff will be displayed)\n $ cp run_from_sram.ld olimex_stm32-e407_devboard.ld\n $ cd ~/dev/myproj\n $ newt build blinky\n Compiling case.c\n Compiling suite.c\n ...\n Linking blinky.elf\n App successfully built:~/dev/myproj/bin/blinky/apps/blinky/blinky.elf\n $ ls ~/dev/myproj/bin/blinky/apps/blinky/\n blinky.elf blinky.elf.bin blinky.elf.cmd \n blinky.elf.lst blinky.elf.map\n\n\n\n\n\n\n\nPrepare the hardware to boot from embedded SRAM\n\n\n\n\nLocate the boot jumpers on the board.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nB1_1/B1_0 and B0_1/B0_0 are PTH jumpers. Note that because the markings on the board may not always be accurate, whe n in doubt, you should always refer to the manual for the correct positioning. Since the jumpers are a pair, they should move together, and as such, the pair is responsible for the boot mode when bootloader is present. \nTo locate the bootloader, the board searches in three places: User Flash Memory, System Memory or the Embedded SRAM. For this Blinky project, we will configure it to boot from SRAM by jumpering \nB0_1\n and \nB1_1\n.\n\n\n\n\n\n\nConnect USB-OTG#2 in the picture above to a USB port on your computer (or a powered USB hub to make sure there is enough power available to the board). \n\n\n\n\n\n\nThe red PWR LED should be lit. \n\n\n\n\n\n\nConnect the JTAG connector to the SWD/JTAG interface on the board. The other end of the cable should be connected to the USB port or hub of your computer.\n\n\n\n\n\n\n\n\nLet's Go!\n\n\n\n\nEnsure that you are in the blinky project directory with the \nblinky.elf\n executable. Run the debug command in the \nnewt\n tool. You'll see s ome status messages as shown below. In case you need to halt the debugging session, you can issue an \n-c \"reset halt\"\n command.\n\n\n\n\n $ cd ~/dev/core\n $ newt debug blinky\n Debugging with ~/dev/core/hw/bsp/olimex_...\n Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 \nhttp://gnu.org/licenses/gpl.html\n\n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x080003c0 msp: 0x10010000\n Info : accepting \ngdb\n connection on tcp/3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes\n\n\n\n\n\n\n\nCheck the value of the msp (main service pointer) register. If it is not 0x10010000 as indicated above, you will have to manually set it after you open the gdb tool and load the image o n it. For example, \n\n\n (gdb) set $msp=0x10010000\n\n\n\n\n\n\n\nNow load the image and type \"c\" or \"continue\" from the GNU debugger. \n\n\n (gdb) load ~/dev/myproj/bin/blinky/apps/blinky/blinky.elf \n Loading section .text, size 0x16b88 lma 0x20000000\n Loading section .ARM.exidx, size 0x18 lma 0x20016b88\n Loading section .data, size 0x9ec lma 0x20016ba0\n Start address 0x200004b8, load size 95628\n Transfer rate: 74 KB/sec, 3825 bytes/write.\n (gdb) c\n Continuing.\n\n\n\n\n\n\n\nVoil\u00e0! The board's LED should be blinking at 1 Hz. Success!\n\n\n\n\n\n\nUse flash to make LED blink\n\n\nIf you wish to build the image to run from the onboard flash memory on Olimex board, follow the steps below:\n\n\n\n\n\n\nConfigure the board to boot from flash by moving the two jumpers together to \nB0_0\n and \nB1_0\n. Refer to the pictures of the board under the section titled \n\"Prepare the hardware to boot from embedded SRAM\"\n.\n\n\nYou will have to re set the board once the image is uploaded to it.\n\n\n\n\n\n\nIf you skipped the first option for the project \n(downloading an image to SRAM)\n, then skip this step. Otherwise, continue with this step. \n\n\n\n\n\n\nBy default, the linker script (\nolimex_stm32-e407_devboard.ld\n) is configured to run from bootloader and flash. However, if you first ran the image from SRAM you had changed \nolimex_stm32-e407_devboard.ld\n to match \nrun_from_sram.ld\n. You will, therefore, return to defaults with \nolimex_stm32-e407_devboard.ld\n linker script matching the contents of 'run_from_loader.ld'. Return to the project directory.\n\n\n$ cd ~/dev/myproj/repos/apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard/\n$ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n$ diff olimex_stm32-e407_devboard.ld run_from_loader.ld\n(some diff will be displayed)\n$ cp run_from_loader.ld olimex_stm32-e407_devboard.ld\n$ cd ~/dev/myproj\n\n\n\n\n\n\n\n\n\nIn order to run the image from flash, you need t o build the bootloader as well. The bootloader does the initial set up of the Olimex board and then transfers control to the image stored at a location in flash known to it. \n\n\n\n\nLet's create boot_olimex:\n\n\n $ newt target create boot_olimex\n $ newt target set boot_olimex build_profile=optimized\n $ newt target set boot_olimex bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n $ newt target set boot_olimex app=@apache-mynewt-core/apps/boot\n $ newt target show boot_olimex\n targets/boot_olimex\n app=app=@apache-mynewt-core/apps/boot\n bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboar\n build_profile=optimized\n\n\n\n\n\n\n\n\n\nNow let's build both targets now.\n\n\n\n\n $ newt build boot_olimex\n ...\n App successfully built: ~/dev/myproj/bin/boot_olimex/apps/boot/boot.elf\n $ newt build blinky\n ...\n Linking blinky.elf\n App successfully built: ~/dev/myproj/bin/blinky/apps/blinky/blinky.elf\n\n\n\ n\n\n\n\n\n\nCreate the blinky image and download the bootloader and the image to flash ... in a flash! \nWhen creating an image, you can assign a version number to your image; here we use '1.2.3'\n\n\n\n\n $ newt create-image blinky 1.2.3\n App image succesfully generated: ~/dev/myproj/bin/blinky/apps/blinky/blinky.img\n Build manifest: ~/dev/myproj/bin/blinky/apps/blinky/manifest.json\n $ newt load boot_olimex\n Downloading~/dev/myproj/bin/boot_olimex/apps/boot/boot.elf.bin to 0x08000000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked\n $ newt load blinky\n Downloading ~/dev/myproj/bin/blinky/apps/blinky/blinky.img to 0x08020000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked\n\n\n\n\n\n\n\n\n\nVoil\u00e0! The LED should be blinking! Success!\n\n\n\n\n\n\nBut wait...not so fast.\n Let's double check that it is indeed booting from flash and making the LED blink from the image in flash. Pull the USB cable off the Olimex JTAG adaptor, severing the debug connection to the JTAG port. Next power off the Olimex board by pulling out the USB cable from the board. Wait for a couple of seconds and plug the USB cable back to the board. \n\n\nThe LED light will start blinking again. Success!\n\n\nNote #1:\n If you want to download the image to flash and a gdb session opened up, use \nnewt debug blinky\n after \nnewt download blinky\n.\n\n\n $ newt debug blinky\n Debugging with ~/dev/myproj/hw/bsp/olimex_stm32-e407_...\n Debugging ~/dev/myproj/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 \nhttp://gnu.org/licenses/gpl.html\n\n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x08000250 msp: 0x10010000\n Info : accepting \ngdb\n connection from 3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes\n Reset_Handler () at startup_STM32F40x.s:199\n 199 ldr r1, =__etext\n (gdb)\n\n\n\n\n\n\n\nNote #2:\n If you want to erase the flash and load the image again you may use the following commands from within gdb. \nflash erase_sector 0 0 x\n tells it to erase sectors 0 through x. When you ask it to display (in hex notation) the contents of the sector starting at location 'lma,' you should see all f's. The memory location 0x8000000 is the start or origin of the flash memory contents and is specified in the olimex_stm32-e407_devboard.ld linker script. The flash memory locations is specific to the processor.\n\n\n (gdb) monitor flash erase_sector 0 0 4\n erased sectors 0 through 4 on flash bank 0 in 2.296712s\n (gdb) monitor mdw 0x08000000 16\n 0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffff ffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (gdb) monitor flash info 0\n\n\n\n\n\nConclusion\n\n\nCongratulations! You have now tried out a project on actual hardware. If this is your first time to embedded systems, this must feel like the best hands-on and low-level \"Hello World\" program ever. \n\n\nGood, we have more fun tutorials for you to get your hands dirty. Be bold and try other Blinky-like \ntutorials\n.\n\n\nIf you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our \nCommunity Page\n\n\nKeep on hacking and blinking!", "title": "Blinky on Olimex" }, { @@ -282,12 +367,12 @@ }, { "location": "/os/tutorials/olimex/#create-a-target", - "text": "Change directory to ~/dev/core directory and define the blinky target inside core, using the newt tool. Starting with the target name, assign specific aspects of the project, as shown below, to pull the appropriate packages and build the right bundle or list for the board. For example, we set the build_profile, board support package (bsp), and app. $ newt target create blinky\n Target targets/blinky successfully created\n $ newt target set blinky build_profile=debug\n Target targets/blinky successfully set target.compiler_def to debug\n $ newt target set blinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n Target targets/blinky successfully set target.bsp to ...\n $ newt target set blinky app=@apache-mynewt-core/apps/blinky\n Target targets/blinky successfully set target.app to apps/blinky\n $ newt target show blinky\n targets/boot_olimex\n app=apps/blinky\n bsp=hw/bsp/olimex_stm32-e407_devboard\n build_profile=debug", + "text": "Change directory to ~/dev/myproj directory and define the blinky target inside myproj, using the newt tool. Starting with the target name, assign specific aspects of the project, as shown below, to pull the appropriate packages and build the right bundle or list for the board. For example, we set the build_profile, board support package (bsp), and app. $ newt target create blinky\n $ newt target set blinky build_profile=debug\n $ newt target set blinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n $ newt target set blinky app=apps/blinky\n $ newt target show blinky\n targets/boot_olimex\n app=apps/blinky\n bsp=hw/bsp/olimex_stm32-e407_devboard\n build_profile=debug", "title": "Create a target" }, { "location": "/os/tutorials/olimex/#build-the-image", - "text": "Next, let's build the image with the above values assigned. By default, the linker script within the hw/bsp/olimex_stm32-e407_devboard package builds an image for flash memory, which we don't want; instead, we want an image for the SRAM, so you need to switch that script with run_from_sram.ld . \n(We are working to simplify this scheme whereby an executable for a project will correctly elect the linker scripts and generate the relevant image. For example, the scheme will key on project identity such as bootloader, RAM, Flash (default) and build accordingly.) . Afer you build the target, you can find the executable blinky.elf in the project directory ~/dev/core/bin/blinky/apps/blinky/. $ cd ~/dev/core/hw/bsp/olimex_stm32-e407_devboard\n $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n (some diff will be displayed)\n $ cp run_from_sram.ld olimex_stm32-e407_devboard.ld\n $ cd ~/dev/core\n $ newt build blinky\n Compiling cas e.c\n Compiling suite.c\n ...\n Linking blinky.elf\n App successfully built:~/dev/core/bin/blinky/apps/blinky/blinky.elf \n $ ls bin/blinky/apps/blinky/\n blinky.elf blinky.elf.bin blinky.elf.cmd \n blinky.elf.lst blinky.elf.map", + "text": "Next, let's build the image with the above values assigned. By default, the linker script within the hw/bsp/olimex_stm32-e407_devboard package builds an image for flash memory, which we don't want; instead, we want an image for the SRAM, so you need to switch that script with run_from_sram.ld . \n(We are working to simplify this scheme whereby an executable for a project will correctly elect the linker scripts and generate the relevant image. For example, the scheme will key on project identity such as bootloader, RAM, Flash (default) and build accordingly.) . Afer you build the target, you can find the executable blinky.elf in the project directory ~/dev/myproj/bin/blinky/apps/blinky/. $ cd ~/dev/myproj/repos/apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard/\n $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n (some diff will be displayed)\n $ cp run_from_sram.ld olimex_stm32-e407_devboard.ld\n $ cd ~/dev/myproj\n $ newt build blinky\n Compiling case.c\n Compiling suite.c\n ...\n Linking blinky.elf\n App successfully built:~/dev/myproj/bin/blinky/apps/blinky/blinky.elf\n $ ls ~/dev/myproj/bin/blinky/apps/blinky/\n blinky.elf blinky.elf.bin blinky.elf.cmd \n blinky.elf.lst blinky.elf.map", "title": "Build the image" }, { @@ -297,12 +382,12 @@ }, { "location": "/os/tutorials/olimex/#lets-go", - "text": "Ensure that you are in the blinky project directory with the blinky.elf executable. Run the debug command in the newt tool. You'll see some status messages as shown below. In case you need to halt the debugging session, you can issue an -c \"reset halt\" command. $ cd ~/dev/core\n $ newt debug blinky\n Debugging with ~/dev/core/hw/bsp/olimex_...\n Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 http://gnu.org/licenses/gpl.html \n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x080003c0 msp: 0x10010000\n Info : accepting gdb connection on tcp/3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes Check the value of the msp (main service pointer) register. If it is not 0x10010000 as indicated above, you will have to manually set it after you open the gdb tool and load the image on it. For example, (gdb) set $msp=0x10010000 Now load the image and type \"c\" or \"continue\" from the GNU debugger. (gdb) load ~/dev/core/bin/blinky/apps/blinky/blinky.elf \n Loading section .text, size 0x16b88 lma 0x20000000\n Loading section .ARM.exidx, size 0x18 lma 0x20016b88\n Loading section .data, size 0x9ec lma 0x20016ba0\n Start address 0x200004b8, load size 95628\n Transfer rate: 74 KB/sec, 3825 bytes/write.\n (gdb) c\n Continuing. Voil\u00e0! The board's LED should be blinking at 1 Hz. Success!", + "text": "Ensure that you are in the blinky project directory with the blinky.elf executable. Run the debug command in the newt tool. You'll see some status messages as shown below. In case you need to halt the debugging session, you can issue an -c \"reset halt\" command. $ cd ~/dev/core\n $ newt debug blinky\n Debugging with ~/dev/core/hw/bsp/olimex_...\n Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 http://gnu.org/licenses/gpl.html \n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x080003c0 msp: 0x10010000\n Info : accepting gdb connection on tcp/3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes Check the value of the msp (main service pointer) register. If it is not 0x10010000 as indicated above, you will have to manually set it after you open the gdb tool and load the image on it. For example, (gdb) set $msp=0x10010000 Now load the image and type \"c\" or \"continue\" from the GNU debugger. (gdb) load ~/dev/myproj/bin/blinky/apps/blinky/blinky.elf \n Loading section .text, size 0x16b88 lma 0x20000000\n Loading section .ARM.exidx, size 0x18 lma 0x20016b88\n Loading section .data, size 0x9ec lma 0x20016ba0\n Start address 0x200004b8, load size 95628\n Transfer rate: 74 KB/sec, 3825 bytes/write.\n (gdb) c\n Continuing. Voil\u00e0! The board's LED should be blinking at 1 Hz. Success!", "title": "Let's Go!" }, { "location": "/os/tutorials/olimex/#use-flash-to-make-led-blink", - "text": "If you wish to build the image to run from the onboard flash memory on Olimex board, follow the steps below: Configure the board to boot from flash by moving the two jumpers together to B0_0 and B1_0 . Refer to the pictures of the board under the section titled \"Prepare the hardware to boot from embedded SRAM\" . You will have to reset the board once the image is uploaded to it. If you skipped the first option for the project (downloading an image to SRAM) , then skip this step. Otherwise, continue with this step. By default, the linker script ( olimex_stm32-e407_devboard.ld ) is configured to run from bootloader and flash. However, if you first ran the image from SRAM you had changed olimex_stm32-e407_devboard.ld to match run_from_sram.ld . You will, therefore, return to defaults with olimex_stm32-e407_devboard.ld linker script matching the contents of 'run_from_loader.ld'. Return to the project directory. $ cd ~/dev/core/hw/bsp/olime x_stm32-e407_devboard\n $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n $ diff olimex_stm32-e407_devboard.ld run_from_loader.ld\n (some diff will be displayed)\n $ cp run_from_loader.ld olimex_stm32-e407_devboard.ld\n $ cd ~/dev/core In order to run the image from flash, you need to build the bootloader as well. The bootloader does the initial set up of the Olimex board and then transfers control to the image stored at a location in flash known to it. Let s create boot_olimex:\n\n```no-highlight\n $ newt target create boot_olimex\n Creating target boot_olimex\n Target boot_olimex successfully created!\n $ newt target set boot_olimex build_profile=optimized\n Target boot_olimex successfully set compiler_def to optimized\n $ newt target set boot_olimex @apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n Target boot_olimex successfully set bsp to ...\n $ newt target set boot_olimex app=@apache-mynewt-core/apps/boot\n Target ta rgets/boot_olimex successfully set target.app to apps/boot\n $ newt target show boot_olimex\n targets/boot_olimex\n app=app=@apache-mynewt-core/apps/boot\n bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboar\n build_profile=optimized Now let's build both targets now. $ newt build boot_olimex\n ...\n App successfully built: ~/dev/core/bin/boot_olimex/apps/boot/boot_olimex.elf\n $ newt build blinky\n ...\n Linking blinky.elf\n App successfully built: ~/dev/core/bin/blinky/apps/blinky/blinky.elf Create the blinky image and download the bootloader and the image to flash ... in a flash! \nWhen creating an image, you can assign a version number to your image; here we use '1.2.3' $ newt create-image blinky 1.2.3\n App image successfully generated: ~/dev/core/bin/blinky/apps/blinky/blinky.img\n Build manifest: ~/dev/core/bin/blinky/apps/blinky/manifest.json\n $ newt load boot_olimex\n Downloading ~/dev/core/bin/ boot_olimex/apps/boot/boot.elf.bin to 0x08000000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked\n $ newt load blinky\n Downloading ~/dev/core/bin/blinky/apps/blinky/blinky.img to 0x08020000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked Voil\u00e0! The LED should be blinking! Success! But wait...not so fast. Let's double check that it is indeed booting from flash and making the LED blink from the image in flash. Pull the USB cable off the Olimex JTAG adaptor, severing the debug connection to the JTAG port. Next power off the Olimex board by pulling out the USB cable from the board. Wait for a couple of seconds and plug the USB cable back to the board. The LED light will start blinking again. Success! Note #1: If you want to download the image to flash and a gdb session opened up, use newt debug blinky after newt download blinky . $ newt debug blinky\n Debugging with ~/ dev/core/hw/bsp/olimex_stm32-e407_...\n Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 http://gnu.org/licenses/gpl.html \n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x08000250 msp: 0x10010000\n Info : accepting gdb connection from 3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes\n Reset_Handler () at startup_STM32F40x.s:199\n 199 ldr r1, =__etext\n (gdb) Note #2: If you want to erase the flash and load the image again you may use the following commands from within gdb. flash erase_sector 0 0 x tells it to erase sectors 0 through x. When you ask it to display (in hex notation) the contents of the sector starting at location 'lma,' you should see all f's. The memory location 0x8000000 is the start or origin of the flash memory contents and is specified in the olimex_stm32-e407_devboard.ld linker script. The flash memory locations is specific to the processor. (gdb) monitor flash erase_sector 0 0 4\n erased sectors 0 through 4 on flash bank 0 in 2.296712s\n (gdb) monitor mdw 0x08000000 16\n 0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (gdb) monitor flash info 0", + "text": "If you wish to build the image to run from the onboard flash memory on Olimex board, follow the steps below: Configure the board to boot from flash by moving the two jumpers together to B0_0 and B1_0 . Refer to the pictures of the board under the section titled \"Prepare the hardware to boot from embedded SRAM\" . You will have to reset the board once the image is uploaded to it. If you skipped the first option for the project (downloading an image to SRAM) , then skip this step. Otherwise, continue with this step. By default, the linker script ( olimex_stm32-e407_devboard.ld ) is configured to run from bootloader and flash. However, if you first ran the image from SRAM you had changed olimex_stm32-e407_devboard.ld to match run_from_sram.ld . You will, therefore, return to defaults with olimex_stm32-e407_devboard.ld linker script matching the contents of 'run_from_loader.ld'. Return to the project directory. $ cd ~/dev/myproj/repos/apache-m ynewt-core/hw/bsp/olimex_stm32-e407_devboard/\n$ diff olimex_stm32-e407_devboard.ld run_from_sram.ld\n$ diff olimex_stm32-e407_devboard.ld run_from_loader.ld\n(some diff will be displayed)\n$ cp run_from_loader.ld olimex_stm32-e407_devboard.ld\n$ cd ~/dev/myproj In order to run the image from flash, you need to build the bootloader as well. The bootloader does the initial set up of the Olimex board and then transfers control to the image stored at a location in flash known to it. Let's create boot_olimex: $ newt target create boot_olimex\n $ newt target set boot_olimex build_profile=optimized\n $ newt target set boot_olimex bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n $ newt target set boot_olimex app=@apache-mynewt-core/apps/boot\n $ newt target show boot_olimex\n targets/boot_olimex\n app=app=@apache-mynewt-core/apps/boot\n bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboar\n build_profile=optimized Now let's b uild both targets now. $ newt build boot_olimex\n ...\n App successfully built: ~/dev/myproj/bin/boot_olimex/apps/boot/boot.elf\n $ newt build blinky\n ...\n Linking blinky.elf\n App successfully built: ~/dev/myproj/bin/blinky/apps/blinky/blinky.elf Create the blinky image and download the bootloader and the image to flash ... in a flash! \nWhen creating an image, you can assign a version number to your image; here we use '1.2.3' $ newt create-image blinky 1.2.3\n App image succesfully generated: ~/dev/myproj/bin/blinky/apps/blinky/blinky.img\n Build manifest: ~/dev/myproj/bin/blinky/apps/blinky/manifest.json\n $ newt load boot_olimex\n Downloading~/dev/myproj/bin/boot_olimex/apps/boot/boot.elf.bin to 0x08000000\n Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)\n ...\n shutdown command invoked\n $ newt load blinky\n Downloading ~/dev/myproj/bin/blinky/apps/blinky/blinky.img to 0x08020000\n Open On-Chip Debugger 0.9.0 (201 5-11-15-13:10)\n ...\n shutdown command invoked Voil\u00e0! The LED should be blinking! Success! But wait...not so fast. Let's double check that it is indeed booting from flash and making the LED blink from the image in flash. Pull the USB cable off the Olimex JTAG adaptor, severing the debug connection to the JTAG port. Next power off the Olimex board by pulling out the USB cable from the board. Wait for a couple of seconds and plug the USB cable back to the board. The LED light will start blinking again. Success! Note #1: If you want to download the image to flash and a gdb session opened up, use newt debug blinky after newt download blinky . $ newt debug blinky\n Debugging with ~/dev/myproj/hw/bsp/olimex_stm32-e407_...\n Debugging ~/dev/myproj/project/blinky/bin/blinky/blinky.elf\n GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs\n Copyright (C) 2014 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 http: //gnu.org/licenses/gpl.html \n ...\n (info)\n ...\n target state: halted\n target halted due to debug-request, current mode: Thread \n xPSR: 0x01000000 pc: 0x08000250 msp: 0x10010000\n Info : accepting gdb connection from 3333\n Info : device id = 0x10036413\n Info : flash size = 1024kbytes\n Reset_Handler () at startup_STM32F40x.s:199\n 199 ldr r1, =__etext\n (gdb) Note #2: If you want to erase the flash and load the image again you may use the following commands from within gdb. flash erase_sector 0 0 x tells it to erase sectors 0 through x. When you ask it to display (in hex notation) the contents of the sector starting at location 'lma,' you should see all f's. The memory location 0x8000000 is the start or origin of the flash memory contents and is specified in the olimex_stm32-e407_devboard.ld linker script. The flash memory locations is specific to the processor. (gdb) monitor flash erase_sector 0 0 4\n erased sectors 0 through 4 on flash bank 0 in 2.296712s\n (gdb) monitor mdw 0x08000000 16\n 0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \n (gdb) monitor flash info 0", "title": "Use flash to make LED blink" }, { @@ -312,28 +397,68 @@ }, { "location": "/os/tutorials/STM32F303/", - "text": "Blinky on STM32F303 board\n\n\nObjective\n\n\nDownload a generic firmware skeleton (\"bootstrap image\") that applies to any hardware and then throw in additional applicable pkgs to generate a build for a specific board, namely the STM32F303VC MCU from STMicroelectronics.\n\n\nHardware needed\n\n\n\n\nDiscovery kit with STM32F303VC MCU\n\n\nLaptop running Mac OS\n\n\n\n\nStep by Step Instructions to build image\n\n\n\n\nThe first step is to download the generic skeleton of the project. The pkgs constituting the skeleton are not hardware architecture specific. The skeleton is maintained as an app in a separate repository on Apache. You know it is an app because there is an app.yml file. \n\n\n\n\n [\nuser\n:\n~/dev\n]\n$\n \nnewt\n \napp\n \ncreate\n \ntest_project\n\n \nDownloading\n \napp\n \nskeleton\n \nfrom\n \nhttps\n:\n//git-wip-us.apache.org/repos/asf/incubator-mynewt-tadpole.git... ok!\n\n \napp\n \ntest_project\n \nsuccessfully\n \n created\n \nin\n \n~/dev/go/test_project\n\n\n [\nuser\n:\n~/dev\n]\n$\n \ncd\n \ntest_project/\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nls\n\n \nREADME\n.\nmd\n \ncompiler\n \nhw\n \nlibs\n \napp\n.\nyml\n\n\n\n\n\n\n\n\nNext, the pkg-list named larva is added from the app (also named larva) from another repository on Apache. This step simply downloads the pkg-list description file and does not actually install the pkgs that constitute the pkg-list. The pkg-list description file (\npkg-list.yml\n) will be used to check dependencies during the pkg install to ensure completeness. It serves as a reference for all the pkgs in the pkg-list that one can choose from and install.\n\n\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \napp\n \nadd-pkg-list\n \nlarva\n \nhttps\n:\n//git-wip-us.apache.org/repos/asf/incubator-mynewt-larva.git\n\n \nDownloading\n \npkg-list\n.\nyml\n \nfrom\n \nhttps\n:\n//git-wip-us.apache.org/repos/asf/i ncubator-mynewt-larva.git/master... ok!\n\n \nVerifying\n \npkg-list\n.\nyml\n \nformat\n...\n \nok!\n\n \npkg-list\n \nlarva\n \nsuccessfully\n \ninstalled\n \nto\n \napp\n.\n\n\n\n\n\n\n\nThe next step is to install relevant pkgs from the larva app from git server on Apache. The instructions assume that you know what application or project you are interested in (the blinky application, in this case), what hardware you are using (STM32F3DISCOVERY board, in this case) and hence, what board support package you need. \n\n\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \npkg\n \ninstall\n \nproject/blinky\n \n \nDownloading\n \nlarva\n \nfrom\n \nhttps\n:\n//git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/master... ok!\n\n \nInstalling\n \nproject/blinky\n\n \nInstalling\n \nlibs/console/full\n\n \nInstalling\n \nlibs/shell\n\n \nInstallation\n \nwas\n \na\n \nsuccess!\n\n\n [\nuser\n:\n~/dev/t est_project\n]\n$\n \nnewt\n \npkg\n \ninstall\n \nhw/bsp/stm32f3discovery\n\n \nDownloading\n \nlarva\n \nfrom\n \nhttps\n:\n//git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/master... ok!\n\n \nInstalling\n \nhw/bsp/stm32f3discovery\n\n \nInstalling\n \nhw/mcu/stm/stm32f3xx\n\n \nInstalling\n \nlibs/cmsis-core\n\n \nInstalling\n \ncompiler/arm-none-eabi-m4\n\n \nInstallation\n \nwas\n \na\n \nsuccess!\n\n\n\n\n\n\n\n\nIt's time to create a targets for the project and define the target attributes. STM32F3 BSP expects bootloader, so create targets for both blinky and bootloader.\n\n\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \ncreate\n \nblink_f3disc\n\n \nCreating\n \ntarget\n \nblink_f3disc\n\n \nTarget\n \nblink_f3disc\n \nsuccessfully\n \ncreated!\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nblink_f3disc\n \nproject=blinky\n\n \nTarget\n \nblink _f3disc\n \nsuccessfully\n \nset\n \nproject\n \nto\n \nblinky\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nblink_f3disc\n \nbsp=hw/bsp/stm32f3discovery\n\n \nTarget\n \nblink_f3disc\n \nsuccessfully\n \nset\n \nbsp\n \nto\n \nhw/bsp/stm32f3discovery\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nblink_f3disc\n \ncompiler_def=debug\n\n \nTarget\n \nblink_f3disc\n \nsuccessfully\n \nset\n \ncompiler_def\n \nto\n \ndebug\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nblink_f3disc\n \ncompiler=arm-none-eabi-m4\n\n \nTarget\n \nblink_f3disc\n \nsuccessfully\n \nset\n \ncompiler\n \nto\n \narm-none-eabi-m4\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nblink_f3disc\n \narch=cortex_m4\n\n \nTarget\n \nblink_f3disc\n \nsuccessfully\n \nset\n \narch\n \nto\n \ncortex_m4\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \n newt\n \ntarget\n \ncreate\n \nboot_f3disc\n\n \nCreating\n \ntarget\n \nboot_f3disc\n\n \nTarget\n \nboot_f3disc\n \nsuccessfully\n \ncreated!\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nboot_f3disc\n \nproject=boot\n\n \nTarget\n \nblink_f3disc\n \nsuccessfully\n \nset\n \nproject\n \nto\n \nblinky\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nboot_f3disc\n \nbsp=hw/bsp/stm32f3discovery\n\n \nTarget\n \nboot_f3disc\n \nsuccessfully\n \nset\n \nbsp\n \nto\n \nhw/bsp/stm32f3discovery\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nboot_f3disc\n \ncompiler_def=optimized\n\n \nTarget\n \nboot_f3disc\n \nsuccessfully\n \nset\n \ncompiler_def\n \nto\n \ndebug\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nboot_f3disc\n \ncompiler=arm-none-eabi-m4\n\n \nTarget\n \nboot_f3disc\n \nsuccessfully\n \nset\n \nc ompiler\n \nto\n \narm-none-eabi-m4\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nset\n \nboot_f3disc\n \narch=cortex_m4\n\n \nTarget\n \nboot_f3disc\n \nsuccessfully\n \nset\n \narch\n \nto\n \ncortex_m4\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nshow\n \nblink_f3disc\n\n \nblink_f3disc\n\n \narch=cortex_m4\n\n \nbsp=hw/bsp/stm32f3discovery\n\n \ncompiler=arm-none-eabi-m4\n\n \ncompiler_def=debug\n\n \nname=blink_f3disc\n\n \nproject=blinky\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nshow\n \nboot_f3disc\n\n \nboot_f3disc\n\n \narch=cortex_m4\n\n \nbsp=hw/bsp/stm32f3discovery\n\n \ncompiler=arm-none-eabi-m4\n\n \ncompiler_def=debug\n\n \nname=blink_f3disc\n\n \nproject=boot\n\n\n\n\n\n\n\n\nSTM32F3 blinky project is too large to operate with ne wlib libc. You need to modify project/blinky/pkg.yml, and switch over to using baselibc.\n\n\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \ncat\n \nproject/blinky/pkg\n.\nyml\n \n \n#\n\n \n# Licensed to the Apache Software Foundation (ASF) under one\n\n \n# or more contributor license agreements. See the NOTICE file\n\n \n# distributed with this work for additional information\n\n \n# regarding copyright ownership. The ASF licenses this file\n\n \n# to you under the Apache License, Version 2.0 (the\n\n \n# \nLicense\n); you may not use this file except in compliance\n\n \n# with the License. You may obtain a copy of the License at\n\n \n#\n\n \n# http:\n//www.apache.org/licenses/LICENSE-2.0\n\n \n#\n\n \n# Unless required by applicable law or agreed to in writing,\n\n \n# software distributed under the License is distributed on an\n\n \n# \nAS IS\n BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n\n \n# KIND, either express or implied. See the License for the\n\n \n# specific language governing permissions and limitations\n\n \n# under the License.\n\n \n#\n\n\n \npkg\n.\nname\n: \nproject/blinky\n\n \npkg\n.\nvers\n: \n0.8.0\n\n \npkg\n.\ndescription\n: \nBasic\n \nexample\n \napplication\n \nwhich\n \nblinks\n \nan\n \nLED\n.\n \npkg\n.\nauthor\n: \nMarko\n \nKiiskila\n \nmarko@runtime\n.\nio\n\n \npkg\n.\nhomepage\n: \nhttp\n:\n//mynewt.apache.org/os/get_acclimated/project2/\n\n \npkg\n.\nrepository\n: \nhttps\n:\n//git-wip-us.apache.org/repos/asf/incubator-mynewt-larva\n\n \npkg\n.\nkeywords\n:\n\n \npkg\n.\ndeps\n:\n \n-\n \nlibs/console/full\n\n \n-\n \nlibs/newtmgr\n\n \n-\n \nlibs/os\n\n \n-\n \nlibs/shell\n\n \n-\n \nsys/config\n\n \n-\n \nsys/log\n\n \n-\n \nsys/stats\n\n \ n-\n \nlibs/baselibc\n\n\n\n\n\n\n\n\n\n\nNext, you get to build the targets and generate an executable that can then be uploaded to the board. The STM32F3DISCOVERY board includes an ST-LINK/V2 embedded debug tool interface that will be used to program/debug the board. To program the MCU on the board, simply plug in the two jumpers on CN4, as shown in the picture in red. If you want to learn more about the board you will find the User Manual at \nhttp://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00063382.pdf\n\n\n\n\n\n\n\n\n\n\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nbuild\n \nboot_f3disc\n\n \nBuilding\n \ntarget\n \nboot_f3\n (\nproject\n \n=\n \nboot\n)\n \nCompiling\n \nasprintf\n.\nc\n\n \nCompiling\n \natoi\n.\nc\n\n ...\n ...\n \nAssembling\n \nstartup_stm32f303xc\n.\ns\n\n \nArchiving\n \nlibstm32f3discovery\n.\na\n\n \nCompiling\n \nboot\n.\nc\n\n \nBuilding\n \nproject\n \nboot\n\n \nLinking\n \nboot\n.\nelf\n\n \nSuccessfully\n \nrun!\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nbuild\n \nblink_f3disc\n\n \nBuilding\n \ntarget\n \nblink_f3disc\n (\nproject\n \n=\n \nblinky\n)\n \nCompiling\n \nasprintf\n.\nc\n\n \nCompiling\n \natoi\n.\nc\n\n ...\n ...\n \nAssembling\n \nstartup_stm32f303xc\n.\ns\n\n \nArchiving\n \nlibstm32f3discovery\n.\na\n\n \nCompiling\n \nmain\n.\nc\n\n \nBuilding\n \nproject\n \nblinky\n\n \nLinking\n \nblinky\n.\nelf\n\n \nSuccessfully\n \nrun!\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \nbuild\n \nboot_f3disc\n\n \nBuilding\n \ntarget\n \nboot_f3disc\n (\nproject\n \n=\n \nboot\n)\n \nBuilding\n \nproject\n \nboot\n\n \nSuccessfully\n \nrun!\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \ncreate-imag e\n \nblink_f3disc\n \n0.0.1\n\n \nBuilding\n \ntarget\n \nblink_f3disc\n (\nproject\n \n=\n \nblinky\n)\n \nBuilding\n \nproject\n \nblinky\n\n\n\n\n\n\n\n\nFinally, you have to download the image on to the board. You will see a blue light start to blink.\n\n\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \ndownload\n \nboot_f3disc\n\n \nDownloading\n \nwith\n \n/Users/user/dev/test_project/hw/bsp/stm32f3discovery/stm32f3discovery_download\n.\nsh\n\n\n [\nuser\n:\n~/dev/test_project\n]\n$\n \nnewt\n \ntarget\n \ndownload\n \nblink_f3disc\n\n \nDownloading\n \nwith\n \n/Users/user/dev/test_project/hw/bsp/stm32f3discovery/stm32f3discovery_download\n.\nsh", + "text": "Blinky on STM32F303 Discovery board\n\n\n\n\nObjective\n\n\nCreate a project with a simple app that blinks an LED on the stmf303 \ndiscovery board. Download the application to the target and watch it blink.\n\n\n\n\nWhat you need\n\n\n\n\nDiscovery kit with STM32F303VC MCU\n\n\nLaptop running Mac OSX. \n\n\nIt is assumed you have already installed newt tool. \n\n\nIt is assumed you already installed native tools as described \nhere\n\n\n\n\nAlso, we assume that you're familiar with UNIX shells. Let's gets started!\n\n\n\n\nCreate a project\n\n\nCreate a new project to hold your work. For a deeper understanding, you can read about project creation in \n\nGet Started -- Creating Your First Project\n\nor just follow the commands below.\n\n\nIf you've already created a project from another tutorial, you can re-use\nthat project.\n\n\n$ mkdir ~/dev\n$ cd ~/dev\n$ newt new myproj\nDownloading project skeleton from apache/incubator-mynewt-blinky...\nInstalling skelet on in myproj...\nProject myproj successfully created.\n\n$ cd myproj\n\n\n\n\n\nNote:\n Don't forget to change into the \nmyproj\n directory.\n\n\n\n\nImport External STM32F3 Library support\n\n\nThe STM32F303 support for Mynewt lives in an external repository. It's\nnecessary to add another repository to the project. To do this,\nedit the file \nproject.yml\n in the root directory of your project \nmyproj\n\n\nThis requires two changes to this file.\n\n\n\n\nYou must define the properties of the external repository that you want\nto add\n\n\nYou must include the repository in your project.\n\n\n\n\nEdit the file \nproject.yml\n with your favorite editor and add the \nfollowing repository details in the file (after the core \nrepository). This gives newt the information to contact the repository\nand extract its contents. In this case, the repository is on github in \nthe \nruntimeinc\n collection. Its name is \nmynewt-stm32f3\n and we will accept\nany version up to the latest. You can look at the contents \nhere\n.\n\n\nrepository.mynewt_stm32f3:\n type: github\n vers: 0-latest\n user: runtimeinc\n repo: mynewt_stm32f3\n\n\n\n\n\n\n\nIn the same file, add the following highlighted line to the \n\nproject.repositories\n variable. This tells newt to download the\n repository contents into your project. \n\n\nproject.repositories:\n - apache-mynewt-core\n\n - mynewt_stm32f3\n\n\n\n\n\n\n\nInstall dependencies\n\n\nNow you can install this into the project using:\n\n\n$ newt install -v \nDownloading repository description for apache-mynewt-core... success!\n...\napache-mynewt-core successfully installed version 0.7.9-none\n...\nDownloading repository description for mynewt_stm32f3... success!\nDownloading repository mynewt_stm32f3 \n...\nResolving deltas: 100% (65/65), done.\nChecking connectivity... done.\nmynewt_stm32f3 successfully installed version 0.0.0-none\n\n\n\n\n\n\n\nCreate targets\n\n\nCreate two
<TRUNCATED>
