Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Teensy 4.0 / 4.1 startup delay of 300 ms

  1. #1
    Junior Member profor's Avatar
    Join Date
    Jun 2015
    Location
    Stupava, Slovakia
    Posts
    17

    Teensy 4.0 / 4.1 startup delay of 300 ms

    Hello all,

    probably question for @PaulStoffregen, is this delay in startup.c in ResetHandler funcrion really neccessary?

    Code:
    	startup_early_hook();
    	while (millis() < 20) ; // wait at least 20ms before starting USB
    	usb_init();
    	analog_init();
    	pwm_init();
    	tempmon_init();
    
    	startup_late_hook();
    	while (millis() < 300) ; // wait at least 300ms before calling user code
    	//printf("before C++ constructors\n");
    	__libc_init_array();
    	//printf("after C++ constructors\n");
    	//printf("before setup\n");
    	main();
    The thing is that i am using Teensy 4.0 as CAN gateway in my car and during 300 ms i will miss several important messages that needs to be forwarded to rest two CAN ports (i am using all three).
    Can i change it down to let say 40 ms so Teensy will "get up" faster?

    Thank You very much.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,637
    Usually the startup delay can be removed. It's there because some devices like MEMS motion sensor chips need time to start up. Many Arduino libraries and projects depend on Arduino's normal slow startup because they don't properly wait for the chips they use to become ready. That's why we have the 300ms delay, so all that stuff will "just work" with Teensy.

  3. #3
    Junior Member profor's Avatar
    Join Date
    Jun 2015
    Location
    Stupava, Slovakia
    Posts
    17
    Hello,
    thank You very much for positve reply

    I will comment it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •