hacks:boards:rtos:zephyr
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
hacks:boards:rtos:zephyr [2017/03/22 08:10] – tdwebste | hacks:boards:rtos:zephyr [2017/11/11 04:24] (current) – rebel_without_clause | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | === Zephyr Code === | + | [[hacks: |
- | * git clone https://gerrit.zephyrproject.org/r/zephyr | + | |
+ | |||
+ | === General | ||
+ | * git clone https://github.com/zephyrproject-rtos/zephyr | ||
* cd zephyr | * cd zephyr | ||
* git tag #find the latest tag, that is the latest stable | * git tag #find the latest tag, that is the latest stable | ||
- | * git checkout | + | |
+ | | ||
* git checkout master #use this if need more network or other features, such as bluetooth | * git checkout master #use this if need more network or other features, such as bluetooth | ||
Line 10: | Line 14: | ||
* export ZEPHYR_GCC_VARIANT=zephyr | * export ZEPHYR_GCC_VARIANT=zephyr | ||
* export ZEPHYR_SDK_INSTALL_DIR=< | * export ZEPHYR_SDK_INSTALL_DIR=< | ||
+ | |||
+ | [[hacks: | ||
+ | |||
=== Installing gcc cross compiler === | === Installing gcc cross compiler === | ||
Line 15: | Line 22: | ||
* install [[hacks: | * install [[hacks: | ||
* which arm-none-eabi-gcc | * which arm-none-eabi-gcc | ||
- | * export GCCARMEMB_TOOLCHAIN_PATH=" | + | * export GCCARMEMB_TOOLCHAIN_PATH="/ |
* export ZEPHYR_GCC_VARIANT=gccarmemb | * export ZEPHYR_GCC_VARIANT=gccarmemb | ||
+ | source zephyr-env.sh | ||
+ | ==== Step-by-Step Instructions ==== | ||
+ | |||
+ | === Installing gcc, gdb and other Toolchains specifically for STM32 Discovery kit IOT Board for STM32L475 MCU and executing " | ||
+ | |||
+ | == Author == | ||
+ | RK (Rebel_without_Clause) | ||
+ | |||
+ | == Build Environment == | ||
+ | Debian Linux | ||
+ | |||
+ | == General Zephyr RTOS SDK Install Instructions == | ||
+ | Please follow the install instructions exactly as per the Zephyr Instructions Above (by Tim Webster), step-by-step here: | ||
+ | (1) $ git clone https:// | ||
+ | |||
+ | (2) $ ls -al (optional, just lists the directory contents) | ||
+ | |||
+ | (3) $ cd zephyr/ | ||
+ | |||
+ | (4) $ ls | ||
+ | |||
+ | (5) $ pip3 install --user -r scripts/ | ||
+ | |||
+ | (6) $ pwd | ||
+ | |||
+ | (7) $ wget https:// | ||
+ | |||
+ | (8) $ sudo chown -R your_user_name zephyr/ | ||
+ | |||
+ | (9) $ chmod u+x zephyr-sdk-0.9.1-setup.run | ||
+ | |||
+ | (10) $ ./ | ||
+ | |||
+ | (11) $ cd .. | ||
+ | |||
+ | (12) $ ls (optional, just lists the directory contents) | ||
+ | |||
+ | (13) $ export ZEPHYR_GCC_VARIANT=zephyr | ||
+ | |||
+ | (14) $ export ZEPHYR_SDK_INSTALL_DIR=/ | ||
+ | |||
+ | (15 instead of 13 and 14) To use the same toolchain in future sessions, the last two lines may be replaced by: | ||
+ | $ cat <<EOF > ~/.zephyrrc | ||
+ | export ZEPHYR_GCC_VARIANT=zephyr | ||
+ | export ZEPHYR_SDK_INSTALL_DIR=/ | ||
+ | EOF | ||
+ | |||
+ | (16) Don’t follow the steps on: | ||
+ | http:// | ||
+ | |||
+ | (17) Use a KNOWN good USB to USB micro cable! | ||
+ | When connected to the micro USB terminal "USB STLINK", | ||
+ | |||
+ | (18) To debug package dependency issues, let Debian’s “Synaptics Package Manager” and Fedora’s “Yum Package manager” point the correct dependencies. | ||
+ | |||
+ | == Nuts and Bolts Instructions for ST MICRO Board STM32L475 == | ||
+ | Do not connect the ST MICRO Board unless instructed. | ||
+ | These were executed on a Debian Linux machine, specifically Ubuntu 16.04 LTS. | ||
+ | (1) Download the source code (in a directory) in your home directory, that is, Git clone (command "git clone" | ||
+ | |||
+ | (2) Once the source code is downloaded, change the working directory to " | ||
+ | |||
+ | (3) Open a Bash Shell (command line window/ | ||
+ | $ ./bootstrap | ||
+ | $ ./configure --enable-maintainer-mode --enable-stlink | ||
+ | $ make | ||
+ | |||
+ | (4) Enter "sudo apt-get install gdb-arm-none-eabi" | ||
+ | |||
+ | (5) If you have a different arm-gcc installed, enter "sudo apt-get remove gcc-arm-embedded" | ||
+ | |||
+ | (6) To install arm-gcc, enter "sudo apt-get install gdb-arm-none-eabi" | ||
+ | |||
+ | (7) Edit the " | ||
+ | |||
+ | (8) Find the path for arm-gdb by entering "sudo find /usr/bin -iname *gdb*" | ||
+ | |||
+ | (9) Copy the path from the search results in (8) and replace the second line by " | ||
+ | |||
+ | (10) Enter " | ||
+ | |||
+ | (11) Install screen by entering "sudo apt-get install screen" | ||
+ | |||
+ | (12) Download examples by creating a download folder in your home directory, change the working directory to that created directory and enter the command "git clone https:// | ||
+ | |||
+ | (13) A directory named " | ||
+ | |||
+ | (14) Change the working directory by entering "cd ~openocd-stm32" | ||
+ | |||
+ | (15) Before connecting the board, enter the command " | ||
+ | |||
+ | (16) CONNECT THE ST MICRO Board; as soon as it is connected, the computer should autodetect the board and display it as " | ||
+ | If not the re-enter the command " | ||
+ | the LED besides the "USB STLINK" | ||
+ | |||
+ | (17) Enter the command " | ||
+ | (See the Flash writing screenshots " | ||
+ | Wait for ST Micro flash to be written, you may get a message such as “Unable to match requested speed 500 kHz, using 480 kHz” (this is not an error). | ||
+ | |||
+ | (18) Press the “RESET” button on the ST Micro board to execute the " | ||
+ | |||
+ | (19) Enter the command " | ||
+ | you should see the output as shown in " | ||
+ | Mark has reported success using the Arduino IDE to view this output. | ||
+ | |||
+ | == Blink LED on Board (from " | ||
+ | Henceforth all examples need to be compiled as they are not precompiled in the Zephyr Repository. | ||
+ | |||
+ | Go to zephyr directory and execute command: | ||
+ | (1) "cd ~/ | ||
+ | |||
+ | (2) Edit the Makefile and change the board name as shown: | ||
+ | BOARD ?= disco_l475_iot1 | ||
+ | |||
+ | (3) $ make | ||
+ | |||
+ | (4) An output file " | ||
+ | |||
+ | (5) Go to the directory by executing command "cd ~openocd-stm32" | ||
+ | |||
+ | (6) Connect the STM32L475 board to the computer USB port via the "USB STLINK" | ||
+ | |||
+ | (7) FLash the board by executing the command "sudo stm32_flsh l4 ~/ | ||
+ | |||
+ | (8) Press the " | ||
+ | |||
+ | |||
+ | == Log Data from Temperature & Humidity Sensor == | ||
+ | Go to zephyr directory and execute command: | ||
+ | (1) "cd ~/ | ||
+ | |||
+ | (2) Edit the Makefile and change the board name as shown: | ||
+ | BOARD ?= disco_l475_iot1 | ||
+ | |||
+ | (3) $ make | ||
+ | |||
+ | (4) An output file " | ||
+ | |||
+ | (5) Go to the directory by executing command "cd ~openocd-stm32" | ||
+ | |||
+ | (6) Connect the STM32L475 board to the computer USB port via the "USB STLINK" | ||
+ | (7) FLash the board by executing the command "sudo stm32_flsh l4 ~/ | ||
+ | (8) Press the " | ||
+ | (9) Enter the command " |
hacks/boards/rtos/zephyr.1490170231.txt.gz · Last modified: 2017/03/22 08:10 by tdwebste