Problems using Winbond with Adafruit Feather

Started by FusibleAu, August 15, 2017, 10:32:08 PM

FusibleAu

I have several Moteinos and some Adafruit Feathers 32u4 with the RFM69 transceiver. I'd like to use the OTA updates, so I've hand soldered a Winbond chip up to the Feather on a breadboard.

Right now I'm testing with the "SPIFlash_ReadWrite" example code. The only difference is I'm using pin 5 on the Feather instead of D8. I'm using the Arduino 1.8.3 IDE. When I program the Moteino it works as expected and I get serial output says the test passed. When I program the Feather. It hangs at the line for "SPIFLASH flash(FLASH_SS, 0xEF30)" If I unplug and re-plug GND or VCC on the Winbond, it proceeds but the Init FAILS. I can get bits and pieces to "work", but it's all from unplugging and re-plugging the SS pin or GND and the values are just noise.

I've read through this forum and found this post yesterday
https://lowpowerlab.com/forum/general-topics/how-to-get-spiflash-library-to-work-on-a-clone-(answered)/30/

It seemed like my problem was similar. I gave the Arduino 1.0.6 IDE a shot, but after manually installing all the drivers and libraries I got an error that I could not solve:
"avrdude: error: buffered memory access not supported. Maybe it isn't a butterfly/AVR109 but a AVR910 device?"

I tried changing programmers, reinstalling, verifying the correct board was selected, removing all boards that weren't the Feather. So I went back to Arduino 1.8.3 for now.

I tried using the 1Mohm pulldown from D12 but got no luck.

I also soldered up another Winbond chip but nothing different.

And I tried lowering the clock speed of the SPI bus.
 
At this point, I don't know if the default bootloader could cause something like this, maybe how it works on SPI versus the DualOptiBoot?

Has anyone tried this configuration? I'd be very grateful for ideas and assistance.

Felix

Even if you get the chip to work with the feather, their bootloader won't support OTA as it does on Moteino, it's a completely different bootloader.
DualOptiboot was specifically designed to support the OTA updates after the new program has been dumped into the FLASH chip.
You cannot use Dualoptiboot on 32u4. Plus my guess is their bootloader is not "open source".

FusibleAu

Thanks Felix,

I know that I'll have to overwrite the Feather Bootloader with DualOptiboot. Before I do that I wanted to test only the flash memory chip.
I did a little research between the differences of the 32u4 and the 328p that the Moteino uses. Could you help me understand why DualOptiboot wouldn't work on the 32u4? From what I read, the 32u4 has everything the 328p has, but with a higher price.

Felix

The 32u4 requires a very different bootloader because it requires the USB stack to enumerate it as a serial device. If you're brave you could add the FLASH code to that bootloader, but as I said you'd have to get the bootloader source. Let me know how that goes :)
Dualoptiboot simply uses the UART of the 328p which does not have a USB device.