djphazer/O_C-Phazerville

o_C-phazerville-v1.7_T40-6d32547c.hex freezes on powerup.

Closed this issue · 9 comments

I'm currently unable to get the 1.7 build with a teensy 4.0 to work. I've confirmed that my hardware supports the 3.2 without any issues but the 4.0 builds freeze on the startup splash screen. I've tried with a few different boards and two modules (albeit same pcb layout) and still get a frozen screen after a few seconds post boot, then a few seconds later the screen just goes black. There is also a faint clicking I can hear from the microcontroller. Not sure if anyone else is having similar issues.

Faint clicking? 🤔
Tell me a little more... does the splash screen animate at all before it freezes? Is it DIY hardware or from a vendor? Did you cut the USB power trace on the Teensy?

The Serial Monitor inside Arduino IDE might be able to provide clues and a CrashReport, if you have it.

yeah, on a timed interval. I almost didn't catch it because it's really quiet.

The screen does animate but only sometimes and very briefly. The hardware is DIY and yes I did cut the USB power trace on the Teensy.

I don't use the Arduino IDE, but if you can point me to instructions on getting a CrashReport, I'm happy to produce one.

Here is a video of what happens at the bootup sequence side by side. (on the left T3.2 on the right is the T4.0):

https://youtu.be/4rCBsGxVsrA

Ok, strange... looks like it almost worked, but then it freezes. Maybe it's a driver bug, or possibly garbage data in EEPROM.

It might not show much, but to check the Serial output, you'll need the latest Arduino IDE for your system + the Teensyduino extension.
Once installed, you can connect to a Teensy via USB and then view the "Serial Monitor" from the Tools menu. Once connected, it should automatically reconnect when you power cycle the module and possibly spit out crash reports...

If it is still alive while the screen is frozen, you might be able to use Paul's Screen Capture utility to investigate.

Sadly, after installing the Arduino IDE (2.3.2) and the latest teensyduino extension. Nothing gets dumped to the Serial Monitor. The tool does see the board and port as I see a message saying: Message (Enter to send message to 'Teensy 4.0' on 'usb:2130000') But nothing gets uploaded. I see on the Main.cpp that serial is configured with 9600 baud rate which is also what is set on the Serial Monitor. So likely the app is crashing before anything is printed, unless there is an additional flag that must be set to enable debug.

Your theory on this being a bug with the driver seems more plausible. This behavior seems very much like a memory leak, but not really knowing this code I would not even know where to begin to look for the problem.

---- update ----

I looked through the code a tiny bit and found that the platformio.ini file had the -DPRINT_DEBUG flag disabled by default. I went ahead and compiled a build with this enabled then installed it, but this was the only output that was generated:

@60us
* UI ISR @1000us
* O&C BOOTING...
* v1.7_T40-e4c364fdirty

Thank you for taking the time to debug this with me. Glad to see you found the PRINT_DEBUG flag as well! It is very helpful, though CrashReports will still come through without it.

I have a few more ideas to isolate the problem:

  1. Disable some or all of the app flags for the T4 env target in platformio.ini, see if it runs on a minimal build.
    (Add the -DNO_HEMISPHERE flag to exclude Hemisphere)
  2. Disable the -DTEENSY_OPT_SMALLEST_CODE flag
  3. Try out an older v1.6.x build, maybe I broke something in 1.7

Meanwhile, I'll be looking for memory leaks...

Sorry for the delay. Here are the results from my troubleshooting efforts:

  1. Commented out -DENABLE_APP_* from [emv:T4] in the platformio.ini file, compiled:

No change, same outcome.

  1. Commented out -DENABLE_APP_* and added -DNO_HEMISPHERE, the tested:

No change, same outcome.

  1. commented out -DTEENSY_OPT_SMALLEST_CODE from [env], tested:

No change, same outcome.

  1. Downloaded the following versions and tested:

v1.6.777 Beta - Different screen (boots with calibrator) but still frozen and I can hear the clicking.
Ok so from what I can gather, the issue isn't with Hemisphere or the apps. So more likely that this means is we are narrowing down on a driver issue. Hmm.. I wonder If this is more of a timing issue.

Ok, I've been troubleshooting this over the last few days and I think I found my issue and it does seem to be hardware-related. looks like the LM1117 is shutting itself off due to heat even though I had added what I thought was enough copper to dissipate heat. The regulator does get somewhat warm to the touch. But when I put my finger on it it operates longer. So... I put some thermal tape on the regulator and it had been operating for a few minutes before it crashed. Anyway, I'm going to rework the schematic to allow for more heat dissipation and test again.

Awesome, thanks for the follow up! Glad to hear it's probably not my fault! 😅

I suspected it could be hardware related... but the Teensy 3.2 still works fine? Hardware circuit details are a little lost on me, but I'm curious to know why or indeed if it only fails with the T4.0