[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-\u002Fdocumentation\u002Fiot-kits\u002Fiot-developer-kit\u002Fdeveloper-environment-setup\u002Fmacos-for-zephyr-development":3},{"docData":4,"isAuthenticated":11,"isTOCHidden":12,"commonDAProps":27},{"id":5,"title":6,"superTitle":7,"description":8,"sectionOrder":9,"slug":10,"isAuthenticated":11,"isTOCHidden":12,"createdAt":13,"updatedAt":14,"publishedAt":15,"environments":16,"isDeprecated":8,"deprecationNoticeTitle":8,"deprecationNotice":8,"documentId":20,"forPartnerDashboard":8,"parent_page":8,"children_pages":21,"pageContent":22},345,"macOS for Zephyr Development","Learning Level: Advanced",null,24081,"macos-for-zephyr-development",false,true,"2024-07-25T06:55:21.225Z","2025-02-14T21:41:11.233Z","2022-11-11T20:05:16.365Z",[17,18,19],"partner","preprod","production2","b1166lhf2jsr27j4vs1qgtyh",[],[23],{"__component":24,"id":25,"content":26,"referenceURL":8},"content-components.markdown",211,"\u003Cstyle>\n     code { display:inline; background-color: #e5e7eb; border-radius: 5px; padding: 3px 10px; }\n     pre { counter-reset: line; background-color: #000; color: #fff; padding: 1em; overflow: scroll; width: 780px; margin: 0em 0em 1.5em 0em; }\n     pre span { counter-increment: line; color: #fff; }\n     pre span:before { content: counter(line, decimal-leading-zero); padding: 0em 1.5em 0em .75em; display: inline-block; border-right: 1px solid #fff; margin-right: 1em; color: #e20074; }\n     pre code { counter-increment: line; color: #fff; display: unset; background-color: unset; border-radius: unset; padding: unset; }\n     pre code:before { content: counter(line); padding: 0em 1.5em 0em .75em; display: inline-block; border-right: 1px solid #fff; margin-right: 1em; color: #e20074; }\n     th { border: 1px solid #000000; padding: 10px; background-color: #f2f2f2; }\n     td { border: 1px solid #000000; padding: 10px; vertical-align: top; }\n     tr:nth-child(even) { background-color: #f2f2f2; }\n     .note { background-color: #f2f2f2; border: 1px solid #D0D5DD; padding: 15px; border-radius: 8px; color: #344054; }  \n     .note:before { content: ' \\266B' \" NOTE:\"; padding-right: 5px; font-weight: bold; font-size: large; display: block; }\n     .important { background-color: #ffffff; border: 1px solid #E65BA2;; padding: 15px; border-radius: 8px; color: #E20074; }  \n     .important:before { content: ' \\2763' \" IMPORTANT:\"; padding-right: 5px; font-weight: bold; font-size: large; display: block; }\n     .tip { background-color: #F6FEF9; border: 1px solid #6CE9A6; padding: 15px; border-radius: 8px; color: #027A48; }  \n     .tip:before { content: ' \\2714' \" TIP:\"; padding-right: 5px; font-weight: bold; font-size: large; display: block; }\n     .warning { background-color: #FFFCF5; border: 1px solid #FEC84B; padding: 15px; border-radius: 8px; color: #B54708; }  \n     .warning:before { content: ' \\26A0' \" WARNING:\"; padding-right: 5px; font-weight: bold; font-size: large; display: block; }\n     .bug { background-color: #FFFBFA; border: 1px solid #FDA29B; padding: 15px; border-radius: 8px; color: #B42318; }  \n     .bug:before { content: ' \\2639' \" BUG:\"; padding-right: 5px; font-weight: bold; font-size: large; display: block; }\n     img { max-width: 100%; height: auto; }\n     ol li li { list-style-type: lower-alpha; }\n     ol li li li { list-style-type: lower-roman; }\n     ul li li { list-style-type: circle; }\n     ul li li li { list-style-type: square; }\n     hr { max-width:100%; border: 4px solid #000000; }\n\u003C\u002Fstyle>\n\n## Introduction\n\nThis document explains how to setup a development environment on macOS for the [DevEdge IoT Developer Kit](\u002Fsolutions\u002Fiotdevkit)'s RTOS and SDK.\n\n## Prerequisites\n\n*   A MacBook with USB ports.\n*   macOS Monterey version 12.0 or greater.\n*   A serial app.\n    \n\n## Why would I want to implement the instructions in this document?\n\n*   To be able to upgrade or change the firmware on the [DevEdge IoT Developer Kit](\u002Fsolutions\u002Fiotdevkit).\n    \n\n## Configuration\n\n### Step A\n\nBackup your work. If you have previous installation of the T-Mobile RTOS and SDK downloaded on your machine, please save a copy of your work. If not, please skip to Step B.\n\n1.  Save a copy of the following folders or all your work in progress will be deleted:\n    1.  $HOME\u002Fzephyrproject\u002FDevEdge-IoTDevKit-ZephyrSDK     \n    2.  $HOME\u002Fzephyrproject\u002Fzephyr\n        \n\n### Step B\n\nIntall Zephyr.\n\n1.  Follow the instructions [here](https:\u002F\u002Fdocs.zephyrproject.org\u002Flatest\u002Fdevelop\u002Fgetting_started\u002Findex.html) to install Zephyr.  \n    \n2.  Under _Get Zephyr and install Python dependencies_ > Step 4, replace  \n    \n    `west init ~\u002Fzephyrproject`\n\n    with\n\n    `west init -m https:\u002F\u002Fgithub.com\u002Ftmobile\u002FDevEdge-IoTDevKit-ZephyrRTOS.git ~\u002Fzephyrproject`\n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_11_15_11_42_30_9d9bc100b6.png?updated_at=2022-12-15T19:05:16.598Z)  \n      \n    \n3.  The rest of the instructions stay the same.  \n    \n4.  Stop at the _Build the Blinky Sample_ section.\n    \n\n### Step C\n\nClone the T-Mobile Zephyr RTOS and SDK.\n\n1.  Open Terminal.  \n    \n2.  Enter the following to download the T-Mobile Zephyr SDK, aka [tmo\\_shell](\u002Fdocumentation-hub\u002Fiot-developer-kit\u002Finteracting-with-the-kit-at-cli-via-tmo-shell):  \n      \n    \u003Cp class=\"note\">The release version will change over time. \u003C\u002Fp>\n    \n    \u003Cpre>\n    \u003Cspan>cd ~\u002Fzephyrproject\u003C\u002Fspan>\n    \u003Cspan>git clone https:\u002F\u002Fgithub.com\u002Ftmobile\u002FDevEdge-IoTDevKit-ZephyrSDK.git\u003C\u002Fspan>\n    \u003Cspan>cd DevEdge-IoTDevKit-ZephyrSDK\u003C\u002Fspan>\n    \u003Cspan>git checkout tmz-sdk-1.19.1-qa\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n3.  Clone the T-Mobile Zephyr RTOS repository:  \n      \n    \u003Cp class=\"note\">The release version will change over time.\u003C\u002Fp>\n    \n    \u003Cpre>\n    \u003Cspan>cd ~\u002Fzephyrproject\u003C\u002Fspan>\n    \u003Cspan>rm -rf zephyr\u003C\u002Fspan>\n    \u003Cspan>git clone https:\u002F\u002Fgithub.com\u002Ftmobile\u002FDevEdge-IoTDevKit-ZephyrRTOS.git zephyr\u003C\u002Fspan>\n    \u003Cspan>cd zephyr\u003C\u002Fspan>\n    \u003Cspan>git checkout tmz-1.19.1-qa\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n4.  Refresh the Zephyr modules by running the following commands.  \n    \n    \u003Cp class=\"important\">Do this whenever cloning or pulling the Zephyr repo.\u003C\u002Fp>\n    \n    \u003Cpre>\n    \u003Cspan>cd ~\u002Fzephyrproject\u003C\u002Fspan>\n    \u003Cspan>west update\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n5.  Stop here if all you wish to do is upgrade your tmo\\_shell to the latest version.\n    \n\n### Step D\n\nBuild your \"Hello World\" sample then flash the board.  \n\n1.  Set the build environment by entering the below code into Terminal.  \n    \n    \u003Cpre>\n    \u003Cspan>source DevEdge-IoTDevKit-ZephyrSDK\u002Fset-zephyr-build-env\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n2.  Connect to your IoT Developer Kit via serial app. \n    \n    1.  Connect your developer kit to your MacBook. Plug in your USB-C to USB-A cable into the board like in the screenshot below. Ensure that the USB-C end it plugged into the **J-Link USB-C Debug** port.  \n          \n        ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fiot_dev_kit_how_to_connect_3e7f450c51.png)  \n          \n        \n    2.  Open your serial app. For demonstration purposes we will use [Serial](https:\u002F\u002Fapps.apple.com\u002Fus\u002Fapp\u002Fserial\u002Fid877615577?mt=12).  \n        \n    3.  Select the serial port that is connected to your IoT Developer Kit then click _**Open**_.  \n        \n    4.  Under **Terminal** > **Settings** > **Line Settings** > **Baud Rate** make sure the following values are set then click _**OK**_:\n        \n        1.  Baud Rate \u002F Speed - 9600\n            \n        2.  Data Rate - 8\n            \n        3.  Parity - None\n            \n        4.  Stop Bits - 1\n            \n        5.  Flow Control - None  \n              \n            ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage2022_8_1_15_3_44_f313fbe57e.png)  \n            \n    5.  At the command line screen press _**Enter**_ on your keyboard. The uart command prompt appears. To learn more about uart, please read the document [Interacting with the Kit at CLI via tmo\\_shell](\u002Fdocumentation-hub\u002Fiot-developer-kit\u002Finteracting-with-the-kit-at-cli-via-tmo-shell).   \n          \n        ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage2022_8_1_15_15_42_30d82df88d.png)  \n        \n3.  In Terminal, build the \"Hello World\" sample.  \n    \n    \u003Cpre>\n    \u003Cspan>west build $HOME\u002Fzephyrproject\u002Fzephyr\u002Fsamples\u002Fhello_world -p -b tmo_dev_edge\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n4.  Flash the \"Hello World\" sample onto the kit.  \n    \n    \u003Cpre>\n    \u003Cspan>west flash\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n5.  If the flash occurred successfully you should see the below screenshot in your serial app.  \n    \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_11_29_18_49_55_a92cae60bb.png?updated_at=2022-12-15T19:04:03.154Z)  \n    \n6.  Update the code found in the $HOME\u002Fzephyrproject\u002Fzephyr\u002Fsamples\u002Fhello\\_world\u002Fsrc\u002Fmain.c file to create whatever project you desire.  \n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_11_35_36_9fda5625f5.png?updated_at=2022-12-16T18:39:34.434Z)  \n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_11_41_56_d307f7ed6b.png?updated_at=2022-12-16T18:39:31.277Z)  \n    \n7.  Flash the board again with your changes.  \n    \n    \u003Cpre>\n    \u003Cspan>west flash\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n8.  Test that your \"Hello World\" project works.  \n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_11_40_43_0a801bc410.png?updated_at=2022-12-16T18:43:06.334Z)\n    \n\n### Step E\n\nBuild your \"tmo\\_shell\" sample then flash the board.\n\n1.  Set the build environment by entering the below code into Terminal.  \n    \n    \u003Cpre>\n    \u003Cspan>cd ~\u002Fzephryproject\u003C\u002Fspan>\n    \u003Cspan>source DevEdge-IoTDevKit-ZephyrSDK\u002Fset-zephyr-build-env\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n2.  Enter the below in Terminal to build the [tmo\\_shell](\u002Fdocumentation-hub\u002Fiot-developer-kit\u002Finteracting-with-the-kit-at-cli-via-tmo-shell) sample.  \n    \n    \u003Cpre>\n    \u003Cspan>west build $HOME\u002Fzephyrproject\u002FDevEdge-IoTDevKit-ZephyrSDK\u002Fsamples\u002Ftmo_shell -p -b tmo_dev_edge\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n3.  Flash the tmo\\_shell sample onto the kit.  \n    \n    \u003Cpre>\n    \u003Cspan>west flash\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n4.  If the flash occurred successfully you should see, in your serial app, your kit going through a series of system checks then finally arrive at the following screenshot.  \n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_17_5_22_b9a7790b9a.png?updated_at=2022-12-16T19:13:45.176Z)  \n    \n5.  Press _**Return**_ on your keyboard to get to the uart command line.  \n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_17_5_49_098cd255ac.png?updated_at=2022-12-16T19:17:13.313Z)  \n    \n6.  Enter `tmo version` to see the version of your SDK. It should be upgraded to tmz-1.19.1-qa.   \n    \n7.  Update the code found in the $HOME\u002Fzephyrproject\u002FDevEdge-IoTDevKit-ZephyrSDK\u002Fsamples\u002Ftmo\\_shell folder to create whatever project you desire. To understand what the various files in the **tmo\\_shell** folder do, please see the [Description of tmo\\_shell Source Files](\u002Fdocumentation-hub\u002Fiot-developer-kit\u002Finteracting-with-the-kit-at-cli-via-tmo-shell) document.  \n      \n    ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_17_18_38_9e1eca3a77.png?updated_at=2022-12-16T19:26:47.072Z)  \n      \n    \n8.  An example of a source file update is setting the SSID and PSK for Wi-Fi.\n    \n    1.  Open the $HOME\u002Fzephyrproject\u002FDevEdge-IoTDevKit-ZephyrSDK\u002Fsamples\u002Ftmo\\_shell\u002Fprj.conf in your IDE.  \n        \n    2.  Find the `CONFIG_TMO_SHELL_SSID` and `CONFIG_TMO_SHELL_PSK` variables.  \n        \n    3.  Set the arguments to your Wi-Fi SSID and PSK then save the file.  \n\n        ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_17_33_22_e70a474421.png?updated_at=2022-12-16T19:39:14.208Z)  \n        \n    4.  Open your Terminal app, change directories to zephyrproject, then set your build environment.  \n        \n        \u003Cpre>\n        \u003Cspan>cd ~\u002Fzephryproject\u003C\u002Fspan>\n        \u003Cspan>source DevEdge-IoTDevKit-ZephyrSDK\u002Fset-zephyr-build-env\u003C\u002Fspan>\n        \u003C\u002Fpre>\n        \n    5.  Build the tmo\\_shell sample.  \n        \n        \u003Cpre>\n        \u003Cspan>west build $HOME\u002Fzephyrproject\u002FDevEdge-IoTDevKit-ZephyrSDK\u002Fsamples\u002Ftmo_shell -p -b tmo_dev_edge\u003C\u002Fspan>\n        \u003C\u002Fpre>\n        \n    6.  Flash the sample onto the kit.  \n        \n        \u003Cpre>\n        \u003Cspan>west flash\u003C\u002Fspan>\n        \u003C\u002Fpre>\n        \n    7.  In your serial app, your kit goes through a series of system checks then finally arrives at the following screenshot. Press _**Return**_ on your keyboard to get to the uart command line.  \n          \n        ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_17_5_49_098cd255ac.png?updated_at=2022-12-16T19:17:13.313Z)  \n        \n    8.  Enter `tmo wifi status 2`. Instead of having to enter `tmo wifi connect 2 \"\u003CSSID>\" 0 \"\u003CPSK>\"` you'll notice that you are already connected to Wi-Fi automatically.\n\n        ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_12_15_17_52_7_f39661f6a9.png?updated_at=2022-12-16T19:57:59.086Z)  \n        \n9.  Update any other source files you desire. \n    \n10.  Flash the board again with your changes.  \n    \n     \u003Cpre>\n     \u003Cspan>west flash\u003C\u002Fspan>\n     \u003C\u002Fpre>\n    \n11.  Test that your tmo\\_shell project works.\n    \n\n## Troubleshooting\n\n*   **Issue** - I cannot get my \"Hello World' project to work on the IoT Developer Kit. What could be the problem?\n*   **Suggested Solution** - Try doing another `west update` in the the `zephyrproject` folder then flashing the board again.\n    \n\u003Cbr>\n\n*   **Issue** - What should I do if I receive a \"realpath doesn't exist on OSX\" error message?\n*   **Suggested Solution** - Run the following command in Terminal.\n    \u003Cpre>\n    \u003Cspan>brew install coreutils\u003C\u002Fspan>\n    \u003C\u002Fpre>\n    \n\u003Cbr>\n\n*   **Issue** - I do not have pyelftools installed on my MacBook. Can this cause errors with my development environment? \n*   **Suggested Solution** - Yes it can. Please do the following:\n    \n    *   Check the version of Python that is associated with \"python3\":  \n        \n        \u003Cpre>\n        \u003Cspan>cd ~\u002Fzephyrproject\u003C\u002Fspan>\n        \u003Cspan>which python3\u003C\u002Fspan>\n        \u003Cspan>ls -l \u002Fusr\u002Flocal\u002Fbin\u002Fpython3\u003C\u002Fspan>\n        \u003C\u002Fpre>\n        \n    *   Install pyelftools based on that version of python  \n        \n        \u003Cpre>\n        \u003Cspan>pip3.10 install pyelftools\u003C\u002Fspan>\n        \u003C\u002Fpre>\n        \n    *   A screenshot of what that check and install would look like.  \n        ![](https:\u002F\u002Fdevedge.t-mobile.com\u002Fuploads\u002Fimage_2022_11_15_16_40_33_c7cf4070bd.png?updated_at=2022-12-16T20:18:13.716Z)  \n        \n\n## FAQ\n\n*   **Question** - Will these instructions work on a Windows OS?\n*   **Answer** - No it will not. Please see the [Windows OS for Zephyr Development](\u002Fdocumentation-hub\u002Fiot-developer-kit\u002Fdeveloper-environment-setup\u002Fwindows-os-for-zephyr-development) doc for further details.\n    \n\u003Cbr>\n\n*   **Question** - What do the different files in the $HOME\u002Fzephyrproject\u002FDevEdge-IoTDevKit-ZephyrSDK\u002Fsamples\u002Ftmo\\_shell folder do?\n*   **Answer** - Please see the [Description of tmo\\_shell Source Files](\u002Fdocumentation-hub\u002Fiot-developer-kit\u002Fdeveloper-environment-setup\u002Fdescription-of-tmo-shell-source-files) document to learn more.",{"docPagePath":28,"pageName":29},"documentation>iot-kits>iot-developer-kit>developer-environment-setup>macos-for-zephyr-development","documentation"]