summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-03-18 19:53:39 +0700
committerhathach <[email protected]>2021-03-18 19:53:39 +0700
commit249852d25ced9852eb7f95dcc38b2a82b4c02390 (patch)
treeebd05fce430ebc7a8f1b8a1b76ae4a71191d6e63
parente182bb2a5b27eca914a72e8c074dabd333603d34 (diff)
use boot2_generic_03h for adafruit feather rp2040
- also use boot2_generic_03h for now for itsy bitsy and qt rp2040 - change default flash target for rp2040 to flash-pyocd
-rw-r--r--examples/device/audio_test/CMakeLists.txt3
-rw-r--r--examples/device/board_test/CMakeLists.txt4
-rw-r--r--examples/device/cdc_dual_ports/CMakeLists.txt3
-rw-r--r--examples/device/cdc_msc/CMakeLists.txt3
-rw-r--r--examples/device/dfu_runtime/CMakeLists.txt3
-rw-r--r--examples/device/dynamic_configuration/CMakeLists.txt3
-rw-r--r--examples/device/hid_composite/CMakeLists.txt3
-rw-r--r--examples/device/hid_generic_inout/CMakeLists.txt3
-rw-r--r--examples/device/hid_multiple_interface/CMakeLists.txt3
-rw-r--r--examples/device/midi_test/CMakeLists.txt3
-rw-r--r--examples/device/msc_dual_lun/CMakeLists.txt3
-rw-r--r--examples/device/net_lwip_webserver/CMakeLists.txt3
-rw-r--r--examples/device/uac2_headset/CMakeLists.txt3
-rw-r--r--examples/device/usbtmc/CMakeLists.txt2
-rw-r--r--examples/device/webusb_serial/CMakeLists.txt3
-rw-r--r--examples/host/cdc_msc_hid/CMakeLists.txt3
-rw-r--r--hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake1
-rw-r--r--hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake1
-rw-r--r--hw/bsp/rp2040/boards/adafruit_qt_rp2040/board.cmake1
-rw-r--r--hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake1
-rw-r--r--hw/bsp/rp2040/family.cmake6
-rw-r--r--hw/bsp/rp2040/family.mk10
22 files changed, 46 insertions, 22 deletions
diff --git a/examples/device/audio_test/CMakeLists.txt b/examples/device/audio_test/CMakeLists.txt
index 7038dd041..03f2439e2 100644
--- a/examples/device/audio_test/CMakeLists.txt
+++ b/examples/device/audio_test/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt
index 4e6a9b3f8..b4c4ce4d0 100644
--- a/examples/device/board_test/CMakeLists.txt
+++ b/examples/device/board_test/CMakeLists.txt
@@ -9,15 +9,17 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "esp32s2")
cmake_minimum_required(VERSION 3.5)
+
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
project(${PROJECT})
elseif(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt
index 5e3ec0909..94e4fc1fa 100644
--- a/examples/device/cdc_dual_ports/CMakeLists.txt
+++ b/examples/device/cdc_dual_ports/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt
index 41dd167b7..f6cf64521 100644
--- a/examples/device/cdc_msc/CMakeLists.txt
+++ b/examples/device/cdc_msc/CMakeLists.txt
@@ -17,9 +17,8 @@ elseif(FAMILY STREQUAL "rp2040")
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
-
+
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
# Example source
diff --git a/examples/device/dfu_runtime/CMakeLists.txt b/examples/device/dfu_runtime/CMakeLists.txt
index 5e3ec0909..ea294b3b9 100644
--- a/examples/device/dfu_runtime/CMakeLists.txt
+++ b/examples/device/dfu_runtime/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/dynamic_configuration/CMakeLists.txt b/examples/device/dynamic_configuration/CMakeLists.txt
index be6224360..09a8dcc4c 100644
--- a/examples/device/dynamic_configuration/CMakeLists.txt
+++ b/examples/device/dynamic_configuration/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/hid_composite/CMakeLists.txt b/examples/device/hid_composite/CMakeLists.txt
index 5e3ec0909..c85f2ace2 100644
--- a/examples/device/hid_composite/CMakeLists.txt
+++ b/examples/device/hid_composite/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/hid_generic_inout/CMakeLists.txt b/examples/device/hid_generic_inout/CMakeLists.txt
index 5e3ec0909..5de4a932d 100644
--- a/examples/device/hid_generic_inout/CMakeLists.txt
+++ b/examples/device/hid_generic_inout/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/hid_multiple_interface/CMakeLists.txt b/examples/device/hid_multiple_interface/CMakeLists.txt
index 5e3ec0909..5de4a932d 100644
--- a/examples/device/hid_multiple_interface/CMakeLists.txt
+++ b/examples/device/hid_multiple_interface/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/midi_test/CMakeLists.txt b/examples/device/midi_test/CMakeLists.txt
index 5e3ec0909..5de4a932d 100644
--- a/examples/device/midi_test/CMakeLists.txt
+++ b/examples/device/midi_test/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/msc_dual_lun/CMakeLists.txt b/examples/device/msc_dual_lun/CMakeLists.txt
index 0036dc685..48e183edc 100644
--- a/examples/device/msc_dual_lun/CMakeLists.txt
+++ b/examples/device/msc_dual_lun/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/net_lwip_webserver/CMakeLists.txt b/examples/device/net_lwip_webserver/CMakeLists.txt
index c9aabc636..69a242be8 100644
--- a/examples/device/net_lwip_webserver/CMakeLists.txt
+++ b/examples/device/net_lwip_webserver/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/uac2_headset/CMakeLists.txt b/examples/device/uac2_headset/CMakeLists.txt
index 5e3ec0909..5de4a932d 100644
--- a/examples/device/uac2_headset/CMakeLists.txt
+++ b/examples/device/uac2_headset/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/usbtmc/CMakeLists.txt b/examples/device/usbtmc/CMakeLists.txt
index 808bdbcf8..f40d123b0 100644
--- a/examples/device/usbtmc/CMakeLists.txt
+++ b/examples/device/usbtmc/CMakeLists.txt
@@ -11,8 +11,8 @@ if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/webusb_serial/CMakeLists.txt b/examples/device/webusb_serial/CMakeLists.txt
index 5e3ec0909..5de4a932d 100644
--- a/examples/device/webusb_serial/CMakeLists.txt
+++ b/examples/device/webusb_serial/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/host/cdc_msc_hid/CMakeLists.txt b/examples/host/cdc_msc_hid/CMakeLists.txt
index 2302678b7..7413e4087 100644
--- a/examples/host/cdc_msc_hid/CMakeLists.txt
+++ b/examples/host/cdc_msc_hid/CMakeLists.txt
@@ -14,10 +14,11 @@ if(FAMILY STREQUAL "esp32s2")
elseif(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake b/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake
new file mode 100644
index 000000000..ea4070cf3
--- /dev/null
+++ b/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake
@@ -0,0 +1 @@
+set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_generic_03h.S")
diff --git a/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake b/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake
new file mode 100644
index 000000000..ea4070cf3
--- /dev/null
+++ b/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake
@@ -0,0 +1 @@
+set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_generic_03h.S")
diff --git a/hw/bsp/rp2040/boards/adafruit_qt_rp2040/board.cmake b/hw/bsp/rp2040/boards/adafruit_qt_rp2040/board.cmake
new file mode 100644
index 000000000..ea4070cf3
--- /dev/null
+++ b/hw/bsp/rp2040/boards/adafruit_qt_rp2040/board.cmake
@@ -0,0 +1 @@
+set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_generic_03h.S")
diff --git a/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake b/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake
new file mode 100644
index 000000000..eb9f219d2
--- /dev/null
+++ b/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake
@@ -0,0 +1 @@
+set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_w25q080.S")
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index af23c2368..63c7daa38 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -1,3 +1,9 @@
+# Board specific define e.g boot stage2
+# PICO_DEFAULT_BOOT_STAGE2_FILE must be set before pico_sdk_init()
+include(${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake)
+
+pico_sdk_init()
+
target_link_libraries(${PROJECT}
pico_stdlib
pico_bootsel_via_double_reset
diff --git a/hw/bsp/rp2040/family.mk b/hw/bsp/rp2040/family.mk
index ed7b11564..6df367323 100644
--- a/hw/bsp/rp2040/family.mk
+++ b/hw/bsp/rp2040/family.mk
@@ -1,5 +1,8 @@
DEPS_SUBMODULES += hw/mcu/raspberrypi/pico-sdk
+JLINK_DEVICE = rp2040_m0_0
+PYOCD_TARGET = rp2040
+
ifeq ($(DEBUG), 1)
CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
endif
@@ -13,9 +16,6 @@ all: $(BUILD)
clean:
$(RM) -rf $(BUILD)
-#flash: flash-pyocd
-flash:
+flash: flash-pyocd
+flash-uf2:
@$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
-
-JLINK_DEVICE = rp2040_m0_0
-PYOCD_TARGET = rp2040