Author Topic: How to get SPIFlash Library to work on a clone? [ANSWERED]  (Read 7385 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: How to get SPIFlash Library to work on a clone? [ANSWERED]
« Reply #30 on: March 19, 2016, 09:16:29 AM »
Now digging out the actual reason will probably need a look at the generated code in combination with monitoring the SPI traffic.

I concur.  The error seems like it's compiler related.

We know from a different thread that the Arduino.cc folks monkeyed with the GCC compiler optimization settings in some of the recent IDE releases, resulting in previously functional sleep code becoming dysfunctional.  There the solution was to turn-off compiler optimizations using compiler directives embedded with the relevant code. 

I have run into a GCC compiler problem on one prior occasion that was unrelated to all of this (a local variable wasn't getting initialized to the value that the c-code clearly meant it to be).

Is there a better compiler that anyone here is using?  I was disappointed to find out that even Visual Studio (as well as a number of other Arduino IDE "alternatives") uses GCC.
« Last Edit: March 19, 2016, 12:50:35 PM by WhiteHare »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: How to get SPIFlash Library to work on a clone? [ANSWERED]
« Reply #31 on: March 20, 2016, 02:30:13 PM »
Good news!  If I build using the Arduino IDE 1.0.6, then I no longer need to use a DTR-to-GND connection on my Moteino R4 when it's utilizing flash memory and when powered by battery-only (no FTDI).   ;D

So, although this started out as a thread on clone use of flash memory, the information gained is turning out to be highly beneficial in my use of Moteino R4's.  8)  By the way, the R4 continues to be my preferred wireless platform.   :)

[Edit: I do, however, still need the megaohm pulldown resistor on D12 if I am to wake-up the flash memory after explicitly putting the flash memory to sleep.  Without the pulldown, even if the R4 firmware is built using IDE 1.0.6, the result is still in a hang when trying to wake the flash memory.   :(  The unit I tested is an R4 running direct from two AA batteries and with the stock LDO voltage regulator removed.]
« Last Edit: March 20, 2016, 04:10:31 PM by WhiteHare »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: How to get SPIFlash Library to work on a clone? [ANSWERED]
« Reply #32 on: April 07, 2016, 02:47:38 PM »
Arduino 1.0.6 shipped with avr-gcc version 4.3.2 and AVR-Libc 1.6.4, and Arduino 1.6.0 ships with avr-gcc version 4.8.1 and AVR-Libc 1.8.0.  So, maybe that has something to do with it.  I'd much prefer to run the current Arduino IDE than an old one.

dzubey

  • Newbie
  • *
  • Posts: 5
Re: How to get SPIFlash Library to work on a clone? [ANSWERED]
« Reply #33 on: March 03, 2017, 06:40:43 PM »
Wanted to 'me too' this issue.

I have about 30 motinos that started out working great, then after a few software revisions in the last 3 years, I can no longer power them with a non-ftdi connector, where they are not reset on boot. Indeed backing down to 1.0.6 showed more promise. I can't go live with that version however. It's a deal breaker.

They *do* start up on battery power regularly when i touch them with my finger, so that suggests a capacitance issue.

I tried various bypass capacitance values connected between DTR and ground, and no go at all. Pulling it down to ground also doesn't work reliably. I'm going to try a 1M to ground, see what that does, but really need these motinos to work out-of-the box with the newest (or reasonably new) software. I would like to scale this project up by a factor of 3 or 4 soon here.

Can anyone give any further information on what they've found since last update?