mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-11 15:40:48 +00:00

* First attempt to adding hardware support for NRF52 SPI SD Card using arduino SD library My first time contributing to an open source project so not very confident in what i'm doing. Changes to FSCommon: initializing SD library for NRF52. Progress: No compile error, but SD card does not get initialized properly yet added ifdef ARCH_ESP32 conditions around esp32 SD library functions memget: added ifdef conditional statements StoreForwardModule.cpp: added ifdef conditional statements Rak4631 platfromIO.ini and variant.h: added arduino-libraries/SD@^1.3.0 library to libdeps defined HAS_SDCARD and SPI pins Arduino SD library. Made changes to library because using namespace SDLIB in header file caused ambiguity problems Not sure this is the right way of adding a library, also, how do i implement changes to the library permanently to the project? Am I going somewhat in the right direction with these changes? Tell me your thoughts, thanks * replaced arduino SD library to custom fork. A "using namespace" statement in the header file was to messy to work around. NRF52 SD card initialisation added * updated library reference added card size and type function to SD library added populateSDCard for NRF52 * Changed NRF52 SD object from SDFilesystem to SD Changed NRF52 SD object from SDFilesystem to SD for more compatibility with esp32 SD library. Some functions are still different but most used open, read, write and close are the same. * Removed duplicate ESP32/NRF52 SD card access code Mainly made changes to the custom arduino SD library to make it compatible with the esp32 SD library already used in the store and forward code. With these compatible function names and return, I removed some duplicate code. * trunk fmt and pin SD library to commit hash * print this out on ESP32 anyway --------- Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
56 lines
2.7 KiB
INI
56 lines
2.7 KiB
INI
; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921
|
|
[env:rak4631]
|
|
extends = nrf52840_base
|
|
board = wiscore_rak4631
|
|
board_check = true
|
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631
|
|
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
|
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
|
-DEINK_WIDTH=250
|
|
-DEINK_HEIGHT=122
|
|
-DRADIOLIB_EXCLUDE_SX128X=1
|
|
-DRADIOLIB_EXCLUDE_SX127X=1
|
|
-DRADIOLIB_EXCLUDE_LR11X0=1
|
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
|
lib_deps =
|
|
${nrf52840_base.lib_deps}
|
|
${networking_base.lib_deps}
|
|
melopero/Melopero RV3028@^1.1.0
|
|
https://github.com/RAKWireless/RAK13800-W5100S.git#1.0.2
|
|
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
|
|
https://github.com/RAKWireless/RAK12034-BMX160.git#dcead07ffa267d3c906e9ca4a1330ab989e957e2
|
|
https://github.com/Woutvstk/arduino_SD.git#909c2a4a14f5b053bb69958709f0c874aa358c38 ;library to acces SD card
|
|
|
|
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
|
; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds
|
|
;upload_protocol = jlink
|
|
|
|
; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!)
|
|
; programming time is about the same as the bootloader version.
|
|
; For information on this see the meshtastic developers documentation for "Development on the NRF52"
|
|
[env:rak4631_dbg]
|
|
extends = env:rak4631
|
|
board_level = extra
|
|
|
|
; if the builtin version of openocd has a buggy version of semihosting, so use the external version
|
|
; platform_packages = platformio/tool-openocd@^3.1200.0
|
|
|
|
build_flags =
|
|
${env:rak4631.build_flags}
|
|
-D USE_SEMIHOSTING
|
|
|
|
lib_deps =
|
|
${env:rak4631.lib_deps}
|
|
https://github.com/geeksville/Armduino-Semihosting.git#35b538fdf208c3530c1434cd099a08e486672ee4
|
|
|
|
; NOTE: the pyocd support for semihosting is buggy. So I switched to using the builtin platformio support for the stlink adapter which worked much better.
|
|
; However the built in openocd version in platformio has buggy support for TCP to semihosting.
|
|
;
|
|
; So I'm now trying the external openocd - but the openocd scripts for nrf52.cfg assume you are using a DAP adapter not an STLINK adapter.
|
|
; In theory I could change those scripts. But for now I'm trying going back to a DAP adapter but with the external openocd.
|
|
|
|
upload_protocol = stlink
|
|
; eventually use platformio/tool-pyocd@^2.3600.0 instad
|
|
;upload_protocol = custom
|
|
;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE |