Teensyduino 1.58 Beta #1 (updated toolchain trial)

Paul

Administrator
Staff member
Here is a first beta test for Teensyduino 1.58.

This is an experiment to update the gcc toolchain from 5.4.1 to 11.3.1. Please try as many programs and libraries as you can. If gcc 11.3.1 has serious compatibility or performance issues, I'll revert back to 5.4.1. If it looks promising, I'll work on a newlib rebuild without C++ exception overhead and installers for MacOS and the other Linux architectures, and packages for Arduino CLI & IDE2.


Linux 64 bit:
https://www.pjrc.com/teensy/td_158-beta1/TeensyduinoInstall.linux64

Windows:
https://www.pjrc.com/teensy/td_158-beta1/TeensyduinoInstall.exe


Changes since Teensyduino 1.57:

Updated toolchain to gcc 11.3.1 for Teensy LC, 3.x, 4.x
Update core library for gcc 11.3.1
Update Wire library for gcc 11.3.1
Update teensy_size for gcc 11.3.1
FlexIO_t4 FlexSerial support more baud rates (KurtE)
AudioEffectEnvelope fix release name conflict (Jonathan Oakley)
Add audio DynamicPatching example (Jonathan Oakley)
Audio design tool fix control name on export (Jonathan Oakley)
USBHost_t36 improved HID device diagnostic info (KurtE)
Improve C & C++ library access to Teensy 3 & 4 RTC hardware
Audio use IntervalTimer for updates if no hardware update available
 
Last edited:
Good Morning all
Downloaded and installed in IDE1.8.19 no problem on a windows 10x64. IDE2 isn;t showing the update though for 1.58-beta1 not sure if this was intentional?

Also, I seem to remember that you had a perl script that you put together to test all the libraries during T4.x beta testing. Maybe can run that to say some time at least for the T4's. Unfortunately I never could get that working on a windows machine.

Now for some testing.
 
Downloaded on my Windows 11 machine. But for whatever reason it does not like my Arduino 1.8.19 directory.
Screenshot.jpg

And as mentioned:
If it looks promising, I'll work on a newlib rebuild without C++ exception overhead and installers for MacOS and the other Linux architectures, and packages for Arduino CLI & IDE2.
So cannot try on IDE2.

Next up probably fresh install
 
Downloaded on my Windows 11 machine. But for whatever reason it does not like my Arduino 1.8.19 directory.
View attachment 29313

And as mentioned:
So cannot try on IDE2.

Next up probably fresh install

Oops missed the IDE2 wasn't ready thanks for pointing that out.

I forgot to mention that I installed 1.58b1 on a clean copy of IDE1.8.19 without an issue so might be the difference.
 
Thanks @mjs513 for letting me know that the links in post #1 are wrong, the point to 1.57 beta 1. They point to: xxx/td_157-beta1/TeensyduinoInstall.exe

Should be: https://www.pjrc.com/teensy/td_158-beta1/TeensyduinoInstall.exe

That one installed on my dirty 1.8.19

Now to try it out. Although not looking forward to building lots of stuff on 1.8.19... IDE 2 builds so much faster. Also, nice that they monitor file changes, and other that some real quirks
with the UI, like magic text cursor (which there is work around for), is a lot nicer... But...
 
@Paul, @KurtE and all
Test 3 of the latest sketches we have been working on. Wacom tablets, keyboard HID updates and a unique sketch. Mostly anti-aliasing warnings in USBHost but for the custom sketch getting an
Code:
relocation truncated to fit: R_ARM_PREL31 against symbol

for the T4.x boards.

Code:
[B]wacom library
ran tablet_viewer example (uses ILI9341_t3n lib):  [/B]
T3.6 and T4.1 errors - using kurts hid-keyboard branch
In file included from D:\Users\Merli\Documents\Arduino\libraries\WacomController-name_cleanup\examples\Tablet_viewer\Tablet_viewer.ino:24:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master/USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master/USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tablet_viewer: In function 'bool showDataScreen()':
Tablet_viewer:422: warning: 'x' may be used uninitialized 
  422 |           tft.fillRect(x, y2, 320, line_space, BLACK);
      |           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tablet_viewer:422: warning: 'y2' may be used uninitialized 
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\hid.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\antplus.cpp:29:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\MassStorageDriver.cpp:28:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\MassStorageDriver.cpp: In member function 'virtual void USBDrive::disconnect()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\MassStorageDriver.cpp:211:15: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct msDriveInfo_t'; use assignment or value-initialization instead [-Wclass-memaccess]
  211 |         memset(&msDriveInfo, 0, sizeof(msDriveInfo_t));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:33,
                 from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\MassStorageDriver.cpp:28:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\utility/msc.h:155:16: note: 'struct msDriveInfo_t' declared here
  155 | typedef struct {
      |                ^
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBFilesystemFormatter.h:4,
                 from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBFilesystemFormatter.cpp:2:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\SerEMU.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\joystick.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\hub.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\adk.cpp:26:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\digitizer.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\enumeration.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\ehci.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\bluetooth.cpp:28:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\keyboard.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\memory.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\midi.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\mouse.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\print.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\rawhid.cpp:25:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\serial.cpp:27:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master\USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Merli\Documents\Arduino\libraries\WacomController-name_cleanup\src\WacomController.h:4,
                 from D:\Users\Merli\Documents\Arduino\libraries\WacomController-name_cleanup\src\WacomController.cpp:1:
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master/USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
D:\Users\Merli\Documents\Arduino\libraries\USBHost_t36-master/USBHost_t36.h:2479:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opening Teensy Loader...
Sketch uses 93596 bytes (8%) of program storage space. Maximum is 1048576 bytes.
Global variables use 20508 bytes (7%) of dynamic memory, leaving 241636 bytes for local variables. Maximum is 262144 bytes.

============================================================================================================

[B]USBHost KeyboardForward Sketch
Looks like same errors as for the Wacom sketch[/B]

==============================================================================================================

[B]Custom Sketch parse_data_test
Uses ILI9341_t3n, vector, string and #define _GLIBCXX_USE_C99 1.  Used to parse string data from RPI4[/B]
T4.1 getting errors:
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.exidx.text.unlikely._ZSt17__throw_bad_allocv+0x4): relocation truncated to fit: R_ARM_PREL31 against `.ARM.extab.text.unlikely._ZSt17__throw_bad_allocv'
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.extab.text.unlikely._ZSt19__throw_logic_errorPKc+0x0): relocation truncated to fit: R_ARM_PREL31 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(eh_personality.o)
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.exidx.text.unlikely._ZSt19__throw_logic_errorPKc+0x4): relocation truncated to fit: R_ARM_PREL31 against `.ARM.extab.text.unlikely._ZSt19__throw_logic_errorPKc'
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.extab.text.unlikely._ZSt24__throw_invalid_argumentPKc+0x0): relocation truncated to fit: R_ARM_PREL31 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(eh_personality.o)
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.exidx.text.unlikely._ZSt24__throw_invalid_argumentPKc+0x4): relocation truncated to fit: R_ARM_PREL31 against `.ARM.extab.text.unlikely._ZSt24__throw_invalid_argumentPKc'
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.extab.text.unlikely._ZSt20__throw_length_errorPKc+0x0): relocation truncated to fit: R_ARM_PREL31 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(eh_personality.o)
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.exidx.text.unlikely._ZSt20__throw_length_errorPKc+0x4): relocation truncated to fit: R_ARM_PREL31 against `.ARM.extab.text.unlikely._ZSt20__throw_length_errorPKc'
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.extab.text.unlikely._ZSt20__throw_out_of_rangePKc+0x0): relocation truncated to fit: R_ARM_PREL31 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(eh_personality.o)
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.exidx.text.unlikely._ZSt20__throw_out_of_rangePKc+0x4): relocation truncated to fit: R_ARM_PREL31 against `.ARM.extab.text.unlikely._ZSt20__throw_out_of_rangePKc'
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.extab.text._ZSt24__throw_out_of_range_fmtPKcz+0x0): relocation truncated to fit: R_ARM_PREL31 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(eh_personality.o)
f:/arduino-1.8.19-1131/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libstdc++.a(functexcept.o):(.ARM.exidx.text._ZSt24__throw_out_of_range_fmtPKcz+0x4): additional relocation overflows omitted from the output

-----
T3.6 = No errors
T3.2 = No errors
 
Note: After my install it appears like it is running 1.57 still... Guess next clean install.

Edit: Clean install now shows 1.58B1...
 
Last edited:
Here are a few more tests:
Code:
[B]flexcan_t4[/B]:  
4 examples tested - passed, t4.x's

[B]nxpmotionsense[/B]:
	MadgwickIMU and MahoneyIMU:
	T4.0, T3.6, T3.2, TLC
	D:\Users\Merli\Documents\Arduino\libraries\MadgwickAHRS-master\src\MadgwickAHRS.cpp:234:19: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
	  234 |         long i = *(long*)&y;
		  |                   ^~~~~~~~~
	D:\Users\Merli\Documents\Arduino\libraries\MadgwickAHRS-master\src\MadgwickAHRS.cpp:236:14: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
	  236 |         y = *(float*)&i;
		  |              ^~~~~~~~~~
	D:\Users\Merli\Documents\Arduino\libraries\MadgwickAHRS-master\src\MadgwickAHRS.cpp:234:18: warning: 'y' is used uninitialized [-Wuninitialized]
	  234 |         long i = *(long*)&y;
		  |                  ^~~~~~~~~~
	D:\Users\Merli\Documents\Arduino\libraries\MadgwickAHRS-master\src\MadgwickAHRS.cpp:233:15: note: 'y' declared here
	  233 |         float y = x;
		  |               ^
	Opening Teensy Loader...
	Memory Usage on Teensy 4.0:
	  FLASH: code:16252, data:3208, headers:9208   free for files:2002948
	   RAM1: variables:4928, code:14144, padding:18624   free for local variables:486592
	   RAM2: variables:12384  free for malloc/new:511904


	   CalibrateSensors sketch: TLC, T3.2, T3.6, T4.1 - PASS - no errors or warnings


[B]LittleFS[/B]
	LittleFS_usage (SPI FLASH): TLC, T3.2, T3.6, T4.1:  PASS
	LittleFS_usage (QPINAND): T4.1:  PASS
	QSPI Test Integrity: T4.1 = PASS

[B]ILI9488[/B]
	Demosauce Sketch: 
	T4.1, tlc, t3.2, t3.5, t3.6  a few warnings;
	F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\ILI9488_t3\examples\DemoSauce\TwistyText.h: In member function 'virtual void TwistyText::perFrame(ILI9488_t3, FrameParams)':
	TwistyText.h:222: warning: 'topBit' may be used uninitialized in this function 
	  222 |                                 uint_fast16_t height = ((bit-topBit) * TEXT_PIXEL_HEIGHT) * sinAngle;
		  |                                                         ~~~~^~~~~~~~
	F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\ILI9488_t3\src\ILI9488_t3.cpp: In member function 'int16_t ILI9488_t3::strPixelLen(const char*, uint16_t)':
	F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\ILI9488_t3\src\ILI9488_t3.cpp:3168:7: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
	 3168 |       else getTextBounds((const uint8_t *)str, cb, cursor_x, cursor_y, &x, &y, &w, &h);   return w;
		  |       ^~~~
	F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\ILI9488_t3\src\ILI9488_t3.cpp:3168:91: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
	 3168 |       else getTextBounds((const uint8_t *)str, cb, cursor_x, cursor_y, &x, &y, &w, &h);   return w;
		  | 

	Note Ran a couple of other sketches but all show the same messages as above


[B]FrequenceCount[/B]:  TLC, T3.2, T35, T36, T41: pass
 
Good Morning all
Downloaded and installed in IDE1.8.19 no problem on a windows 10x64. IDE2 isn;t showing the update though for 1.58-beta1 not sure if this was intentional?

Also, I seem to remember that you had a perl script that you put together to test all the libraries during T4.x beta testing. Maybe can run that to say some time at least for the T4's. Unfortunately I never could get that working on a windows machine.

Now for some testing.

I was also wondering if you ran your perl scripts? And have a list of things with issues that we should be looking at?

Also curious on what things are gained by this and where problems are more likely to be lurking?

For example, if the biggest is gain is to allow some more modern stuff in let's say templates or std:: classes, I more or less seldom if ever use them, so I am less likely to find any issues there.
Hopefully others who use it, will test those areas.

Now back to testing some random stuff.

Note: some of the code that the compiler flags, makes me want to pull out a few more strands of hair. Like:
Code:
class USBFilesystem : public FS, public USBFSBase
{
...
	operator bool() {
		[COLOR="#FF0000"]Device_t *dev = *(Device_t * volatile *)&device;[/COLOR]
		return dev != nullptr;
	}
Code:
:\Users\kurte\Documents\Arduino\libraries\USBHost_T36\USBHost_t36.h:2479:44: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2479 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What is gained by this versus:
Code:
operator bool() { return device != nullptr;}
What does volatile gain you here? since this is the only reference to that member variable within that method?
Note: There is another similar construct within USBHost_t36.h
 
Yeah, it prints warnings on a lot of libraries, especially about misleading indentation. I found a couple with errors, usually about time_t.


Now to try it out. Although not looking forward to building lots of stuff on 1.8.19... IDE 2 builds so much faster.

I'll try to package up files for IDE2. I still haven't written a nice script to automate this...
 
For my TeensyMIDIPolySynth (now two separate modules connected via 500kbps shared Serial4: Teensy-MIDI-RA8875-PolySynth-Audio running on a T4.0 as "Serial", & Teensy-MIDI-RA8875-PolySynth-Display running on a T4.1 as "Serial + MIDI", both compiled with "Smallest Code" optimization), the audio T4.0 compiled fine, no errors, no warnings. The T4.1 compiled to completion, but threw the following (similar to mjs513 report):

Code:
In file included from C:\Users\mjcul\Documents\Arduino\MJCsource\Teensy-MIDI-RA8875-PolySynth-Display\Teensy-MIDI-RA8875-PolySynth-Display.ino:62:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36/USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36/USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\RA8875\RA8875.cpp: In member function 'void RA8875::drawChar(int16_t, int16_t, unsigned char, uint16_t, uint16_t, uint8_t, uint8_t)':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\RA8875\RA8875.cpp:6221:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
 6221 |                 if((x >= _displayclipx2)            || // Clip right
      |                 ^~
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\RA8875\RA8875.cpp:6228:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
 6228 |                         int16_t y_char_top = y; // remember the y
      |                         ^~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\serial.cpp:27:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\memory.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\mouse.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\MassStorageDriver.cpp:28:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\MassStorageDriver.cpp: In member function 'virtual void USBDrive::disconnect()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\MassStorageDriver.cpp:211:15: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct msDriveInfo_t'; use assignment or value-initialization instead [-Wclass-memaccess]
  211 |         memset(&msDriveInfo, 0, sizeof(msDriveInfo_t));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:33,
                 from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\MassStorageDriver.cpp:28:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\utility/msc.h:155:16: note: 'struct msDriveInfo_t' declared here
  155 | typedef struct {
      |                ^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBFilesystemFormatter.h:4,
                 from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBFilesystemFormatter.cpp:2:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\rawhid.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\antplus.cpp:29:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\bluetooth.cpp:28:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\digitizer.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\hub.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\enumeration.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\ehci.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\joystick.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\adk.cpp:26:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\hid.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\midi.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\print.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\SerEMU.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\keyboard.cpp:25:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h: In member function 'USBFilesystem::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:2395:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 2395 |                 Device_t *dev = *(Device_t * volatile *)&device;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Memory Usage on Teensy 4.1:
  FLASH: code:176640, data:51484, headers:8416   free for files:7889924
   RAM1: variables:70176, code:172432, padding:24176   free for local variables:257504
   RAM2: variables:50336  free for malloc/new:473952

Still traveling back from our Labor Day holiday weekend campout, so will test on the actual TeensyMIDIPolySynth hardware later this evening when we get back home.

Mark J Culross
KD5RXT
 
@kd5rxt-mark - Yes a lot of those are the same one that @mjs513 and me mentioned.

Locally I updated the bool() to what I mentioned and removed those compiler warnings.

Still have one in the USBHost I noticed:
Code:
C:\Users\kurte\Documents\Arduino\libraries\USBHost_T36\MassStorageDriver.cpp: In member function 'virtual void USBDrive::disconnect()':
C:\Users\kurte\Documents\Arduino\libraries\USBHost_T36\MassStorageDriver.cpp:211:15: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct msDriveInfo_t'; use assignment or value-initialization instead [-Wclass-memaccess]
  211 |         memset(&msDriveInfo, 0, sizeof(msDriveInfo_t));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I

I guess one question is, do we actually change any of the code like this not to use memset? Ignore the warnings? Change the compiler settings to not see these? ...
 
Ok, IDE2 packages uploaded. Updating the package index is still a manual process, so please let me know if I got some detail wrong? Ran a quick test on Linux and it seems to work.

I also changed the old compiler to version 5.4.1 rather than 1.56.1. So it might want to do updates even if you have a prior version installed. But in hindsight, calling the toolchain a Teensyduino version number just wasn't a good idea. Needs to get fixed sometime, and that time is now.
 
I guess one question is, do we actually change any of the code like this not to use memset? Ignore the warnings?

This is the joy of updating the toolchain. We get a ton of new compiler warnings about stuff that really should get updated. Most are probably harmless, but they're also probably about things that were never quite 100% correct but worked anyway.

I believe this warning is trying to tell us that the USBDrive class is too complicated to simply be cleared by memset(). Maybe it's because it inherits from 2 other classes? Maybe something about SdFat FsBlockDeviceInterface class matters?
 
Well here are another bunch of errors and warnings to various libraries - some in Teensyduino and some I use on a regular basis.
Code:
[B]@brtaylor Libraries:[/B]
	[B]MPU9250[/B]: TLC, T3.2, T3.6, T4.1 - PASS
	[B]UBLOX[/B]:  Numerous errors - too many to list
	
[B]RA8875[/B]
	benchmarks sketch: 
	T4.1, T3.6, T3.2, TLC:
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\RA8875\RA8875.cpp:6221:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
		6221 |                 if((x >= _displayclipx2)            || // Clip right
			 |                 ^~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\RA8875\RA8875.cpp:6228:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
		6228 |                         int16_t y_char_top = y; // remember the y
			 |
			 
	FT5206Touchscreen test:
		Same errors as for benchmarks sketch
		

[B]QuadEncoder[/B]: T41, T4 - PASS.

[B]NativeInternet[/B]: T4.1
	UDPSendReceiveString: compiles but:
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\NativeEthernet\src\NativeEthernetServer.cpp:119:103: warning: enum constant in boolean context [-Wint-in-bool-context]
		  119 |                                            if(socket_poll.events_occurred & (FNET_SOCKET_EVENT_OUT || FNET_SOCKET_EVENT_IN)) {
			  |                                                                                                       ^~~~~~~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\service\llmnr\fnet_llmnr.c:60:30: warning: 'fnet_llmnr_ip6_multicast_addr' defined but not used [-Wunused-const-variable=]
		   60 | static const fnet_ip6_addr_t fnet_llmnr_ip6_multicast_addr = FNET_IP6_ADDR_INIT(0xFF, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x00, 0x03);
			  |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:1062:83: warning: argument 2 of type 'unsigned char[36]' with mismatched bound [-Warray-parameter=]
		 1062 | MBEDTLSFLASHMEM void ssl_calc_verify_tls( mbedtls_ssl_context *ssl, unsigned char hash[36] )
			  |                                                                     ~~~~~~~~~~~~~~^~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:483:73: note: previously declared as 'unsigned char *'
		  483 | MBEDTLSFLASHMEM static void ssl_calc_verify_tls( mbedtls_ssl_context *, unsigned char * );
			  |                                                                         ^~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:1090:90: warning: argument 2 of type 'unsigned char[32]' with mismatched bound [-Warray-parameter=]
		 1090 | MBEDTLSFLASHMEM void ssl_calc_verify_tls_sha256( mbedtls_ssl_context *ssl, unsigned char hash[32] )
			  |                                                                            ~~~~~~~~~~~~~~^~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:490:79: note: previously declared as 'unsigned char *'
		  490 | MBEDTLSFLASHMEM static void ssl_calc_verify_tls_sha256( mbedtls_ssl_context *,unsigned char * );
			  |                                                                               ^~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:1111:90: warning: argument 2 of type 'unsigned char[48]' with mismatched bound [-Warray-parameter=]
		 1111 | MBEDTLSFLASHMEM void ssl_calc_verify_tls_sha384( mbedtls_ssl_context *ssl, unsigned char hash[48] )
			  |                                                                            ~~~~~~~~~~~~~~^~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:496:80: note: previously declared as 'unsigned char *'
		  496 | MBEDTLSFLASHMEM static void ssl_calc_verify_tls_sha384( mbedtls_ssl_context *, unsigned char * );
			  |                                                                                ^~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c: In function 'ssl_calc_verify_tls_sha384':
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:1120:5: warning: 'mbedtls_sha512_finish_ret' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
		 1120 |     mbedtls_sha512_finish_ret( &sha512, hash );
			  |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:1120:5: note: referencing argument 2 of type 'unsigned char *'
		In file included from F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\mbedtls/ssl_internal.h:43,
						 from F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:48:
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\mbedtls/sha512.h:128:21: note: in a call to function 'mbedtls_sha512_finish_ret'
		  128 | MBEDTLSFLASHMEM int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
			  |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c: In function 'ssl_calc_finished_tls_sha384':
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:5376:5: warning: 'mbedtls_sha512_finish_ret' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
		 5376 |     mbedtls_sha512_finish_ret( &sha512, padbuf );
			  |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:5376:5: note: referencing argument 2 of type 'unsigned char *'
		In file included from F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\mbedtls/ssl_internal.h:43,
						 from F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\ssl_tls.c:48:
		F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\FNET\src\third_party\mbedtls-2.12.0\src\mbedtls/sha512.h:128:21: note: in a call to function 'mbedtls_sha512_finish_ret'
		  128 | MBEDTLSFLASHMEM int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
			  |                     ^~~~~~~~~~~~~~~~~~~~~~~~~


[B]PNGenc library
[/B]	PNG encoder test sketch,
	T4.1, T3.6, T3.2
		PNGenc_Test: In function 'void* myOpen(const char*)':
		PNGenc_Test:30: warning: unsigned conversion from 'int' to 'uint8_t' {aka 'unsigned char'} changes value from '513' to '1' 
		   30 |   myfile = SD.open(filename, O_READ| O_WRITE | O_CREAT);
		PNGenc_Test: In function 'void setup()':
		PNGenc_Test:63: warning: unused variable 'x' 
		   63 | int rc, iDataSize, x, y;
			  |                    ^
		PNGenc_Test:63: warning: unused variable 'y' 
		   63 | int rc, iDataSize, x, y;
			  |                       ^
		PNGenc_Test:101: warning: 'iDataSize' may be used uninitialized 
		  101 |             Serial.printf("%d bytes of data written to file in %d us\n", iDataSize, (int)l);
			  |             ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		In file included from D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\PNGenc.cpp:25:
		D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\png.inl: In function 'int PNG_addLine(PNGIMAGE*, uint8_t*, int)':
		D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\png.inl:338:94: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
		  338 |             if ((pImage->iHeaderSize + pImage->iCompressedSize + pImage->c_stream.total_out) > pImage->iBufferSize) {
			  |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
		D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\png.inl:357:98: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
		  357 |                 if ((pImage->iHeaderSize + pImage->iCompressedSize + pImage->c_stream.total_out) > pImage->iBufferSize) {
			  |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
		D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\png.inl: In function 'int PNG_addRGB565Line(PNGIMAGE*, uint16_t*, void*, int)':
		D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\png.inl:461:94: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
		  461 |             if ((pImage->iHeaderSize + pImage->iCompressedSize + pImage->c_stream.total_out) > pImage->iBufferSize) {
			  |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
		D:\Users\Merli\Documents\Arduino\libraries\PNGenc\src\png.inl:480:98: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
		  480 |                 if ((pImage->iHeaderSize + pImage->iCompressedSize + pImage->c_stream.total_out) > pImage->iBufferSize) {
			  |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

[B]Talkie[/B]:
	Toms-Diner sketch. T4.1, TLC using PWM = PASS
	
[B]Adafruit PWM Servo Driver Board[/B]
	pwmtest sketch: T4.1, T3.6, TLC:  PASS
	
[B]HM01B0[/B]: TMM = PASS

@brtaylor
	[B]Eigen library[/B] - eigen Example - a ton of errors - compiles fine in 1.57  - see attached file
 

Attachments

  • new 2.zip
    28.8 KB · Views: 139
Last edited:
TEENSYTHREADS
tests sketch
T4.x
Code:
Tests: In function 'void recursive_thread(int)':
Tests:123: warning: unused variable 'x' 
  123 |   char x[128]; // use up some stack space
      |        ^
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp: In member function 'void Threads::idle()':
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:682:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  682 |       if (! threadp[i]) continue;
      |       ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:683:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  683 |                         if (threadp[i]->sleep_time_till_end_tick > threadp[j]->sleep_time_till_end_tick) {
      |                         ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:715:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  715 |       if (! threadp[i]) continue;
      |       ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:716:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  716 |                         if (needs_run[i]) {
      |                         ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp: In member function 'char* Threads::threadsInfo()':
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:758:3: error: 'uint' was not declared in this scope; did you mean 'rint'?
  758 |   uint _buffer_cursor = 0;
      |   ^~~~
      |   rint
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:759:3: error: '_buffer_cursor' was not declared in this scope
  759 |   _buffer_cursor = sprintf(_buffer, "_____\n");
      |   ^~~~~~~~~~~~~~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp: At global scope:
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:371:13: warning: 'void context_pit_empty()' defined but not used [-Wunused-function]
  371 | static void context_pit_empty() {}
      |             ^~~~~~~~~~~~~~~~~

T3.6: similar but additional ones:
Code:
Tests: In function 'void recursive_thread(int)':
Tests:123: warning: unused variable 'x' 
  123 |   char x[128]; // use up some stack space
      |        ^
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp: In member function 'void Threads::idle()':
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:682:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  682 |       if (! threadp[i]) continue;
      |       ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:683:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  683 |                         if (threadp[i]->sleep_time_till_end_tick > threadp[j]->sleep_time_till_end_tick) {
      |                         ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:715:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  715 |       if (! threadp[i]) continue;
      |       ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:716:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  716 |                         if (needs_run[i]) {
      |                         ^~
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp: In member function 'char* Threads::threadsInfo()':
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:758:3: error: 'uint' was not declared in this scope; did you mean 'rint'?
  758 |   uint _buffer_cursor = 0;
      |   ^~~~
      |   rint
F:\arduino-1.8.19-1131\hardware\teensy\avr\libraries\TeensyThreads\TeensyThreads.cpp:759:3: error: '_buffer_cursor' was not declared in this scope
  759 |   _buffer_cursor = sprintf(_buffer, "_____\n");
      |   ^~~~~~~~~~~~~~
Error compiling for board Teensy 3.6
 
This is the joy of updating the toolchain. We get a ton of new compiler warnings about stuff that really should get updated. Most are probably harmless, but they're also probably about things that were never quite 100% correct but worked anyway.

I believe this warning is trying to tell us that the USBDrive class is too complicated to simply be cleared by memset(). Maybe it's because it inherits from 2 other classes? Maybe something about SdFat FsBlockDeviceInterface class matters?
Actually it is not clearing a class but a structure:
Code:
typedef struct {
	bool connected   = false; // Device is connected
	bool initialized = false; // Device is initialized
	bool mounted     = false; // Device is mounted
	const char * drvName = 0;
	uint32_t bufferSize = 0;
	uint8_t hubNumber;
	uint8_t hubPort;
	uint8_t deviceAddress;
	uint16_t idVendor;
	uint16_t idProduct;
	msSCSICapacity_t capacity;
	msInquiryResponse_t inquiry;	
} __attribute__((packed)) msDriveInfo_t;

Locally I removed the warning by casting it to (void*)
It is interesting that the disconnect does clear a few of members and then hits it with memset:
Code:
	msDriveInfo.connected = false;
	msDriveInfo.initialized = false;
	memset((void*)&msDriveInfo, 0, sizeof(msDriveInfo_t));
 
@KurtE
Tried your keyboard changes and yes the errors go away.

@Paul
Just tried MTP - Example 1. MTP_LittleFS using SPIFlash, got this for both the T4.1 and T3.6
Code:
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Storage.cpp: In member function 'bool MTPStorage::moveDir(uint32_t, char*, uint32_t, char*)':
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Storage.cpp:1444:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
 1444 |                 if (!f2) break; {
      |                 ^~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Storage.cpp:1444:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
 1444 |                 if (!f2) break; {
      |                                 ^
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetObjectInfo(MTP_class::MTPContainer&)':
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:60: warning: '%02u' directive output may be truncated writing between 2 and 3 bytes into a region of size between 2 and 5 [-Wformat-truncation=]
  522 |     snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                                            ^~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:42: note: directive argument in the range [0, 255]
  522 |     snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:42: note: directive argument in the range [0, 255]
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:13: note: 'snprintf' output between 16 and 21 bytes into a destination of size 16
  522 |     snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  523 |              dtf.year + 1900, dtf.mon + 1, dtf.mday, dtf.hour, dtf.min,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  524 |              dtf.sec);
      |              ~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:60: warning: '%02u' directive output may be truncated writing between 2 and 3 bytes into a region of size between 2 and 5 [-Wformat-truncation=]
  530 |     snprintf(mtimebuf, sizeof(mtimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                                            ^~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:42: note: directive argument in the range [0, 255]
  530 |     snprintf(mtimebuf, sizeof(mtimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:42: note: directive argument in the range [0, 255]
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:13: note: 'snprintf' output between 16 and 21 bytes into a destination of size 16
  530 |     snprintf(mtimebuf, sizeof(mtimebuf), "%04u%02u%02uT%02u%02u%02u",
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  531 |              dtf.year + 1900, dtf.mon + 1, dtf.mday, dtf.hour, dtf.min,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  532 |              dtf.sec);
      |              ~~~~~~~~
Opening Teensy Loader...
Memory Usage on Teensy 4.1:
  FLASH: code:97276, data:13524, headers:9004   free for files:8006660
   RAM1: variables:14816, code:89384, padding:8920   free for local variables:411168
   RAM2: variables:28800  free for malloc/new:495488
 
Any chance these lines might be upsetting the compiler?

Code:
	const char * drvName = 0;
	uint32_t bufferSize = 0;

Not sure, I figured it was more likely that it contained two other structures.
Will experiment later. As I mentioned I simply cast the pointer to void* in the memset.
 
@mjs513 working on mtp code...

The one if looks strange, moved { to next line will see


@KurtE
Tried your keyboard changes and yes the errors go away.

@Paul
Just tried MTP - Example 1. MTP_LittleFS using SPIFlash, got this for both the T4.1 and T3.6
Code:
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Storage.cpp: In member function 'bool MTPStorage::moveDir(uint32_t, char*, uint32_t, char*)':
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Storage.cpp:1444:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
 1444 |                 if (!f2) break; {
      |                 ^~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Storage.cpp:1444:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
 1444 |                 if (!f2) break; {
      |                                 ^
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetObjectInfo(MTP_class::MTPContainer&)':
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:60: warning: '%02u' directive output may be truncated writing between 2 and 3 bytes into a region of size between 2 and 5 [-Wformat-truncation=]
  522 |     snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                                            ^~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:42: note: directive argument in the range [0, 255]
  522 |     snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:42: note: directive argument in the range [0, 255]
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:522:13: note: 'snprintf' output between 16 and 21 bytes into a destination of size 16
  522 |     snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  523 |              dtf.year + 1900, dtf.mon + 1, dtf.mday, dtf.hour, dtf.min,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  524 |              dtf.sec);
      |              ~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:60: warning: '%02u' directive output may be truncated writing between 2 and 3 bytes into a region of size between 2 and 5 [-Wformat-truncation=]
  530 |     snprintf(mtimebuf, sizeof(mtimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                                            ^~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:42: note: directive argument in the range [0, 255]
  530 |     snprintf(mtimebuf, sizeof(mtimebuf), "%04u%02u%02uT%02u%02u%02u",
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:42: note: directive argument in the range [0, 255]
D:\Users\Merli\Documents\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:530:13: note: 'snprintf' output between 16 and 21 bytes into a destination of size 16
  530 |     snprintf(mtimebuf, sizeof(mtimebuf), "%04u%02u%02uT%02u%02u%02u",
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  531 |              dtf.year + 1900, dtf.mon + 1, dtf.mday, dtf.hour, dtf.min,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  532 |              dtf.sec);
      |              ~~~~~~~~
/CODE][/QUOTE]

As for the snprintf, I am not sure how to fix.
[CODE]    breakTime(dt, dtf);
    snprintf(ctimebuf, sizeof(ctimebuf), "%04u%02u%02uT%02u%02u%02u",
             dtf.year + 1900, dtf.mon + 1, dtf.mday, dtf.hour, dtf.min,
             dtf.sec);
It is complaining that for example dtf.mday is a byte that it might get trancated... But the last time I checked there are no months that have 100+ days in them ;)
 
@Paul, @KurtE and all
Test 3 of the latest sketches we have been working on. Wacom tablets, keyboard HID updates and a unique sketch. Mostly anti-aliasing warnings in USBHost but for the custom sketch getting an
Code:
relocation truncated to fit: R_ARM_PREL31 against symbol

for the T4.x boards.

@Paul ----- Was able to duplicate the error with a simple sketch using a simple vector example. If you run the following code it will compile and run correctly:
Code:
#include <Streaming.h>
#define cout Serial

#include <vector>
using namespace std;

void setup() {
  cout.begin(9600 && millis() < 5000);

 // initializer list
  std::vector<int> vector1 = {1, 2, 3, 4, 5};

  // uniform initialization
  std::vector<int> vector2{6, 7, 8, 9, 10};

  // method 3
  std::vector<int> vector3(5, 12);

  cout << "vector1 = ";

  // ranged loop
  for (const int& i : vector1) {
    cout << i << "  ";
  }

  cout << "\nvector2 = ";

  // ranged loop
  for (const int& i : vector2) {
    cout << i << "  ";
  }

  cout << "\nvector3 = ";

  // ranged loop
  for (int i : vector3) {
    cout << i << "  ";
  }

  // add the integers 6 and 7 to the vector
  //vector1.push_back(6);
  //vector1.push_back(7);

  cout << "\nUpdated Vector: ";

  for (const int& i : vector1) {
    cout << i << "  ";
  }


  
}

void loop() {
  // put your main code here, to run repeatedly:

}
If you uncomment the lines with vector1.push_back it will throw those errors but no clue how to fix. Trying to read google some say it was fixed with -fno-exceptions but after pointing to that it might be a linker error.

REF
https://forum.pjrc.com/threads/67252-Teensyduino-1-54-Beta-9?p=279446&viewfull=1#post279446
https://forum.pjrc.com/newreply.php?do=newreply&p=279491
and solution from @luni
https://forum.pjrc.com/threads/67252-Teensyduino-1-54-Beta-9?p=279492&viewfull=1#post279492
 
Last edited:
Short start here ... got working IDE2 here yesterday {changed temp to SSD as the virtual drive still fails IDE2 exec issue still unresolved}

Will work in that: Processing Teensy:1.58beta1 Update - Complete!

Have a short time before appointment ...

Teensy Ports not showing and listing my COM22 T_4.1 :: Until AFTER first build completed

Arrrgh: MalwareBytes: C:\Users\Tim\AppData\Local\Arduino15\packages\teensy\tools\teensy-tools\1.58.0-beta1\teensy_secure.exe, Quarantined


One trivial sketch built - no issues: <edit>: 2nd Trivial (recent forum sketch) Built no issue
Code:
...
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\[B][U]tools\\teensy-compile\\11.3.1-beta1[/U][/B]/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino-sketch-E1B3EECC1650D6906DB7D70C450F1634/InterruptTest.ino.elf" "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino-sketch-E1B3EECC1650D6906DB7D70C450F1634/InterruptTest.ino.hex"
...

NOTE [ Win 11 IDE2_rc9.3 ]:
'Serial Ports : Com22' :: WILL reconnect on button press or Upload >> IDE2 Indicates 'no board', then restores connection
'Teensy Ports : Com22' :: Does NOT auto-reconnect after Upload or Button. Require manually 'Close / Reopen' SerialMonitor in IDE
 
Fixed the issues in MTP_Teensy in my try_auto_detect_sd_media branch.
Code:
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wformat-truncation" /* Or "-Wformat-truncation" */
...
  #pragma GCC diagnostic pop

also moved the if(x) break; {
moved { to next line... Probably could remove the brackets.

EDIT: Built using IDE2
 
Back
Top