Kaynağa Gözat

Initital framework update

Eric Helgeson 3 ay önce
ebeveyn
işleme
a4cac695a0
2 değiştirilmiş dosya ile 16 ekleme ve 24 silme
  1. 6 13
      platformio.ini
  2. 10 11
      src/BlueSCSI_bootloader.cpp

+ 6 - 13
platformio.ini

@@ -1,7 +1,7 @@
 ; PlatformIO Project Configuration File https://docs.platformio.org/page/projectconf.html
 
 [platformio]
-default_envs = BlueSCSI_Pico, BlueSCSI_Pico_DaynaPORT, BlueSCSI_Pico_2, BlueSCSI_Pico_2_DaynaPORT
+default_envs = BlueSCSI_Pico_DaynaPORT, BlueSCSI_Pico_2_DaynaPORT
 
 [env]
 build_flags =
@@ -11,17 +11,18 @@ build_flags =
 ; Note: getting the code to break on main, check the comments in the rp2040-template.ld or rp23xx-template.ld
 ;       They should instruct you on the changes needed to move code out of SRAM and back to flash
 [env:BlueSCSI_RP2MCU]
-platform = https://github.com/maxgerhardt/platform-raspberrypi.git#39b90392af50585e429941bd2561a91949a2ba46
+platform = https://github.com/maxgerhardt/platform-raspberrypi.git#6164ed92d83c1241a1d84ad848158d7b0fb486e3
 platform_packages =
-    framework-arduinopico@https://github.com/BlueSCSI/arduino-pico-internal.git#v4.3.0-DaynaPORT
+    framework-arduinopico@https://github.com/BlueSCSI/arduino-pico-internal.git#v4.7.0-DaynaPORT
 extra_scripts =
     src/build_bootloader.py
     src/process-linker-script.py
 board_build.core = earlephilhower
 board_build.ldscript = ${BUILD_DIR}/rp_linker.ld ; created by src/process-linker-script.py
 framework = arduino
+program_flash_allocation = 1273856
 lib_deps =
-    SdFat=https://github.com/BlueSCSI/SdFat#2.2.3-gpt-testexfatlen
+    SdFat=https://github.com/BlueSCSI/SdFat#2.2.3-gpt-exfat
     minIni
     SCSI2SD
     ; When updating git tag for CUEParser here, also update lib\BlueSCSI_platform_RP2MCU\library.json
@@ -53,21 +54,19 @@ build_flags =
     -DCYW43_PIN_WL_DYNAMIC=1
 	-DCYW43_LWIP=0
 	-DCYW43_USE_OTP_MAC=0
-
+    -DROMDRIVE_OFFSET=${env:BlueSCSI_RP2MCU.program_flash_allocation}
 
 ; Variant of RP2040 platform, based on Raspberry Pico board and a carrier PCB
 ; Part of the BlueSCSI_RP2040 platform, but with different pins.
 [env:BlueSCSI_Pico]
 extends = env:BlueSCSI_RP2MCU
 board = rpipico
-program_flash_allocation = 360448
 linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp2040-template.ld
 ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp2040_btldr.ld
 build_flags =
     ${env:BlueSCSI_RP2MCU.build_flags}
     -DBLUESCSI_V2
     -DBLUESCSI_MCU_RP20XX
-    -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico.program_flash_allocation}
 
 ; BlueSCSI RP2040 hardware platform, as above, but with audio output support enabled
 [env:BlueSCSI_Pico_Audio]
@@ -85,7 +84,6 @@ extends = env:BlueSCSI_RP2MCU
 board = rpipicow
 ; How much flash in bytes the bootloader and main app will be allocated
 ; It is used as the starting point for a ROM image saved in flash
-program_flash_allocation = 592896
 linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp2040-template.ld
 ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp2040_btldr.ld
 debug_build_flags =
@@ -106,7 +104,6 @@ build_flags =
     -DBLUESCSI_NETWORK
     -DBLUESCSI_DAYNAPORT
     -DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
-    -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico_DaynaPORT.program_flash_allocation}
 ; These take a large portion of the SRAM and can be adjusted
     -DLOGBUFSIZE=2048
     -DPREFETCH_BUFFER_SIZE=4608
@@ -126,7 +123,6 @@ board = rpipico2
 ; How much flash in bytes the bootloader and main app will be allocated
 ; It is used as the starting point for a ROM image saved in flash
 ; Changing this will cause issues with boards that already have a ROM drive in flash
-program_flash_allocation = 360448
 linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp23xx-template.ld
 ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp23xx_btldr.ld
 debug_build_flags =
@@ -135,7 +131,6 @@ build_flags =
     ${env:BlueSCSI_RP2MCU.build_flags}
     -DBLUESCSI_V2
     -DBLUESCSI_MCU_RP23XX
-    -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico_2.program_flash_allocation}
 
 [env:BlueSCSI_Pico_2_DaynaPORT]
 extends = env:BlueSCSI_RP2MCU
@@ -143,7 +138,6 @@ board = rpipico2w
 ; How much flash in bytes the bootloader and main app will be allocated
 ; It is used as the starting point for a ROM image saved in flash
 ; Changing this will cause issues with boards that already have a ROM drive in flash
-program_flash_allocation = 589824
 linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp23xx-template.ld
 ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp23xx_btldr.ld
 build_flags =
@@ -154,4 +148,3 @@ build_flags =
     -DBLUESCSI_NETWORK
     -DBLUESCSI_DAYNAPORT
     -DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
-    -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico_2_DaynaPORT.program_flash_allocation}

+ 10 - 11
src/BlueSCSI_bootloader.cpp

@@ -24,7 +24,6 @@
 #include <BlueSCSI_platform.h>
 #include "BlueSCSI_config.h"
 #include "BlueSCSI_log.h"
-#include <string.h>
 #include <SdFat.h>
 
 #ifdef PLATFORM_BOOTLOADER_SIZE
@@ -74,13 +73,13 @@ bool program_firmware(FsFile &file)
 
     if (filesize > PLATFORM_FLASH_TOTAL_SIZE)
     {
-        logmsg("Firmware too large: ", (int)filesize, " flash size ", (int)PLATFORM_FLASH_TOTAL_SIZE);
+        // logmsg("Firmware too large: ", (int)filesize, " flash size ", (int)PLATFORM_FLASH_TOTAL_SIZE);
         return false;
     }
 
     if (!file.seek(PLATFORM_BOOTLOADER_SIZE))
     {
-        logmsg("Seek failed");
+        // logmsg("Seek failed");
         return false;
     }
 
@@ -93,13 +92,13 @@ bool program_firmware(FsFile &file)
         
         if (file.read(buffer, PLATFORM_FLASH_PAGE_SIZE) <= 0)
         {
-            logmsg("Firmware file read failed on page ", i);
+            // logmsg("Firmware file read failed on page ", i);
             return false;
         }
 
         if (!platform_rewrite_flash_page(PLATFORM_BOOTLOADER_SIZE + i * PLATFORM_FLASH_PAGE_SIZE, buffer))
         {
-            logmsg("Flash programming failed on page ", i);
+            // logmsg("Flash programming failed on page ", i);
             return false;
         }
     }
@@ -147,7 +146,7 @@ int bootloader_main(void)
     platform_init();
     g_log_debug = true;
 
-    logmsg("Bootloader version: " __DATE__ " " __TIME__ " " PLATFORM_NAME);
+    // logmsg("Bootloader version: " __DATE__ " " __TIME__ " " PLATFORM_NAME);
 
     if (mountSDCard() || mountSDCard())
     {
@@ -157,16 +156,16 @@ int bootloader_main(void)
         {
             if (program_firmware(fwfile))
             {
-                logmsg("Firmware update successful!");
+                // logmsg("Firmware update successful!");
                 fwfile.close();
                 if (!SD.remove(name))
                 {
-                    logmsg("Failed to remove firmware file");
+                    // logmsg("Failed to remove firmware file");
                 }
             }
             else
             {
-                logmsg("Firmware update failed!");
+                // logmsg("Firmware update failed!");
                 platform_emergency_log_save();
             }
             
@@ -174,10 +173,10 @@ int bootloader_main(void)
     }
     else
     {
-        logmsg("Bootloader SD card init failed");
+        // logmsg("Bootloader SD card init failed");
     }
 
-    logmsg("Bootloader continuing to main firmware");
+    // logmsg("Bootloader continuing to main firmware");
     platform_boot_to_main_firmware();
 
     return 0;