[RaspberryPi-Pico] 개발 환경 구축(Windows) #1

2023. 2. 7. 20:04프로젝트 로그/RaspberryPi-Pico

반응형

Windows 환경에서 RaspberryPi-Pico 개발을 위한 환경 구축 방법을 설명한다.

 

 

Toolchain 설치

ARM GNU Toolchain

  • C/C++로 작성된 코드를 아래 타겟 CPU에서 작동하게 하는 GCC 컴파일러 및 GDB 디버거
    • 타겟 CPU : ARM Cortex-M, ARM Cortex-R
  • 다운로드 링크

 

 

CMake

  • C/C++ 프로젝트를 빌드하기 위한 Makefile을 보다 쉽고 편리하게 작성 할 수 있도록 도와주는 툴
  • 다운로드 링크

 

 

Build Tools for Visual Studio 2022

 

  • Visual Studio 2022용 빌드 도구 다운로드 완료 후 실행
    • C++를 사용한 데스크톱 개발 환경 설치

 

  • 설치된 빌드 툴을 윈도우에서 사용 할 수 있도록 Path 설정
    • C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64
  • 설치가 잘 되었는지 아래 명령으로 확인
    • 문제 없이 설치되었다면, 명령 프롬프트에서 nmake 실행 후 아래와 같은 화면이 출력
    • 윈도우에서 nmake를 사용 할 수 있음

 

 

샘플코드 다운로드 및 빌드

SDK and Example git checkout

$ git clone https://github.com/raspberrypi/pico-sdk.git --branch master
$ cd pico-sdk
$ git submodule update --init
$ git clone https://github.com/raspberrypi/pico-examples.git --branch master

 

Developer Command Prompt for VS 2022 실행

  • 해당 Prompt로 실행 해야, 위에서 설치한 Visual Studio 2022용 빌드 도구를 사용 할 수 있음

  • Example 코드 위치로 이동 후, 아래 명령 수행
    • PICO_SDK_PATH 설정
    • Example 코드의 build 폴더로 이동
    • cmake 후 nmake로 빌드
$ c:\Workspace\RaspberryPi\pico-examples
$ setx PICO_SDK_PATH "../pico-sdk"
$ cd build
$ cmake -G "NMake Makefiles" ..

Using PICO_SDK_PATH from environment ('C:\Workspace\RaspberryPi\pico-sdk')
PICO_SDK_PATH is C:/Workspace/RaspberryPi/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/12.2 rel1/bin/arm-none-eabi-gcc.exe
Build type is Release
Defaulting PICO target board to pico since not specified.
Using board configuration from C:/Workspace/RaspberryPi/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: C:/Python311/python.exe (found version "3.11.1") found components: Interpreter
TinyUSB available at C:/Workspace/RaspberryPi/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
cyw43-driver available at C:/Workspace/RaspberryPi/pico-sdk/lib/cyw43-driver
lwIP available at C:/Workspace/RaspberryPi/pico-sdk/lib/lwip
-- Configuring done


$ nmake

 

참고 자료

 

 

 

 

 

 

 

반응형