SPI Flash MEM FAIL [solved]

Started by ababak, May 01, 2017, 03:05:09 PM

ababak

Hi,

The MightyHat worked fine until I tried to program it from Pi (I used a patched avrdude as explained in mightyhat programming guide). Programming was not successfull (it didn't even start after 10 unsuccessful attempts) but now the LCD is blank and the console shows:
Listening @ 433mhz...
SPI Flash MEM FAIL!
RFM69_ATC Enabled (Auto Transmission Control)
Free RAM bytes: 681


I tried reprogramming it via FTDI but even with a simple SPIFlash example I get "Start...Init FAIL!" now.

For me it looks unusable. Anything else I can try before giving up?

Thanks.

Regards,
Andrey

Felix

Chips don't just die from programming :)

Programming failed ... how? Do you have a log or recollection of the errors?
Did you ensure the GPIO serial is not used by anything else?
Did you also make the modifications to add a DTR connection to reset the MHat before programming?

Assuming you did all that, and that the HEX you generated is for the Moteino or MightyHat (both will work the same), I would suggest program via FTDI with the stock sketch.
That has the proper settings. The flash should be initialized with:

SPIFlash flash(FLASH_CS, 0xEF30);

ababak

#2
Avrdude programming just didn't even start. It tried to connect to MightyHat, did 10 attempts all failed. I stopped the gateway service before starting avrdude so the serial shouldn't be used.
Probably it was not the reason but after that the screen became blank.

Yes, I tried reprogramming it with the MightyHat.ino and SPIFlash_ReadWrite.ino via FTDI. Both sketches showed the same SPIFlash init error.

Today I tried once more and at first it looked like it self-cured itself over night. The screen was working again but the script was showing "Forced shutdown" and when connected to Pi it actually did that (no hot-plugging of course). Then I tried to record a video but now the screen was blank:



Then there was something weird happening:



And something more close to normal operation but still with glitches:



Now it behaves like on the first video, just the blank screen. The serial shows this:
Listening @ 433mhz...
SPI Flash Init OK!
RFM69_ATC Enabled (Auto Transmission Control)
Free RAM bytes: 681


I checked all the soldered contacts with the magnifying glass but haven't found anything suspicious. Is there anything else I can try?

Thanks,
Andrey

Edit:
P.S. Just in case. When assembling I couldn't find any information about the capacitor but as it was included in the kit and there was a place for it on the board, I assumed it should be there and soldered it in.

Felix

Quote from: ababak on May 02, 2017, 07:53:49 AM
Today I tried once more and at first it looked like it self-cured itself over night.

Sounds like voodoo not like electronics :)

Ok back to the real world, the board does what the code tells it to, if and only if the soldering and connections are solid.

You are not powering the board either by uUSB or battery ... so obviously it won't do anything when you press the power button.
The FTDI can only power the AVR and program it, not the entire board.

The screen behavior looks like a faulty connection or perhaps a faulty screen, but if it ever did work then I would check the connections.

Otherwise I would be more than happy to look at your board if you want to return it.
Although all are passed through 2 sets of tests, one for the hardware one for the avr/radio.


ababak

Yes, a bit strange))

Here's the latest video. It looks almost alive. I am not sure if it should initiate a shutdown though.


Five minutes later it shows garbage again. It looks like the more it stays on, the worse it behaves. When it has some rest it feels better but still not enough unfortunately.

I tried it with Pi attached and it forces Pi shutdown a moment after it says "Pi is on". The power button doesn't do anything after Pi is off.


I checked the connections once again, cleaning around all the soldering points under magnifying glass but that didn't help. I am still getting some garbage and forced Pi shutdown.

This i pretty weird as it worked fine yesterday.

I am using the MightyHat.ino sketch with small changes:
#define FREQUENCY     RF69_433MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY     RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY_EXACT 917000000 //uncomment and set to a specific frequency in Hz, if commented the center frequency is used
#define ENCRYPTKEY    "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW_HCW  //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!


If there's nothing I can test at my side I'll be glad if you could have a look.

Thank you.

