Metro M4 Express Airlift Startup/boot Problem

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
BigBigDave
 
Posts: 10
Joined: Wed Sep 18, 2019 5:22 pm

Metro M4 Express Airlift Startup/boot Problem

Post by BigBigDave »

Howdy! I'm new to the Metro boards and new to CircuitPython, and I've got a problem that started today. Because I'm new, I'm going to be overly detailed 'cause I don't know what's important and what's not.

Here's what I've got:
- Metro M4 Express Airlift
- Adafruit RGB LCD shield (not piggybacked, but wired with I2C)
- A 3x4 matrix keypad (which is connected but not really a part of the equation yet)
- A home-built case that is designed to work in a dirty shop environment, so the board itself is not accessible from outside the box. Because of that, I've got:
-- A micro-usb port on the outside of the box that goes to a micro-usb plug that is plugged into the Metro
-- A power jack wired through a switch that ends in a 5v plug, which is plugged into the DC jack of the Metro
-- A nine-pin female port to the outside of the box so external things can be plugged in

I'm using (or plan to use) these pins:
- Digital pins 1-7 are connected to the 7 pins on the matrix keypad
- SCL and SCA pins are connected to the RGB LCD
- GND (next to Vin) and 5V connected to a little homemade power node which is connected to:
-- The RGB LCD (5V and GND)
-- 2 pins of the 9-pin port (5V and GND)
- The 9-pin port is connected to:
-- A0, which is planned to be used as an analog sensor input
-- A1, which will be a digital output
-- A2, which will be another digital output
-- The aforementioned power connections

I have edited code.py to be the basic circuitpy demo code from the Adafruit Learn page for the RGB LCD:

Code: Select all

import board
import busio
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
lcd_columns = 16
lcd_rows = 2
i2c = busio.I2C(board.SCL, board.SDA)
lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
lcd.color = [100, 255, 0]
lcd.message = "Hello\nCircuitPython"


Up until this morning, I could plug a micro-usb cable from my PC to the port on the outside of the box, and it would connect to the Metro and give me the CIRCUITPY folder, and display the correct message on the RGB LCD. I could unplug the micro-usb from the outside of the box, plug in a 5V DC adapter from the wall outlet, turn on the power switch, and the Metro would turn on, "boot up" for lack of a more accurate term, and the RGB LCD would display the correct message. Nothing is plugged into the external 9 pin connector at this time, though a test rig for that part was working earlier today as well.

Now, if I plug a micro-usb cable in to the outside port, the green "On" led on the board lights up, and the "L" led lights up red, but then nothing else happens. The neopixel doesn't light, the RGB LCD does not come on, and the CIRCUITPY folder does not come up on the computer.

If I do any of the following, the board springs to life and works correctly, the LCD works, and the folder appears:
- Unplug the connector that plugs into the GND and 5V pins
- Unplug the connector that plugs into the SCL and SDA pins

If I connect a 5V DC adapter and turn on the switch, it works, but the brightness on the LCD needs to be increased. If I then leave that connected and plug in the micro-usb, the CIRCUITPY folder comes up on the computer and the LCD brightness is fine.

At any point after things are working, I can plug back in any pins I've unplugged and everything continues to function. If I exit code.py and save it, the changes are reflected on the LCD, so it's all really working correctly once it's working.

In use, it's going to be powered by the DC adapter, so that's great, but the process of getting the code set up requires the micro-usb connection, and the flakiness of it is troubling.

Any ideas?
Thanks,
Big Dave

EDIT - In the interest of thoroughness I tried pulling the data pins (A0, A1, and A2) and keypad pins (D1-D7) when the startup was "hung" but neither of those sets of pins had any effect.

EDIT AGAIN - I also used REPL for the first time earlier today. It worked as expected, but maybe I messed something up somehow?

User avatar
javantalith
 
Posts: 7
Joined: Wed Jan 30, 2019 10:33 am

Re: Metro M4 Express Airlift Startup/boot Problem

Post by javantalith »

I am having a nearly identical issue with a new Metro M4 that i received last week. Driving me nuts.

User avatar
User_UMjT7KxnxP8YN8
 
Posts: 323
Joined: Tue Jul 17, 2018 1:28 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by User_UMjT7KxnxP8YN8 »

What clock rate did you select when you built your sketch? I've seen this happen when overclocking. Reloading with the same sketch built to run at a lower clock rate solves the problem. The ATSAMDJ19A's spec'd clock rate is 120 MHz.

However... I've also seen this when Windows 10 is unable to correctly enumerate the USB port. I've been able to recover using the process I described at viewtopic.php?f=63&t=158129#p779339

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by adafruit_support_carter »

It sounds like there are a couple of things going on: (1) trouble getting the code to run as expected, and (2) trouble getting the CIRCUITPY folder to show up as expected.

You also have a lot of external hardware going on. We should back up and work forward one piece at a time. To verify the basic board functionality is still good, can you remove all external hardware, connect to the Metro directly with a USB cable, and see if you can get the CIRCUITPY folder to show up.

