Hi PJ,
Really amazing help, I do appreciate it immensely.
To answer some of your questions, I’m sure I’m trying to use Sense units. I guess the question is, how do I know? I mean, they were supplied as sense units and have the MEMS microphone visible and I can read from the Accelerometer, but is there a separate/different bootloader between the versions or is it just extra hardware populated?
I tried and was successful updating the bootloader using you amazing example, worked really well but no change.
I am able to get into the bootloader and the UF2.txt files are identical to the example you provided on both batches.
Today, I’ve been trying to figure out a work around for the actual problem of my code not working on the ‘bad’ batch and have narrowed it down to an interesting observation at least…
It’s something to do with the external flash that I’m using.
On the ‘working units’, I define the FLASH connections like this:
SPIFlash_Device_t const P25Q16H{
.total_size = (1UL << 21), // 2MiB
.start_up_time_us = 10000, // Don't know where to find that value
.manufacturer_id = 0x85,
.memory_type = 0x60,
.capacity = 0x15,
.max_clock_speed_mhz = 55,
.quad_enable_bit_mask = 0x02, // Datasheet p. 27
.has_sector_protection = 1, // Datasheet p. 27
.supports_fast_read = 1, // Datasheet p. 29
.supports_qspi = 1, // Obviously
.supports_qspi_writes = 1, // Datasheet p. 41
.write_status_register_split = 1, // Datasheet p. 28
.single_status_byte = 0, // 2 bytes
.is_fram = 0, // Flash Memory
};
Adafruit_FlashTransport_QSPI flashTransport;
Adafruit_SPIFlash flash(&flashTransport);
And I can read/write the 2MB flash, erase it etc.
On the ‘bad’ units, I can call flash.erasechip() but it doesn’t seem to work (although doesn’t error). The FLASH is filled with 0x88. (working erases to 0xFF).
I can get the ‘bad’ units FLASH working using (maybe one of your examples?) this code:
SPIFlash_Device_t const P25Q16H{
.total_size = (1UL << 21), // 2MiB
.start_up_time_us = 10000, // Don't know where to find that value
.manufacturer_id = 0x85,
.memory_type = 0x60,
.capacity = 0x15,
.max_clock_speed_mhz = 55,
.quad_enable_bit_mask = 0x02, // Datasheet p. 27
.has_sector_protection = 1, // Datasheet p. 27
.supports_fast_read = 1, // Datasheet p. 29
.supports_qspi = 1, // Obviously
.supports_qspi_writes = 1, // Datasheet p. 41
.write_status_register_split = 1, // Datasheet p. 28
.single_status_byte = 0, // 2 bytes
.is_fram = 0, // Flash Memory
};
SPIClass SPI_2(NRF_SPIM0, PIN_QSPI_IO1, PIN_QSPI_SCK, PIN_QSPI_IO0); // Onboard QSPI Flash chip
Adafruit_FlashTransport_SPI flashTransport(PIN_QSPI_CS, SPI_2); // CS for QSPI Flash
Adafruit_SPIFlash flash(&flashTransport);
The only difference is the definition of the SPI pins etc. While I can now get the FLASH working on the ‘bad’ units, I’m having incompatibilities with my other libraries such as the sparkfun MCP9600 thermocouple that I’m using which is strange as this is an I2C device and shouldn’t conflict with the SPI of the FLASH.
Quite a frustrating challenge and as both batches were purchased a couple of weeks apart, I’m concerned long term. I think I need to get a workaround for both ‘versions’ and suspect that if I can get the thermocouple library working with the FLASH SPI definitions I might be in a good spot although I’m struggling to see the interdependency.
Really appreciate your help again!
James