Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upd #1

Merged
merged 76 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4be0fbf
Give access over USB MSC to (Q)SPI flash memory on Badge Edition
lyusupov Feb 6, 2021
8e2a3c6
new options to change settings of a Badge over USB: 1) Mass Storage, …
lyusupov Feb 8, 2021
ca78b70
fix of a build regression for Raspberry Pi
lyusupov Feb 8, 2021
f0fd2c2
Badge: BLE MIDI is doing good [skip ci]
lyusupov Feb 8, 2021
6e86b64
illustration of 'Mass Storage' method to change settings of a Badge […
lyusupov Feb 9, 2021
787ccaa
Simplified MIDI and Battery BLE services for ESP32 port [skip ci]
lyusupov Feb 9, 2021
3486ba3
one more option of audio transport for the Badge [skip ci]
lyusupov Feb 10, 2021
eabc497
SkyView EZ: fix against regression of 'Voice Alert' message [skip ci]
lyusupov Feb 10, 2021
ddd851b
SkyView Pi: fix against regression of 'Please wait' splash screen [sk…
lyusupov Feb 10, 2021
398ec04
Barometric sensor data EPD infopage for Badge
lyusupov Feb 11, 2021
8911852
nRF52 build fix
lyusupov Feb 11, 2021
c1ea6a4
SkyView: improved voice alerts logic [skip ci]
lyusupov Feb 11, 2021
47c1c39
Firmware binary 0.11 for SkyView EZ is out [skip ci]
lyusupov Feb 12, 2021
277a587
cosmetic README update [skip ci]
lyusupov Feb 12, 2021
dfca93a
fix against no access to settings when GNSS NMEA is off
lyusupov Feb 13, 2021
edaf81b
value of temperature has been added into LK8EX1 sentence
lyusupov Feb 13, 2021
9abf34d
show NA on OLED when battery voltage value is not available
lyusupov Feb 13, 2021
33c3370
cross-platform settings extension added
lyusupov Feb 13, 2021
66c5778
Badge: BLE Nordic Uart Service has been made optional
lyusupov Feb 14, 2021
88c3227
HIGH level of GPIO7 deactivates battery voltage monitor of Mini [skip…
lyusupov Feb 14, 2021
e519845
make use of Badge blue LED to indicate BLE connection status [skip ci]
lyusupov Feb 15, 2021
4238a09
one more (optional) 0.96" I2C OLED infopage [skip ci]
lyusupov Feb 15, 2021
f57714c
Badge: default h/w board setting is REV_2 [skip ci]
lyusupov Feb 19, 2021
42d8e1e
Badge: E-paper screens cosmetic
lyusupov Feb 20, 2021
d6f2b8d
fix agains regression of build for Raspberry Edition
lyusupov Feb 20, 2021
4e2e937
further improvements of the Badge UI [skip ci]
lyusupov Feb 21, 2021
db758f1
update of the Badge firmware binaries [skip ci]
lyusupov Feb 22, 2021
56e2950
update of AXP192/202 PMU library [skip ci]
lyusupov Feb 27, 2021
9a484f7
SkyView: initial bringup of LilyGO T5 4.7 inch e-Paper display board …
lyusupov Feb 27, 2021
f3a8910
ESP32: transition onto Arduino Core 1.0.5
lyusupov Mar 7, 2021
8187786
update of Travis CI script
lyusupov Mar 7, 2021
611c70d
fix against regression of SkyWatch build
lyusupov Mar 7, 2021
32d2c72
Mini: anticipating appearance of htcc-ab02s-v2 with Air530Z [skip ci]
lyusupov Mar 8, 2021
2fc2b88
SoftRF: enabling of two functions from ESP32 'on hold' list [skip ci]
lyusupov Mar 8, 2021
b7c5067
SoftRF: update of post-init procedure
lyusupov Mar 8, 2021
ff6a085
SkyView EZ: maintenance release 0.12 [skip ci]
lyusupov Mar 8, 2021
0ffddcc
SoftRF: low level sound layer
lyusupov Mar 9, 2021
c6468bd
logic of sound alert
lyusupov Mar 11, 2021
70344f2
new features freeze before release
lyusupov Mar 11, 2021
e9b1abb
ESP32: buzzer volume fix [skip ci]
lyusupov Mar 12, 2021
c4ef24d
More credits to developers of libraries [skip ci]
lyusupov Mar 12, 2021
2e3ac3a
ESP8266: fix against regression of UAV mode ( #99 ) [skip ci]
lyusupov Mar 12, 2021
a22a5e1
clean-up of Battery API
lyusupov Mar 15, 2021
50a4770
SkyView: misc. update of 0.12 firmware binary [skip ci]
lyusupov Mar 15, 2021
c5b3fbb
Current state is good enough to qualify it as 1.0-RC9
lyusupov Mar 15, 2021
7c66f82
RC9 firmware binaries for ESP8266, ESP32, ASR6502 and nRF52840 [skip ci]
lyusupov Mar 15, 2021
40b22e1
RC9 firmware binaries for Dongle (S76G) and Uni (CC1352) Editions [sk…
lyusupov Mar 16, 2021
b14a1c4
Uni and Mini: PFLAU NMEA sentence extension is back on [skip ci]
lyusupov Mar 20, 2021
4e5da59
give some space for other nRF52 firmware binaries [skip ci]
lyusupov Mar 31, 2021
dd5f9c3
few files for nRF52 port of iLogger (Flight Recorder) [skip ci]
lyusupov Mar 31, 2021
d914d6e
rest of files for iLogger port onto nRF52 plarform [skip ci]
lyusupov Mar 31, 2021
3a4d784
UF2 binary of CircuitPython6 interpreter for LilyGO T-Echo - 'QSPI fl…
lyusupov Mar 31, 2021
123b99e
misc. update of one Mini illustration [skip ci]
lyusupov Apr 4, 2021
2cba567
update of status gen. URL [skip ci]
lyusupov Apr 5, 2021
1c962ed
update of reference on multiple units usage guidance [skip ci]
lyusupov Apr 5, 2021
8437f20
iLogger: GNSS and air pressure sensors has been sorted out [skip ci]
lyusupov Apr 7, 2021
692344f
update of the Badge enclosure: 1) base frame [skip ci]
lyusupov Apr 7, 2021
3ae5a08
update of the Badge enclosure: 2) front [skip ci]
lyusupov Apr 7, 2021
25070bd
update of Badge illustrations [skip ci]
lyusupov Apr 8, 2021
9eab924
two more illustrations of the Badge [skip ci]
lyusupov Apr 8, 2021
e2db565
update of the Badge enclosure page [skip ci]
lyusupov Apr 8, 2021
f7e0cab
RF loopback detector
lyusupov Apr 9, 2021
55432da
SoftRF: update of RC9 firmware binaries for ESP32 and ASR6502 [skip ci]
lyusupov Apr 10, 2021
6ec2653
nRF52: SoftSPI library is no longer in use [skip ci]
lyusupov Apr 10, 2021
54bf4e1
XCSoar7 preview binaries are no longer in use [skip ci]
lyusupov Apr 10, 2021
0f47b9e
few more illustrations for Badge wiki [skip ci]
lyusupov Apr 10, 2021
80812ac
misc. update of RC9 binaries for S76G [skip ci]
lyusupov Apr 12, 2021
54e0afb
one more power saving option added
lyusupov Apr 12, 2021
065660a
space allocation for 0.49" OLED driver
lyusupov Apr 12, 2021
0a18e4d
T-Echo REV2 bringup quirks [skip ci]
lyusupov Apr 13, 2021
5cf3eab
low power sleep for T-Echo REV_2 [skip ci]
lyusupov Apr 13, 2021
504e92a
T-Echo sleep current is reduced down to 150uA. Thank you for the tip,…
lyusupov Apr 13, 2021
79c2735
Badge: default traffic ID info is the aircraft type [skip ci]
lyusupov Apr 15, 2021
14b40b3
Badge: minor update of the UTC clock logic [skip ci]
lyusupov Apr 15, 2021
cd190ef
Badge: fix for UTC clock 'cosmetic' issue [skip ci]
lyusupov Apr 15, 2021
0a092db
update of RC9 firmware binaries for nRF52 platform [skip ci]
lyusupov Apr 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nRF52: SoftSPI library is no longer in use [skip ci]
  • Loading branch information
lyusupov committed Apr 10, 2021
commit 6ec26536e8b5ff9185550bbc2e11d7b5ae61ce48
1 change: 0 additions & 1 deletion software/firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* Arduino Core for nRF52 and TinyUSB library are developed by **Ha Thach**
* Arduino-NVM library is developed by **Frank Holtz**
* U8g2 fonts for Adafruit GFX are developed by **Oliver Kraus**
* SoftSPI library is developed by **Matt Jenkins**
* Adafruit SPIFlash and SleepyDog libraries are developed by **Adafruit Industries**
* SdFat library is developed by **Bill Greiman**
* Arduino MIDI library is developed by **Francois Best**
1 change: 0 additions & 1 deletion software/firmware/source/SoftRF/SoftRF.ino
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
* GxEPD2 library is developed by Jean-Marc Zingg
* Adafruit GFX library is developed by Adafruit Industries
* U8g2 fonts for Adafruit GFX are developed by Oliver Kraus
* SoftSPI library is developed by Matt Jenkins
* Adafruit SPIFlash and SleepyDog libraries are developed by Adafruit Industries
* SdFat library is developed by Bill Greiman
* Arduino MIDI library is developed by Francois Best (Forty Seven Effects)
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/driver/Bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ void nRF52_Bluetooth_setup()
bledis.setManufacturer("SoftRF");
bledis.setModel("Badge Edition");
bledis.setHardwareRev(hw_info.revision == 0 ? "2020-8-6" :
hw_info.revision == 1 ? "2020-12-12" : "2021-1-15");
hw_info.revision == 1 ? "2020-12-12" : "2021-3-16");
bledis.setSoftwareRev(SOFTRF_FIRMWARE_VERSION);
bledis.begin();

Expand Down
90 changes: 59 additions & 31 deletions software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <SPI.h>
#include <Wire.h>
#include <pcf8563.h>
#include <SoftSPI.h>
#include <Adafruit_SPIFlash.h>
#include "Adafruit_TinyUSB.h"
#include <Adafruit_SleepyDog.h>
Expand Down Expand Up @@ -131,45 +130,52 @@ GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> epd_ttgo_techo(GxEPD2_154_D67(
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> *display;
#endif /* USE_EPAPER */

SoftSPI SPI2(SOC_GPIO_PIN_SFL_MOSI, SOC_GPIO_PIN_SFL_MISO, SOC_GPIO_PIN_SFL_SCK);

Adafruit_FlashTransport_SPI SWFlashTransport (SOC_GPIO_PIN_SFL_SS, &SPI2);
Adafruit_FlashTransport_QSPI HWFlashTransport(SOC_GPIO_PIN_SFL_SCK,
SOC_GPIO_PIN_SFL_SS,
SOC_GPIO_PIN_SFL_MOSI,
SOC_GPIO_PIN_SFL_MISO,
SOC_GPIO_PIN_SFL_WP,
SOC_GPIO_PIN_SFL_HOLD);

Adafruit_SPIFlash SoftSPIFlash(&SWFlashTransport);
Adafruit_SPIFlash QSPIFlash (&HWFlashTransport);
Adafruit_SPIFlash QSPIFlash (&HWFlashTransport);

static Adafruit_SPIFlash *SPIFlash = NULL;

#define MX25R1635F \
{ \
.total_size = (1 << 21), /* 2 MiB */ \
.start_up_time_us = 5000, .manufacturer_id = 0xc2, \
.memory_type = 0x28, .capacity = 0x15, .max_clock_speed_mhz = 8, \
.quad_enable_bit_mask = 0x40, .has_sector_protection = false, \
.supports_fast_read = true, .supports_qspi = true, \
.supports_qspi_writes = true, .write_status_register_split = false, \
.single_status_byte = true, .is_fram = false, \
}
// Settings for the Macronix MX25R1635F 2MiB SPI flash.
// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F,%20Wide%20Range,%2016Mb,%20v1.6.pdf
// In low power mode, quad operations can only run at 8 MHz. In high power mode it can do 80 MHz.
#define MX25R1635F_DESC { \
.total_size = (1 << 21), /* 2 MiB */ \
.start_up_time_us = 800, \
.manufacturer_id = 0xc2, \
.memory_type = 0x28, \
.capacity = 0x15, \
.max_clock_speed_mhz = 8, /* 33 MHz for 1-bit operations */ \
.quad_enable_bit_mask = 0x40, \
.has_sector_protection = false, \
.supports_fast_read = true, \
.supports_qspi = true, \
.supports_qspi_writes = true, \
.write_status_register_split = false, \
.single_status_byte = true, \
.is_fram = false, \
}

/// List of all possible flash devices used by nRF52840 boards
static const SPIFlash_Device_t possible_devices[] = {
// LilyGO T-Echo
MX25R1635F,
#define SFLASH_CMD_READ_CONFIG 0x15

// Nordic PCA10056
MX25R6435F,
};
static uint32_t spiflash_id = 0;
static uint8_t mx25_status_config[3] = {0x00, 0x00, 0x00};

/// Flash device list count
enum {
EXTERNAL_FLASH_DEVICE_COUNT =
sizeof(possible_devices) / sizeof(possible_devices[0])
MX25R1635F,
EXTERNAL_FLASH_DEVICE_COUNT
};

/// List of all possible flash devices used by nRF52840 boards
static SPIFlash_Device_t possible_devices[] = {
// LilyGO T-Echo
[MX25R1635F] = MX25R1635F_DESC,
};

// USB Mass Storage object
Expand Down Expand Up @@ -408,7 +414,10 @@ static void nRF52_setup()
switch (nRF52_board)
{
case NRF52_LILYGO_TECHO_REV_0:
SPIFlash = &SoftSPIFlash;
possible_devices[0].max_clock_speed_mhz = 33;
possible_devices[0].supports_qspi = false;
possible_devices[0].supports_qspi_writes = false;
SPIFlash = &QSPIFlash;
break;
case NRF52_LILYGO_TECHO_REV_1:
case NRF52_LILYGO_TECHO_REV_2:
Expand All @@ -424,9 +433,20 @@ static void nRF52_setup()
EXTERNAL_FLASH_DEVICE_COUNT);
}

/* SoftSPI on REV_0 is slow which causes the system crash in main loop */
if (nRF52_has_spiflash && (nRF52_board != NRF52_LILYGO_TECHO_REV_0)) {
uint32_t spi_flash_id = SPIFlash->getJEDECID();
spiflash_id = SPIFlash->getJEDECID();

//mx25_status_config[0] = SPIFlash->readStatus();
//HWFlashTransport.readCommand(SFLASH_CMD_READ_CONFIG, mx25_status_config + 1, 2);
//mx25_status_config[2] |= 0x2; /* High performance mode */
//SPIFlash->writeEnable();
//HWFlashTransport.writeCommand(SFLASH_CMD_WRITE_STATUS, mx25_status_config, 3);
//SPIFlash->writeDisable();
//SPIFlash->waitUntilReady();

//uint32_t const wr_speed = min(80 * 1000000U, (uint32_t)F_CPU);
//uint32_t rd_speed = wr_speed;
//HWFlashTransport.setClockSpeed(wr_speed, rd_speed);

// Set disk vendor id, product id and revision with string up to 8, 16, 4 characters respectively
usb_msc.setID("SoftRF", "External Flash", "1.0");
Expand Down Expand Up @@ -457,6 +477,15 @@ static void nRF52_post_init()
if (nRF52_board == NRF52_LILYGO_TECHO_REV_0 ||
nRF52_board == NRF52_LILYGO_TECHO_REV_1 ||
nRF52_board == NRF52_LILYGO_TECHO_REV_2) {

Serial.println();
Serial.print (F("SPI FLASH JEDEC ID: "));
Serial.print (spiflash_id, HEX); Serial.print(" ");
Serial.print (F("STATUS/CONFIG: "));
Serial.print (mx25_status_config[0], HEX); Serial.print(" ");
Serial.print (mx25_status_config[1], HEX); Serial.print(" ");
Serial.print (mx25_status_config[2], HEX); Serial.println();

Serial.println();
Serial.print (F("LilyGO T-Echo (rev."));
Serial.print (hw_info.revision);
Expand Down Expand Up @@ -605,7 +634,7 @@ static void nRF52_fini(int reason)
{
uint8_t sd_en;

// if (nRF52_has_spiflash && (nRF52_board != NRF52_LILYGO_TECHO_REV_0)) {
// if (nRF52_has_spiflash) {
// usb_msc.end();
// }
// if (SPIFlash != NULL) SPIFlash->end();
Expand Down Expand Up @@ -636,7 +665,6 @@ static void nRF52_fini(int reason)
pinMode(SOC_GPIO_LED_TECHO_REV_0_BLUE, INPUT);

pinMode(SOC_GPIO_PIN_IO_PWR, INPUT);
SPI2.end(); /* SoftSPI */
pinMode(SOC_GPIO_PIN_SFL_SS, INPUT);
break;

Expand Down Expand Up @@ -899,7 +927,7 @@ static void nRF52_EEPROM_extension()
if ( nRF52_has_spiflash &&
(nRF52_board != NRF52_LILYGO_TECHO_REV_0) &&
fatfs.begin(SPIFlash)) {
File file = fatfs.open("/settings.txt", FILE_READ);
File file = fatfs.open("/settings.json", FILE_READ);

if (file) {
// StaticJsonBuffer<NRF52_JSON_BUFFER_SIZE> nRF52_jsonBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "Adafruit_FlashTransport.h"

Adafruit_FlashTransport_SPI::Adafruit_FlashTransport_SPI(
uint8_t ss, SoftSPI *spiinterface) {
uint8_t ss, SPIClass *spiinterface) {
_cmd_read = SFLASH_CMD_READ;
_addr_len = 3; // work with most device if not set
_ss = ss;
Expand All @@ -34,7 +34,7 @@ Adafruit_FlashTransport_SPI::Adafruit_FlashTransport_SPI(
}

Adafruit_FlashTransport_SPI::Adafruit_FlashTransport_SPI(uint8_t ss,
SoftSPI &spiinterface)
SPIClass &spiinterface)
: Adafruit_FlashTransport_SPI(ss, &spiinterface) {}

void Adafruit_FlashTransport_SPI::begin(void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
#define ADAFRUIT_FLASHTRANSPORT_SPI_H_

#include "Arduino.h"
#include "SoftSPI.h"
#include "SPI.h"

class Adafruit_FlashTransport_SPI : public Adafruit_FlashTransport {
private:
SoftSPI *_spi;
SPIClass *_spi;
uint8_t _ss;

// SAMD21 M0 can write up to 24 Mhz, but can only read reliably with 12 MHz
uint32_t _clock_wr;
uint32_t _clock_rd;

public:
Adafruit_FlashTransport_SPI(uint8_t ss, SoftSPI *spiinterface);
Adafruit_FlashTransport_SPI(uint8_t ss, SoftSPI &spiinterface);
Adafruit_FlashTransport_SPI(uint8_t ss, SPIClass *spiinterface);
Adafruit_FlashTransport_SPI(uint8_t ss, SPIClass &spiinterface);

virtual void begin(void);

Expand Down