platformio.ini 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ; PlatformIO Project Configuration File https://docs.platformio.org/page/projectconf.html
  2. [platformio]
  3. default_envs = BlueSCSI_Pico, BlueSCSI_Pico_DaynaPORT, BlueSCSI_Pico_2, BlueSCSI_Pico_2_DaynaPORT
  4. [env]
  5. build_flags =
  6. -DBUILD_ENV=$PIOENV
  7. ; BlueSCSI settings shared among Raspberry Pi microcontroller like the RP2040 and RP2350
  8. ; Note: getting the code to break on main, check the comments in the rp2040-template.ld or rp23xx-template.ld
  9. ; They should instruct you on the changes needed to move code out of SRAM and back to flash
  10. [env:BlueSCSI_RP2MCU]
  11. platform = https://github.com/maxgerhardt/platform-raspberrypi.git#39b90392af50585e429941bd2561a91949a2ba46
  12. platform_packages =
  13. framework-arduinopico@https://github.com/BlueSCSI/arduino-pico-internal.git#v4.3.0-DaynaPORT
  14. extra_scripts =
  15. src/build_bootloader.py
  16. src/process-linker-script.py
  17. board_build.core = earlephilhower
  18. board_build.ldscript = ${BUILD_DIR}/rp_linker.ld ; created by src/process-linker-script.py
  19. framework = arduino
  20. lib_deps =
  21. SdFat=https://github.com/BlueSCSI/SdFat#2.2.3-gpt-testexfatlen
  22. minIni
  23. SCSI2SD
  24. ; When updating git tag for CUEParser here, also update lib\BlueSCSI_platform_RP2MCU\library.json
  25. CUEParser=https://github.com/BlueSCSI/CUEParser#v2025.02.25
  26. BlueSCSI_platform_RP2MCU
  27. upload_protocol = cmsis-dap
  28. debug_tool = cmsis-dap
  29. debug_build_flags =
  30. -O2 -ggdb -g3
  31. build_flags =
  32. ${env.build_flags}
  33. -O2 -Isrc -ggdb -g3
  34. -Wall -Wno-sign-compare -Wno-ignored-qualifiers -Wno-overloaded-virtual
  35. -DSPI_DRIVER_SELECT=3
  36. -DSD_CHIP_SELECT_MODE=2
  37. -DENABLE_DEDICATED_SPI=1
  38. -DHAS_SDIO_CLASS
  39. -DUSE_ARDUINO=1
  40. -DPICO_FLASH_SPI_CLKDIV=2
  41. -DPLATFORM_MASS_STORAGE
  42. -DFILE_COPY_CONSTRUCTOR_SELECT=FILE_COPY_CONSTRUCTOR_PUBLIC
  43. -DDISABLE_FS_H_WARNING
  44. -DRECLOCKING_SUPPORTED
  45. -DPLATFORM_HAS_INITIATOR_MODE
  46. ; SWO detection handled at runtime
  47. -DDISABLE_SWO
  48. ; build flags mirroring the "framework-arduinopico#x.x.x-DaynaPORT" static library build
  49. -DPICO_CYW43_ARCH_POLL=1
  50. -DCYW43_PIN_WL_DYNAMIC=1
  51. -DCYW43_LWIP=0
  52. -DCYW43_USE_OTP_MAC=0
  53. ; Variant of RP2040 platform, based on Raspberry Pico board and a carrier PCB
  54. ; Part of the BlueSCSI_RP2040 platform, but with different pins.
  55. [env:BlueSCSI_Pico]
  56. extends = env:BlueSCSI_RP2MCU
  57. board = rpipico
  58. program_flash_allocation = 360448
  59. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp2040-template.ld
  60. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp2040_btldr.ld
  61. build_flags =
  62. ${env:BlueSCSI_RP2MCU.build_flags}
  63. -DBLUESCSI_V2
  64. -DBLUESCSI_MCU_RP20XX
  65. -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico.program_flash_allocation}
  66. ; BlueSCSI RP2040 hardware platform, as above, but with audio output support enabled
  67. [env:BlueSCSI_Pico_Audio]
  68. extends = env:BlueSCSI_RP2040
  69. build_flags =
  70. ${env:BlueSCSI_Pico.build_flags}
  71. -DENABLE_AUDIO_OUTPUT
  72. -DENABLE_AUDIO_OUTPUT_SPDIF
  73. -DLOGBUFSIZE=8192
  74. ; Build for the BlueSCSI Pico carrier board with a Pico-W
  75. ; for SCSI DaynaPORT emulation
  76. [env:BlueSCSI_Pico_DaynaPORT]
  77. extends = env:BlueSCSI_RP2MCU
  78. board = rpipicow
  79. ; How much flash in bytes the bootloader and main app will be allocated
  80. ; It is used as the starting point for a ROM image saved in flash
  81. program_flash_allocation = 592896
  82. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp2040-template.ld
  83. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp2040_btldr.ld
  84. debug_build_flags =
  85. ${env:BlueSCSI_RP2MCU.debug_build_flags}
  86. -DLOGBUFSIZE=4096
  87. -DPREFETCH_BUFFER_SIZE=0
  88. -DSCSI2SD_BUFFER_SIZE=57344
  89. ; This controls the depth NETWORK_PACKET_MAX_SIZE (1520 bytes)
  90. ; For example a queue size of 10 would be 10 x 1520 = 30400 bytes
  91. -DNETWORK_PACKET_QUEUE_SIZE=8
  92. ; This flag enables verbose logging of TCP/IP traffic and other information
  93. ; it also takes up a bit of SRAM so it should be disabled with production code
  94. -DNETWORK_DEBUG_LOGGING
  95. build_flags =
  96. ${env:BlueSCSI_RP2MCU.build_flags}
  97. -DBLUESCSI_V2
  98. -DBLUESCSI_MCU_RP20XX
  99. -DBLUESCSI_NETWORK
  100. -DBLUESCSI_DAYNAPORT
  101. -DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
  102. -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico_DaynaPORT.program_flash_allocation}
  103. ; These take a large portion of the SRAM and can be adjusted
  104. -DLOGBUFSIZE=2048
  105. -DPREFETCH_BUFFER_SIZE=4608
  106. -DSCSI2SD_BUFFER_SIZE=57344
  107. ; This controls the depth of NETWORK_PACKET_MAX_SIZE (1520 bytes)
  108. ; For example a queue size of 10 would be 10 x 1520 = 15200 bytes
  109. -DNETWORK_PACKET_QUEUE_SIZE=14
  110. ; This flag enables verbose logging of TCP/IP traffic and other information
  111. ; it also takes up a bit of SRAM so it should be disabled with production code
  112. ; -DNETWORK_DEBUG_LOGGING
  113. ; BlueSCSI Pico2 hardware platform, based on the Raspberry Pi foundation RP2350A microcontroller
  114. [env:BlueSCSI_Pico_2]
  115. extends = env:BlueSCSI_RP2MCU
  116. board = rpipico2
  117. ; How much flash in bytes the bootloader and main app will be allocated
  118. ; It is used as the starting point for a ROM image saved in flash
  119. ; Changing this will cause issues with boards that already have a ROM drive in flash
  120. program_flash_allocation = 360448
  121. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp23xx-template.ld
  122. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp23xx_btldr.ld
  123. debug_build_flags =
  124. ${env:BlueSCSI_RP2MCU.debug_build_flags}
  125. build_flags =
  126. ${env:BlueSCSI_RP2MCU.build_flags}
  127. -DBLUESCSI_V2
  128. -DBLUESCSI_MCU_RP23XX
  129. -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico_2.program_flash_allocation}
  130. [env:BlueSCSI_Pico_2_DaynaPORT]
  131. extends = env:BlueSCSI_RP2MCU
  132. board = rpipico2w
  133. ; How much flash in bytes the bootloader and main app will be allocated
  134. ; It is used as the starting point for a ROM image saved in flash
  135. ; Changing this will cause issues with boards that already have a ROM drive in flash
  136. program_flash_allocation = 589824
  137. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp23xx-template.ld
  138. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp23xx_btldr.ld
  139. build_flags =
  140. ${env:BlueSCSI_RP2MCU.build_flags}
  141. -DBLUESCSI_V2
  142. -DBLUESCSI_MCU_RP23XX
  143. -DBLUESCSI_PICO_2_DAYNAPORT
  144. -DBLUESCSI_NETWORK
  145. -DBLUESCSI_DAYNAPORT
  146. -DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
  147. -DROMDRIVE_OFFSET=${env:BlueSCSI_Pico_2_DaynaPORT.program_flash_allocation}