diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5089171..72abc2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,10 @@ jobs: runs-on: ubuntu-22.04 env: BUILD_TYPE: "Release" - PICOSDK_VER: "1.5.1" - PICOEXTRA_VER: "sdk-1.5.1" + PICOSDK_VER: "2.0.0" + PICOEXTRA_VER: "sdk-2.0.0" # The Pico-SDK will listen to these environment vars + PICOTOOL_FETCH_FROM_GIT_PATH: ${{github.workspace}}/pico/picotool PICO_SDK_PATH: ${{github.workspace}}/pico/pico-sdk PICO_EXTRAS_PATH: ${{github.workspace}}/pico/pico-extras OUTPUT_DIR: ${{github.workspace}}/binaries @@ -20,7 +21,7 @@ jobs: - name: Install Arm GNU Toolchain (arm-none-eabi-gcc) uses: carlosperate/arm-none-eabi-gcc-action@v1 with: - release: '13.2.Rel1' + release: '13.3.Rel1' # Since we reference stable versions of Pico-SDK and pico-extras, we can cache their downloads. # If this were to reference changing branches (like "master"), this caching step must be removed!!! diff --git a/sw/CMakeLists.txt b/sw/CMakeLists.txt index ceccd91..a0b9c63 100644 --- a/sw/CMakeLists.txt +++ b/sw/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.13) +set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}) +set(PICO_BOARD pico_w) +set(PICO_COPY_TO_RAM 1) # Initialise pico_sdk from installed location # (note this can come from environment, CMake cache etc) @@ -22,10 +25,6 @@ set(CMAKE_CXX_STANDARD 17) include(pico_extras_import.cmake) -set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}) -set(PICO_BOARD PICO_W) -set(PICO_COPY_TO_RAM 1) - # Tell the Pico SDK to use our local tinyusb instead of the one included in the SDK # This is needed to support tusb_xinput set(PICO_TINYUSB_PATH ${CMAKE_CURRENT_LIST_DIR}/tinyusb) @@ -322,6 +321,9 @@ function(build_ne2000 TARGET_NAME MULTIFW) target_compile_definitions(${TARGET_NAME} PRIVATE NE2000=1 PICOW=1 + # CYW43_RESOURCE_ATTRIBUTE="__in_flash()" + CYW43_CONFIG_FILE="cyw43_firmware.h" + CYW43_PIO_CLOCK_DIV_INT=3 ) target_sources(${TARGET_NAME} PRIVATE ne2000play.cpp @@ -329,6 +331,7 @@ function(build_ne2000 TARGET_NAME MULTIFW) target_link_libraries( ${TARGET_NAME} ne2000 + pico_cyw43_arch_none ) endfunction() diff --git a/sw/flash_settings.c b/sw/flash_settings.c index db75980..cd6c687 100644 --- a/sw/flash_settings.c +++ b/sw/flash_settings.c @@ -4,6 +4,7 @@ #include "flash_settings.h" #include "hardware/flash.h" #include "hardware/sync.h" +#include "hardware/clocks.h" #include "pico/stdlib.h" #include "pico/flash.h" diff --git a/sw/ne2000/CMakeLists.txt b/sw/ne2000/CMakeLists.txt index 74ff96a..b3359e9 100644 --- a/sw/ne2000/CMakeLists.txt +++ b/sw/ne2000/CMakeLists.txt @@ -16,13 +16,13 @@ target_sources(ne2000 INTERFACE ) target_link_libraries(ne2000 INTERFACE - # pico_cyw43_arch_none - pico_cyw43_arch_poll + pico_cyw43_arch_none + # pico_cyw43_arch_poll ) -target_compile_definitions(pico_cyw43_arch_poll_headers INTERFACE - CYW43_LWIP=0 -) -target_compile_definitions(ne2000 INTERFACE - CYW43_LWIP=0 -) +# target_compile_definitions(pico_cyw43_arch_poll_headers INTERFACE +# CYW43_LWIP=0 +# ) +# target_compile_definitions(ne2000 INTERFACE +# CYW43_LWIP=0 +# ) diff --git a/sw/ne2000/ne2000.c b/sw/ne2000/ne2000.c index 65eba21..877866c 100644 --- a/sw/ne2000/ne2000.c +++ b/sw/ne2000/ne2000.c @@ -66,6 +66,8 @@ char WIFI_SSID[33]; char WIFI_KEY[63]; */ +uint16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, uint16_t len, uint16_t offset) {} + #define CYW43_LINK_DOWN (0) ///< link is down #define CYW43_LINK_JOIN (1) ///< Connected to wifi diff --git a/sw/ne2000play.cpp b/sw/ne2000play.cpp index dcd292f..b5a2863 100644 --- a/sw/ne2000play.cpp +++ b/sw/ne2000play.cpp @@ -52,7 +52,7 @@ void play_ne2000() { break; } } - cyw43_arch_poll(); + /* cyw43_arch_poll(); */ /* if (((time_us_32() >> 21) & 0x1) == 0x1) { if (flag == false) { diff --git a/sw/pico_extras_import.cmake b/sw/pico_extras_import.cmake index 706add0..b75b9b3 100644 --- a/sw/pico_extras_import.cmake +++ b/sw/pico_extras_import.cmake @@ -26,14 +26,14 @@ if (NOT PICO_EXTRAS_PATH) get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_EXTRAS_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") endif () FetchContent_Declare( - PICO_EXTRAS + pico_extras GIT_REPOSITORY https://github.com/raspberrypi/pico-extras GIT_TAG master ) - if (NOT PICO_EXTRAS) - message("Downloading PICO EXTRAS") - FetchContent_Populate(PICO_EXTRAS) - set(PICO_EXTRAS_PATH ${PICO_EXTRAS_SOURCE_DIR}) + if (NOT pico_extras) + message("Downloading Raspberry Pi Pico Extras") + FetchContent_Populate(pico_extras) + set(PICO_EXTRAS_PATH ${pico_extras_SOURCE_DIR}) endif () set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) else () @@ -59,4 +59,4 @@ endif () set(PICO_EXTRAS_PATH ${PICO_EXTRAS_PATH} CACHE PATH "Path to the PICO EXTRAS" FORCE) -add_subdirectory(${PICO_EXTRAS_PATH} pico_extras) \ No newline at end of file +add_subdirectory(${PICO_EXTRAS_PATH} pico_extras) diff --git a/sw/pico_reflash.c b/sw/pico_reflash.c index 5f0d0db..d87e896 100644 --- a/sw/pico_reflash.c +++ b/sw/pico_reflash.c @@ -2,6 +2,7 @@ #include #include +#include "hardware/clocks.h" #include "pico/multicore.h" #include "pico/stdlib.h" diff --git a/sw/pico_sdk_import.cmake b/sw/pico_sdk_import.cmake index 65f8a6f..a0721d0 100644 --- a/sw/pico_sdk_import.cmake +++ b/sw/pico_sdk_import.cmake @@ -18,9 +18,20 @@ if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_P message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") endif () +if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) + set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) + message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") +endif () + +if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) + set(PICO_SDK_FETCH_FROM_GIT_TAG "master") + message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") +endif() + set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") +set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") if (NOT PICO_SDK_PATH) if (PICO_SDK_FETCH_FROM_GIT) @@ -34,14 +45,14 @@ if (NOT PICO_SDK_PATH) FetchContent_Declare( pico_sdk GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master + GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} GIT_SUBMODULES_RECURSE FALSE ) else () FetchContent_Declare( pico_sdk GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master + GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} ) endif ()