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: 3
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: 638
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: 3
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: 1778
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: 62799
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: 3
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: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.