Skip to content

Getting started guide for Windows environment

Luong Minh Thao edited this page Jun 28, 2024 · 2 revisions

1. Install dependencies

2. Get Zephyr and install Python dependencies

  • Open a cmd.exe terminal window as a regular user

  • Install west:

    pip3 install -U west

    windows_install_west
  • Get the Zephyr source code:

    cd %HOMEPATH%

    west init -m https://github.com/renesas/zephyr.git --mr ra8-support-PR1.3 zephyrproject

    Windows_west_init_2

    cd zephyrproject

    west update

    Windows_west_update
  • Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications

    west zephyr-export

    Windows_west_export

  • Install additional Python dependencies

    pip3 install -r %HOMEPATH%\zephyrproject\zephyr\scripts\requirements.txt

5. Install the Zephyr SDK

  • Download Zephyr SDK bundle

    Note: Support SDKv0.16.8 or above

    cd %HOMEPATH%

    wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/zephyr-sdk-0.16.8_windows-x86_64.7z

    Windows_SDK_2
  • Extract the Zephyr SDK bundle archive:

    7z x zephyr-sdk-0.16.8_windows-x86_64.7z

    Window_SDK_Success
  • Run the Zephyr SDK bundle setup script:

    cd zephyr-sdk-0.16.8

    setup.cmd

    Window_SDK_Success_2

6. Build the Blinky Sample

  • For EK-RA8M1

    cd %HOMEPATH%\zephyrproject\zephyr

    west build -p always -b ek_ra8m1 samples\basic\blinky

    Windows_build1 Windows_build2

    Output: zephyrproject/zephyr/build/zephyr/zephyr.elf

  • For EK-RA8D1

    cd %HOMEPATH%\zephyrproject\zephyr

    west build -p always -b ek_ra8d1 samples\basic\blinky

  • For MCK-RA8T1

    cd %HOMEPATH%\zephyrproject\zephyr

    west build -p always -b mck_ra8t1 samples\basic\blinky

7. Flash the Sample

west flash

west_flash

  • Note: It is required to install SEGGER JLink (https://www.segger.com/) for west flash. And make sure installed folder is on your %PATH% environment variable

    PATH_update_for_JLink

  • Refer Hardware connection before flash image.

8 Troubleshooting

  • Cannot init project, FATAL ERROR: already initialized
> west init -m https://github.com/renesas/zephyr.git --mr ra8-support-PR1.3 zephyrproject
=== Initializing in C:\Users\<username>\zephyrproject
FATAL ERROR: already initialized in C:\Users\<username>\zephyrproject, aborting.

zephyrproject directory already exist. Need to remove directory "C:\Users<username>\zephyrproject" then re-run for successful initialization.

  • Dependencies are not recognized as an internal or external command, operable program or batch file. Recheck %PATH% environment variable and ensure installed folders for dependencies

For example,

'wget' is not recognized as an internal or external command, operable program or batch file.

Please recheck %PATH% environment variable and ensure installed folder for wget.

PATH_wget

  • Fail when west init or update due to network quality

    • Fail when "west init"

      Windows_issue1

      In this case, please check connection, then remove "zephyrproject" folder and try again.

    • Fail when "west update"

      Windows_west_update_error

      Please check connection, then try again.

  • How to update for %PATH%

    • Open a cmd.exe terminal window as a regular user, setx for PATH. For example, update PATH for JLink

      setx PATH "C:\Users\thaoluong\SEGGER\JLink_V794l"

      Note: Setting is only available when re-open for cmd.exe terminal.

      Setx_PATH_for_JLink
    • Close cmd.exe terminal window

    • Re-open cmd.exe terminal window and check for PATH update

      echo %PATH%

      PATH_update_for_JLink