0

Grand Central M4 - how to boot directly to app
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Grand Central M4 - how to boot directly to app

by MikeGrobler on Fri May 07, 2021 6:16 pm

On an M4 Grand Central using Arduino IDE to generate C apps, what should I do in the app so that when the board is powered up, it will immediately boot into the app?
Currently, reset/reboot/POR goes thru the bootloader and it take 10-15 secs before my app begins executing. For creating a standalone product solution, waiting so long for a reboot would be unacceptable.

Also, the same issue exists after an app has been loaded from the IDE - one has to wait 10-15 secs before the app actually starts. Is there some command that can be sent to the flash loader to immediately jump to and start executing the just-loaded app?

I have the latest bootloader v3.13.0 installed, and I'm using the latest Arduino IDE 1.8.13.
All libraries and code are at latest.

MikeGrobler
 
Posts: 6
Joined: Fri May 07, 2021 6:03 pm

Re: Grand Central M4 - how to boot directly to app

by blnkjns on Sat May 08, 2021 12:30 pm

It's weird. The program should run straight away. If you use the serial monitor, and include a while (!Serial) it might take some time to boot, but in a final product I suspect you won't keep serial monitor commands in your software.

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: Grand Central M4 - how to boot directly to app

by MikeGrobler on Sat May 08, 2021 1:18 pm

Currently for debugging, I’m using Serial1 which is the serial port to I/O pins, so not related to the virtual USB serial port.
When my app starts up the very first thing it does (even before starting the Serial1 port) is to flash the pin 13 LED - and from the time the Arduino IDE has completed the app upload to flash to when the LED flashes takes approx 10-15 secs.

Indeed weird and unexpected. It seems to me without using JLink to really debug the issue, that the bootloader is the culprit - I suspect it is waiting and watching for reset button presses to decide whether to boot to the app, or boot to Python or boot to the flash downloaded state.

MikeGrobler
 
Posts: 6
Joined: Fri May 07, 2021 6:03 pm

Re: Grand Central M4 - how to boot directly to app

by westfw on Tue May 11, 2021 4:16 am

MikeGrobler wrote:it take 10-15 secs before my app begins executing.

That is strange.
I checked my GCM4 and it starts MUCH faster than that (less than 1s from either Power-on or reset switch.) (using the example "Blink" sketch.)

westfw
 
Posts: 1781
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Grand Central M4 - how to boot directly to app

by adafruit_support_mike on Tue May 11, 2021 10:48 pm

We haven't seen any other Grand Central behave that way.

Post the simplest version of a program that demonstrates the behavior you're seeing (between CODE tags please) and we'll see if we can replicate it on our own hardware.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Re: Grand Central M4 - how to boot directly to app

by MikeGrobler on Thu Jun 03, 2021 11:38 pm

I cannot replicate this with any program, because it's not what/which program I run, but rather how long it takes from reset to when the program starts running (or at least to when the program exhibits something observable). A 1-2 sec delay would be okay - less than 1-sec is preferable - but 10-15 secs is rather unacceptable.

MikeGrobler
 
Posts: 6
Joined: Fri May 07, 2021 6:03 pm

Re: Grand Central M4 - how to boot directly to app

by adafruit_support_mike on Fri Jun 04, 2021 9:25 pm

Yeah, that's far longer than it should take, but we've never seen a board behave that way.

Hardware is deterministic though, so things that happen repeatably have some kind of cause. If it happens with a trivial sketch like Blink, we can probably rule out software isses.

Does the delay happen when the board has no USB connection to a computer?

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Re: Grand Central M4 - how to boot directly to app

by MikeGrobler on Mon Jul 19, 2021 8:38 pm

Sorry for delayed response - just now getting back to this project.

If I remove the USB connector and simply power the board from 12V, it takes even longer for the loaded app to start, approx 1 min.

The simple blink program also takes 15-20 secs to start from the time the firmware upload completes.

I also notice with great frustration that the double tap reset only works maybe 10% of the tries to get the board to be a USB device on my Ubuntu Linux, and once I get the reset tap dance just right so that all the little leds are lit, it takes another 20-30 secs before the USB device shows up in my Ubuntu Linux.

Most vexing!!??

I am using the latest Arduino IDE and libraries - 1.8.15, and I have the bootloader-grandcentral_m4-v3.13.0.bin, loaded with jlink to ensure that I do not have a corrupted bootloader.

MikeGrobler
 
Posts: 6
Joined: Fri May 07, 2021 6:03 pm

Re: Grand Central M4 - how to boot directly to app

by MikeGrobler on Mon Jul 19, 2021 9:31 pm

Ok, good news, I found the culprit - I have an Adafruit RGB Matrix Shield plugged in, after I unplugged it, the Grand Central behaves correctly, boots immediately and the double reset tap-dance works correctly.

Now to debug why the RGB Shield is dragging the processor board down!!??

Thanks very much for your attention to this!

MikeGrobler
 
Posts: 6
Joined: Fri May 07, 2021 6:03 pm

Re: Grand Central M4 - how to boot directly to app

by adafruit_support_mike on Mon Jul 19, 2021 10:17 pm

That's also weird. The Matrix Shield is just a wiring convenience. It doesn't have any components.

Check the pin voltages when the Shield is and isn't connected to see if there are any differences. Off the top of my head, the only thing I can think of that would delay startup would be something holding the reset pin low.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Re: Grand Central M4 - how to boot directly to app

by MikeGrobler on Tue Jul 20, 2021 8:12 pm

Only when the 64x32 RGB panel is plugged into the shield and powered on from its 5V PSU, does the reset go sluggish and not work properly.

But the RGB shield does not have a connection to the reset line, only to various digital I/O lines. The RGB panel is powered with 5V while the Grand Central requires 3.3V digital I/O - I wonder whether the RGB panel is properly deploying 3.3V logic levels???

MikeGrobler
 
Posts: 6
Joined: Fri May 07, 2021 6:03 pm

Re: Grand Central M4 - how to boot directly to app

by adafruit_support_mike on Tue Jul 20, 2021 10:47 pm

That shouldn't make any difference.

The signals coming from the Arduino are connected to input pins, which don't have any voltage of their own.. or more technically, have at least 10M of impedance to any part of the 5V circuit. The only normal issue with connecting 3.3V signals to 5V inputs is making sure the 5V circuit recognizes 3.3V as a HIGH input.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.