SysCall::halt() doesn't compile on Teensy 4.1 after upgrading from Teensyduino 1.57 to 1.59


Active member
I'm working with Teensy 4.1. After upgrading from Teensyduino 1.57 to 1.59 the call SysCall::halt() gives the following error while compiling:
'SysCall' has not been declared

The compiler message about the libraries in use is:
Uso la libreria RF24 alla versione 1.4.8 nella cartella: C:\Program Files (x86)\Arduino\libraries\RF24
Uso la libreria SPI alla versione 1.0 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI
Uso la libreria EEPROM alla versione 2.0 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\EEPROM
Uso la libreria NativeEthernet alla versione 1.0.5 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\NativeEthernet
Uso la libreria FNET alla versione 0.1.3 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\FNET
Uso la libreria WiFi alla versione 1.2.7 nella cartella: C:\Program Files (x86)\Arduino\libraries\WiFi
Uso la libreria Time alla versione 1.6.1 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time
Uso la libreria TimerOne alla versione 1.1.1 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\TimerOne
Uso la libreria SdFat alla versione 2.1.2 nella cartella: C:\Users\paolo\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SdFat
Uso la libreria CartoniPins nella cartella: C:\Program Files (x86)\Arduino\libraries\CartoniPins (legacy)
Uso la libreria GenericOptics nella cartella: C:\Program Files (x86)\Arduino\libraries\GenericOptics (legacy)
Uso la libreria Canon2 nella cartella: C:\Program Files (x86)\Arduino\libraries\Canon2 (legacy)
Uso la libreria Fujinon2 nella cartella: C:\Program Files (x86)\Arduino\libraries\Fujinon2 (legacy)
Uso la libreria CartoniLens nella cartella: C:\Program Files (x86)\Arduino\libraries\CartoniLens (legacy)
Uso la libreria Cartoni alla versione 3 nella cartella: C:\Program Files (x86)\Arduino\libraries\Cartoni

Best regards
It's related to the SdFat library. Syscall::yield and SysCall::halt were apparently removed in V2.1.1 of the library.

TD 1.57 had SdFat 2.1.2, the same as 1.59, so perhaps the OP's last successful build was with TD earlier than 1.57?

@paoloboatto, can you show the error message? Is the call to syscall::halt() in your own code, or is it from a library?
I call syscall::halt() in my code. Maybe my previous Teensyuduino was 1.56 and not 1.57. However I'm quite sure the problem is that the halt() method has been suppressed in the updated SDFat library. Is there an equivalent method in the new one?
syscall::halt() was literally just:
while (1) yield();

I don't see any reason for this to exist as an exposed function in any library.
The current version of SdFat has sd.initErrorHalt(), which may be what the OP is looking for. Bill's example programs usually have the logic below, and the last line of initErrorHalt() is an infinite loop. I can see doing this in an example program, but it's hard to see why you would do this in an application.

  if (!sd.begin(SD_CONFIG)) {

  /** %Print error info and halt.
   * \param[in] pr Print destination.
  void initErrorHalt(print_t* pr) {
    while (true) {}