Also, please post a photo of your setup. Just a single overview photo for now so we have a better idea of what all is going on.

User avatar
javantalith
 
Posts: 7
Joined: Wed Jan 30, 2019 10:33 am

Re: Metro M4 Express Airlift Startup/boot Problem

Post by javantalith »

I did some googling and found a blog post that seems to be describing this same issue but with an arduino solution as opposed to a python code solution.

https://piandmore.BANNED.com/2016/09 ... unication/

I don't know if this will help me or OP with their problem. But what the hell.. it can't hurt.

User avatar
BigBigDave
 
Posts: 10
Joined: Wed Sep 18, 2019 5:22 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by BigBigDave »

Adafruit_UMjT7KxnxP8YN8 wrote:What clock rate did you select when you built your sketch? (...) I've also seen this when Windows 10 is unable to correctly enumerate the USB port...
First, thanks for responding. I appreciate the help. in answer to your question, I honestly don't remember ever selecting a clock rate. I plugged it in to my computer and the CIRCUITPY folder came up, then I loaded code.py into Mu. I definitely don't have the experience/confidence to try to overclock anything.

I'd think if Windows was unable to correctly enumerate the USB port, it wouldn't suddenly come back to life when I unplugged something from the Metro. Since this sounds involved (to me, since I don't understand all of what I just read) I haven't tried anything along this path yet.
adafruit_support_carter wrote:It sounds like there are a couple of things going on: (1) trouble getting the code to run as expected, and (2) trouble getting the CIRCUITPY folder to show up as expected.
Thank you for responding. But nope, there is no issue with the code running as expected, once CIRCUITPY shows up. It's only getting the CIRCUITPY folder to show, which goes hand-in-hand with the board booting up correctly. Once the board starts up, everything else is fine. I've never had the board start correctly and the CIRCUITPY folder fail to show up, nor have I had the CIRCUITPY folder show up and the board appear to NOT start correctly.
adafruit_support_carter wrote:You also have a lot of external hardware going on. We should back up and work forward one piece at a time. To verify the basic board functionality is still good, can you remove all external hardware, connect to the Metro directly with a USB cable, and see if you can get the CIRCUITPY folder to show up.
Yeah, that's what I did first. If I plug the usb directly to the Metro, it acts exactly the same way it does if I plug it into the usb on the back of my box. I know in my original post this information wasn't all together, but I've checked all the external hardware, and here's what happens if I unplug everything from the Metro and plug things in individually and in every possible combination:
1. Nothing at all connected to any pins, 5V DC plugged in directly to the board - Metro starts correctly
2. Nothing at all connected to any pins, 5V DC plugged in to the side of the box and the box's interior 5V connector plugged into the board - Metro starts correctly
3. EVERYTHING correctly connected to the pins (including a test rig connected to the 9-pin connector), 5V DC connected directly to the board OR connected to the box and the box's interior 5V connector plugged into the board - Metro starts correctly but LCD brightness is low (so it's doesn't seem to be the 5V DC connection)
4. Nothing at all connected to any pins, just the micro usb plugged in directly to the board - Metro starts correctly
5. Nothing at all connected to any pins, just the micro usb plugged in to the back of the box and the box's interior usb plugged into the Metro - Metro starts correctly
6. 7-pin keypad connected to 7 digital pins, micro usb plugged directly into the board - Metro starts correctly
7. 7-pin keypad connected to 7 digital pins, micro usb plugged in to the back of the box and the box's interior usb plugged into the Metro - Metro starts correctly
8. 3-pin connector from external 9-pin jack plugged in to 3 analog pins, micro usb plugged in either directly or indirectly - Metro starts correctly
9. 7-pin keypad connected to 7 pins AND 3-pin connected to 3 analog pins, micro usb plugged in either directly or indirectly - Metro starts correctly
**I've tested the usb connection directly and indirectly with every following situation, and they function identically in all cases (so it's not the usb connection)**
10. GND and 5V out connected to power distribution node sending power to 9-pin jack and LCD - Metro starts correctly
11. GND and 5V out connected to power distribution node AND 7-pin keypad connected - Metro starts correctly
12. GND and 5V out connected to power distribution node AND 3-pins from 9-pin connector connected - Metro starts correctly
13. GND and 5V out connected to power distribution node AND 7-pin keypad connected AND 3-pins from 9-pin connector - Metro starts correctly
14. SCL and SDA pins connected to same LCD pins - Metro starts correctly
15. SCL and SDA pins connected to same LCD pins AND 7-pin keypad connected - Metro starts correctly
16. SCL and SDA pins connected to same LCD pins AND 3-pins from 9-pin connector connected - Metro starts correctly
17. SCL and SDA pins connected to same LCD pins AND 7-pin keypad connected AND 3-pins from 9-pin connector - Metro starts correctly

