Hi all,
first of all, thanks Paul for the Teensy. It is an amazing product with great features. Keep going!
And now the issue I currently have:
I want to control the signals on my model railway with a Teensy connected to a Roco z21 digital station via Ethernet. There is a simple protocol where the z21 spits out whatever happens (especially what turnout has toggled) and the Teensy then figures out what signal to set to red/green.
That code exists in form of a Visual Studio C++ project on Windows and everything works fine.
After some migration work and downgrading to C++14, I managed to compile everything with Visual Micro with the following output:
Notice the really tight space for remaining local variables.
After some playing around, I noticed that switching from QNEthernet to NativeEthernet, the issue goes away and I have plenty of space for local variables:
So overall, QNEthernet takes up about 80k more space than NativeEthernet. Any ideas?
Looking at the numbers, my code seems to be heavy on the code side (I use some rtti, but have not found out how heavy it really is), but I am happy with 500k heap and 70k for futher development
Here is the gcc command line for the ino.file:
Other libraries currently in use are SPI, SDFat and TeensyDebug. The rest is my stuff.
Thanks
Daniel
first of all, thanks Paul for the Teensy. It is an amazing product with great features. Keep going!
And now the issue I currently have:
I want to control the signals on my model railway with a Teensy connected to a Roco z21 digital station via Ethernet. There is a simple protocol where the z21 spits out whatever happens (especially what turnout has toggled) and the Teensy then figures out what signal to set to red/green.
That code exists in form of a Visual Studio C++ project on Windows and everything works fine.
After some migration work and downgrading to C++14, I managed to compile everything with Visual Micro with the following output:
Code:
teensy_size*: Memory Usage on Teensy 4.1
teensy_size*: FLASH: code:381984, data:50820, headers:8472 free for files:7685188
teensy_size*: RAM1: variables:140128, code:379232, padding:13984 free for local variables:-9056
teensy_size*: RAM2: variables:24736 free for malloc\new:499552
Notice the really tight space for remaining local variables.
After some playing around, I noticed that switching from QNEthernet to NativeEthernet, the issue goes away and I have plenty of space for local variables:
Code:
teensy_size*: Memory Usage on Teensy 4.1
teensy_size*: FLASH: code:363232, data:41940, headers:8940 free for files:7712352
teensy_size*: RAM1: variables:60740, code:360496, padding:32720 free for local variables:70332
teensy_size*: RAM2: variables:24768 free for malloc\new:499520
So overall, QNEthernet takes up about 80k more space than NativeEthernet. Any ideas?
Looking at the numbers, my code seems to be heavy on the code side (I use some rtti, but have not found out how heavy it really is), but I am happy with 500k heap and 70k for futher development
Here is the gcc command line for the ino.file:
Code:
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++"
-c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16
-D__IMXRT1062__ -DTEENSYDUINO=155 -DARDUINO=108016 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_DUAL_SERIAL -DLAYOUT_US_ENGLISH
"-IC:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug/pch"
-I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" -I"c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\itelwv1j.wbw\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\NativeEthernet\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FNET\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" -I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\libwinston" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\winston" -frtti -I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\libwinston" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\winston"
-DVM_DEBUG_BREAKPAUSE -DVM_DBT=VM_DBT_GENERIC_OBJECT -DVM_DEBUGGER_SOFT_TRANSPORT_WRITER=Serial -DVM_DEBUGGER_SOFT_TRANSPORT=Serial -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=100 -DVM_DEBUG -DVM_DEBUG_ENABLE=1 -DVM_DBT_GENERIC_OBJECT=21 -DVM_DBT_NO_SERIAL=20 -DVM_DBT_MS430_SERIAL_=19 -DVM_DBT_SERIALUSB=18 -DVM_DBT_USBAPI=17 -DVM_DBT_NET_UDP=16 -DVM_DBT_HARDWARESERIAL3=15 -DVM_DBT_HARDWARESERIAL2=14 -DVM_DBT_HARDWARESERIAL1=13 -DVM_DBT_CDCSerialClass=12 -DVM_DBT_COSA=11 -DVM_DBT_Uart=10 -DVM_DBT_NET_CONSOLE=9 -DVM_DBT_TTYUART=8 -DVM_DBT_USBSERIAL=7 -DVM_DBT_USART=6 -DVM_DBT_UART=5 -DVM_DBT_TEENSY=4 -DVM_DBT_USB=3 -DVM_DBT_FASTSERIAL=2 -DVM_DBT_SOFTWARESERIAL=1 -DVM_DBT_HARDWARESERIAL=0 -DWINSTON_PLATFORM_TEENSY -DTCB_SPAN_NAMESPACE_NAME=std
-I"C:\Users\daniel\Documents\Arduino\libraries\TeensyDebug\src" "C:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug\winston-hal-teensy.cpp" -o "C:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug\winston-hal-teensy.cpp.o"
Other libraries currently in use are SPI, SDFat and TeensyDebug. The rest is my stuff.
Thanks
Daniel