Author Topic: Start Serial Loader Automatically at boot up (Teensy 3.5)  (Read 67 times)

Offline RichardV

  • Newbie
  • *
  • Posts: 7
    • View Profile
Start Serial Loader Automatically at boot up (Teensy 3.5)
« on: November 21, 2020, 02:55:23 PM »
I got the Serial Loader for teensy3.5 working but it requires the loader to start first before it will read the new software off of the SD Card. Is there a setting within the Serial Loader build process to have the Serial Loader start at power up every time?

My existing project with Teensy3.5 won't allow me to have specific pins pulled low or high at boot so I was wondering if there was a mechanism in the Serial Loader build process to just always have it boot and pull in the current the rev of software that will be residing on the SD Card?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3093
    • View Profile
    • uTasker
Re: Start Serial Loader Automatically at boot up (Teensy 3.5)
« Reply #1 on: November 21, 2020, 03:14:12 PM »
Hi

The behavior is controlled by the macro

FORCE_BOOT()

In my version it is defined as:

    #define FORCE_BOOT()           ((_READ_PORT_MASK(C, SWITCH_1) == 0) || (SOFTWARE_RESET_DETECTED() && (*(BOOT_MAIL_BOX) == RESET_TO_SERIAL_LOADER))) // pull this input down to force boot loader mode (connect pin pad 22 to GND at reset)

which means that it can be forced to the loader mode with an input or by commanding it from the application.

Often the SD card loader is used in combination with an SD card detect input so that this input is used to force the loader mode, which means that it will jump directly to the application if there is no SD card inserted. Generally the SD card loader will be configured to start the application after the check has completed, whereby the macro RETAIN_LOADER_MODE() can be used to force it to stay in the loader:
In my version it is defined as:
#define RETAIN_LOADER_MODE()   (_READ_PORT_MASK(C, SWITCH_1) == 0)   // pull this input down to force boot loader mode (connect pin pad 22 to GND at reset)

If you prefer the loader to always check the SD card you can simply force it every time with

#define FORCE_BOOT()    1

To never hold the mode

#define RETAIN_LOADER_MODE()  0

Regards

Mark



Offline RichardV

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Start Serial Loader Automatically at boot up (Teensy 3.5)
« Reply #2 on: November 21, 2020, 03:32:42 PM »
Thanks for the reply Mark!

would these added lines go in the config.h file for the Serial Loader build? Just want to make sure.

Offline RichardV

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Start Serial Loader Automatically at boot up (Teensy 3.5)
« Reply #3 on: November 21, 2020, 04:54:45 PM »
Disregard....

I got it working! Thanks so much for the assistance Mark!