18. GND and 5V out connected to power distribution node AND SCL and SDA pins connected to same LCD pins AND 7-pin keypad connected AND 3-pins from 9-pin connector - Metro hangs on startup, only lights on board are red "L" and green "ON" (Please see first picture below)
Unplugging EITHER GND and 5V OR SCL and SDA pins makes Metro start correctly. If I plug those connectors back in after the board is successfully running, the system continues to run correctly. If the 5V DC power is connected, everything else is connected, and I plug in the usb (directly or indirectly), the system continues to function as expected.

The entire system, including external test rig connected to the 9-pin port, used to function correctly - plugging in the usb started the board and opened CIRCUITPY. Nothing has changed on the hardware side, but now plugging in the usb doesn't work correctly.
adafruit_support_carter wrote:Also, please post a photo of your setup. Just a single overview photo for now so we have a better idea of what all is going on.
Please see attached... EDIT - I noticed the power connection between the Metro and the power distribution node is disconnected in this photo. It's reconnected IRL.
javantalith wrote:I did some googling and found a blog post that seems to be describing this same issue but with an arduino solution as opposed to a python code solution.
Thank you for responding. My code is super basic, so I don't even have any serial communication set up yet. Maybe there's something on the python side that has a similar effect to an arduino serial command?
Attachments
2019-11-05-New Controller hung.jpg
2019-11-05-New Controller hung.jpg (779.31 KiB) Viewed 744 times
2019-11-05-New Controller insides.png
2019-11-05-New Controller insides.png (539.11 KiB) Viewed 744 times

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by adafruit_support_carter »

OK, so it sounds like there is nothing wrong with the basic board functionality.

Maybe there is some kind of short or other wiring issue going on with the full setup.

User avatar
BigBigDave
 
Posts: 10
Joined: Wed Sep 18, 2019 5:22 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by BigBigDave »

adafruit_support_carter wrote:OK, so it sounds like there is nothing wrong with the basic board functionality.

Maybe there is some kind of short or other wiring issue going on with the full setup.
Mmkay. Can't say I'm familiar with the kind of short or wiring issue that would pop up out of nowhere, not be a problem when using DC power, and that doesn't effect the performance of anything once the board is fully booted up, but like I said, I'm new.

What do you suggest to diagnose such an issue?

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by adafruit_support_carter »

What do you suggest to diagnose such an issue?
Nothing specific. Just keep systematically testing the setup until you find the issue. You've done a lot of the already and know the general area and specifics that cause the issue. But still need to work out a solution.

User avatar
BigBigDave
 
Posts: 10
Joined: Wed Sep 18, 2019 5:22 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by BigBigDave »

adafruit_support_carter wrote:OK, so it sounds like there is nothing wrong with the basic board functionality.
OK, wait - I've been thinking about this and I don't agree. If everything works correctly with DC power, shouldn't the board also work correctly when plugged into USB? That seems like board functionality to me.

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by adafruit_support_carter »

Can you recreate that behavior with nothing attached to the board and only running the Blink example?

User avatar
BigBigDave
 
Posts: 10
Joined: Wed Sep 18, 2019 5:22 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by BigBigDave »

adafruit_support_carter wrote:Can you recreate that behavior with nothing attached to the board and only running the Blink example?
No. If nothing is attached to the board it works normally.

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by adafruit_support_carter »

Then it's not board functionality.

It's something with your setup, which is fairly complex. The issue isn't obvious from looking at what you've posted. So you'll just need to continue to systematically search out what and where the issue is.

User avatar
BigBigDave
 
Posts: 10
Joined: Wed Sep 18, 2019 5:22 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by BigBigDave »

adafruit_support_carter wrote:Then it's not board functionality.
So the blink example checks every pin and every component on the board to ensure proper functioning?

User avatar
PierreDeQuebec
 
Posts: 96
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro M4 Express Airlift Startup/boot Problem

Post by PierreDeQuebec »

Hi,

I have a similar problem with the initialization of the I2C bus. I have an Ultimate GPS + Logging Shield cart mounted in a backpack on a Metro M4 Airlift Lite microcontroller. On the GPS card, I have a BMP390 and a BN008x 9-DoF, both chains with a QWIIC link. The BMP390 is connected to the I2C bus of the microcontroller (GND, 5V, SDA and SDL). So much for the assembly.

If I power up through the USB port connected to my PC or a battery and the QWIIC connector is connected to the microcontroller, this happens:
  • The microcontroller does not initialize : the 'ON' LED turns on and stays on followed about two - three seconds later by the RX and TX LEDs which turn on and stay on. The microcontroller remains in this state as long as the SDA wire remains connected.
    The GPS card is activated and visibly the GPS finds a fix and makes its way.
    If I disconnect the SDA wire (so I keep SCL, GND and 5V connected), the microcontroller will initialize.
    I tried another QWIIC cable, I also tried BNO08 as an entry point. But that doesn't change anything.
Next, I removed the GPS card and the BNO08x from the equation and connected the BMP380 to the inputs of the microcontroller. Same observation. The microcontroller initializes that the SDA wire is not connected!

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”