platformio.ini 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ; PlatformIO Project Configuration File https://docs.platformio.org/page/projectconf.html
  2. [platformio]
  3. default_envs = BlueSCSI_Pico_DaynaPORT, 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#6164ed92d83c1241a1d84ad848158d7b0fb486e3
  12. platform_packages =
  13. framework-arduinopico@https://github.com/BlueSCSI/arduino-pico-internal.git#v4.7.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. program_flash_allocation = 1273856
  21. lib_deps =
  22. SdFat=https://github.com/BlueSCSI/SdFat#2.2.3-gpt-exfat
  23. minIni
  24. SCSI2SD
  25. ; When updating git tag for CUEParser here, also update lib\BlueSCSI_platform_RP2MCU\library.json
  26. CUEParser=https://github.com/BlueSCSI/CUEParser#v2025.02.25
  27. BlueSCSI_platform_RP2MCU
  28. upload_protocol = cmsis-dap
  29. debug_tool = cmsis-dap
  30. debug_build_flags =
  31. -O2 -ggdb -g3
  32. build_flags =
  33. ${env.build_flags}
  34. -O2 -Isrc -ggdb -g3
  35. -Wall -Wno-sign-compare -Wno-ignored-qualifiers -Wno-overloaded-virtual
  36. -DSPI_DRIVER_SELECT=3
  37. -DSD_CHIP_SELECT_MODE=2
  38. -DENABLE_DEDICATED_SPI=1
  39. -DHAS_SDIO_CLASS
  40. -DUSE_ARDUINO=1
  41. -DPICO_FLASH_SPI_CLKDIV=2
  42. -DPLATFORM_MASS_STORAGE
  43. -DFILE_COPY_CONSTRUCTOR_SELECT=FILE_COPY_CONSTRUCTOR_PUBLIC
  44. -DDISABLE_FS_H_WARNING
  45. -DRECLOCKING_SUPPORTED
  46. -DPLATFORM_HAS_INITIATOR_MODE
  47. ; SWO detection handled at runtime
  48. -DDISABLE_SWO
  49. ; build flags mirroring the "framework-arduinopico#x.x.x-DaynaPORT" static library build
  50. -DPICO_CYW43_ARCH_POLL=1
  51. -DCYW43_PIN_WL_DYNAMIC=1
  52. -DCYW43_LWIP=0
  53. -DCYW43_USE_OTP_MAC=0
  54. -DROMDRIVE_OFFSET=${env:BlueSCSI_RP2MCU.program_flash_allocation}
  55. ; Variant of RP2040 platform, based on Raspberry Pico board and a carrier PCB
  56. ; Part of the BlueSCSI_RP2040 platform, but with different pins.
  57. [env:BlueSCSI_Pico]
  58. extends = env:BlueSCSI_RP2MCU
  59. board = rpipico
  60. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp2040-template.ld
  61. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp2040_btldr.ld
  62. build_flags =
  63. ${env:BlueSCSI_RP2MCU.build_flags}
  64. -DBLUESCSI_V2
  65. -DBLUESCSI_MCU_RP20XX
  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. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp2040-template.ld
  82. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp2040_btldr.ld
  83. debug_build_flags =
  84. ${env:BlueSCSI_RP2MCU.debug_build_flags}
  85. -DLOGBUFSIZE=4096
  86. -DPREFETCH_BUFFER_SIZE=0
  87. -DSCSI2SD_BUFFER_SIZE=57344
  88. ; This controls the depth NETWORK_PACKET_MAX_SIZE (1520 bytes)
  89. ; For example a queue size of 10 would be 10 x 1520 = 30400 bytes
  90. -DNETWORK_PACKET_QUEUE_SIZE=8
  91. ; This flag enables verbose logging of TCP/IP traffic and other information
  92. ; it also takes up a bit of SRAM so it should be disabled with production code
  93. -DNETWORK_DEBUG_LOGGING
  94. build_flags =
  95. ${env:BlueSCSI_RP2MCU.build_flags}
  96. -DBLUESCSI_V2
  97. -DBLUESCSI_MCU_RP20XX
  98. -DBLUESCSI_NETWORK
  99. -DBLUESCSI_DAYNAPORT
  100. -DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
  101. ; These take a large portion of the SRAM and can be adjusted
  102. -DLOGBUFSIZE=2048
  103. -DPREFETCH_BUFFER_SIZE=4608
  104. -DSCSI2SD_BUFFER_SIZE=57344
  105. ; This controls the depth of NETWORK_PACKET_MAX_SIZE (1520 bytes)
  106. ; For example a queue size of 10 would be 10 x 1520 = 15200 bytes
  107. -DNETWORK_PACKET_QUEUE_SIZE=14
  108. ; This flag enables verbose logging of TCP/IP traffic and other information
  109. ; it also takes up a bit of SRAM so it should be disabled with production code
  110. ; -DNETWORK_DEBUG_LOGGING
  111. ; BlueSCSI Pico2 hardware platform, based on the Raspberry Pi foundation RP2350A microcontroller
  112. [env:BlueSCSI_Pico_2]
  113. extends = env:BlueSCSI_RP2MCU
  114. board = rpipico2
  115. ; How much flash in bytes the bootloader and main app will be allocated
  116. ; It is used as the starting point for a ROM image saved in flash
  117. ; Changing this will cause issues with boards that already have a ROM drive in flash
  118. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp23xx-template.ld
  119. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp23xx_btldr.ld
  120. debug_build_flags =
  121. ${env:BlueSCSI_RP2MCU.debug_build_flags}
  122. build_flags =
  123. ${env:BlueSCSI_RP2MCU.build_flags}
  124. -DBLUESCSI_V2
  125. -DBLUESCSI_MCU_RP23XX
  126. [env:BlueSCSI_Pico_2_DaynaPORT]
  127. extends = env:BlueSCSI_RP2MCU
  128. board = rpipico2w
  129. ; How much flash in bytes the bootloader and main app will be allocated
  130. ; It is used as the starting point for a ROM image saved in flash
  131. ; Changing this will cause issues with boards that already have a ROM drive in flash
  132. linker_script_template = lib/BlueSCSI_platform_RP2MCU/rp23xx-template.ld
  133. ldscript_bootloader = lib/BlueSCSI_platform_RP2MCU/rp23xx_btldr.ld
  134. build_flags =
  135. ${env:BlueSCSI_RP2MCU.build_flags}
  136. -DBLUESCSI_V2
  137. -DBLUESCSI_MCU_RP23XX
  138. -DBLUESCSI_PICO_2_DAYNAPORT
  139. -DBLUESCSI_NETWORK
  140. -DBLUESCSI_DAYNAPORT
  141. -DCYW43_PIO_CLOCK_DIV_DYNAMIC=1