Regards,
Andrey

ababak

One more note: I am not sure if it's relevant, I noticed that "Chrg" led is shimmering in yellow while "Boost" led is constant green.

The board is powered from USB.

Felix

Quote from: ababak on May 02, 2017, 11:15:30 AM
One more note: I am not sure if it's relevant, I noticed that "Chrg" led is shimmering in yellow while "Boost" led is constant green.
The board is powered from USB.
That's because there is no battery, normally one should be connected. But otherwise that is OK.
I suspect something is wrong with the button. It automatically powers up the board and turns ON, which it should not.

For the LCD - did you tie up the metal tabs which hold it against the PCB? That is often a problem and can result in the artifacts which you see on the screen. How to do that is mentioned on the assembly step in the guide.

If you can take a high resolution photo of the top and bottom and post it here that helps trying to determine if anything is wrong with the soldering.
Otherwise if you want to return it for service I can do that for you. If something is indeed wrong with the board I will replace or repair and return it at no cost to you.

ababak

QuoteI suspect something is wrong with the button. It automatically powers up the board and turns ON, which it should not.
Yes, I tried to insert some debugging code into handlePowerControl():
void handlePowerControl() {
    byte reading = digitalRead(BUTTON);
    DEBUG(F("reading: "));DEBUGln(reading);
    return;
and digitalRead(BUTTON) always returns 0 no matter if the button is pressed or not. I'll try to desolder the button to test it alone. Or can I test it in place?

QuoteFor the LCD - did you tie up the metal tabs which hold it against the PCB? That is often a problem and can result in the artifacts which you see on the screen. How to do that is mentioned on the assembly step in the guide.
I tied them a bit but they were pretty tight in the first place.


Felix

You can use continuity meter on your DDM to check the button.
Perhaps there is a short to GND. The BUTTON is tied to pin A2 (digital pin 16), it is setup using:

pinMode(BUTTON, INPUT_PULLUP);

ababak

Hi Felix,

Here's the link to high resolution photos of the board.

The button doesn't seem to be short to ground but doesn't seem to work either. I get no more screen glitches, just the button problem left. I haven't desoldered the button yet. I can try to do some specific tests if you tell to. Or is it better to send this board to you to have a look?

Thank you.

Best Regards,
Andrey

Felix

Good photos, thanks, the soldering looks clean. I noticed there's a crack in the LCD? But you said it works OK now?
Anyway I cannot tell what's wrong with the button from the photos.
The button is a simple momentary button, with 2 integrated LEDs. That should be very easy to verify if it's working or not, with a continuity meter (board power OFF). Then you can check the button connection to A2 (one side is GND the other is A2).
Otherwise you can return it if you want and I will take a look.

ababak

Yes, there's a barely visible crack present but the display works fine. I didn't even notice it before making photos.

As I wrote before, I've modified the code to print the button reading to console. When I attached the MightyHat to FTDI today for the first time since the last week the reading were correct. It was reading 1 on released and 0 on pressed button. I've switched the code back to original sketch and attached it to Raspberry Pi, but unfortunately it was switching it off as before. When I reinstalled the patched version I was reading constant 0 again no matter if it was pressed or not.

When probing the button in place it shows about 380 kΩ on a released button. I've ordered a replacement button on ebay, I'll see if replacing helps.

Felix

I suggest trying it with a simple momentary tactile button attached with wires before soldering the new one.
Also if you remove the old button, use your DMM to check for continuity from the button trace to the atmega, it should not be connected to anything else.

ababak

Hi Felix,

Just a small follow-up. Unfortunately, I didn't have enough time for my hobby so MightyHat was just laying around for a long time. When I switched it on after a long break it appeared to work without any problems. I tested it for several days and I no longer see previous symptoms.

I suspect all my problems were from using phosphoric acid while soldering. It looks like something had to fully evaporate before it started to work as expected. If that could be the reason I should not use it ever again.

Thanks.

Regards,
Andrey

P.S. Now I am playing with the Serial port and experience other problems. I have found a thread with a similar question and will ask there.

Felix