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

Thread: Hitting some kind of limit on the Teensy 4.0

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    3

    Hitting some kind of limit on the Teensy 4.0

    I'm trying to create a scripting environment running on the teensy 4.0 based on https://github.com/TonicAudio/Tonic, https://github.com/AnthonyDiGirolamo/lua-teensyduino and https://github.com/satoren/kaguya.
    Basically it works but as i define more bindings i seem to hit some kind of limit that i don't understand and the Teensy 4.0 freezes without executing any code from my sketch. The code i'm talking about can be found here: https://github.com/kallaballa/Farts/tree/kaguya but it's rather messy and huge. The problem arises when i add another (no matter how small) binding definition in https://github.com/kallaballa/Farts/.../tonic_lua.cpp. The bindings seem to be correct, after checking them over and over again. when i compile them on my PC (x86_64) it works. I think i'm hitting some kind of limit that i don't understand.

    Attached you'll find the map file and the output of arm-none-eabi-size command for a case where the teensy freezes and one case where it just runs fine.

    Why is the teensy freezing right after upload?
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Oct 2019
    Posts
    3
    Well... still no solution but i think i know now that I'm not exceeding stack limits. i enabled -fstack-usage to get a csv file with stack usage information per function. the "bind" function (https://github.com/kallaballa/Farts/...nic_lua.cpp#L7) that causes the problem had the largest usage, so i splitted it up int 6 functions but the teensy still freezes when i enable all binding definitions.

    btw. to sort the .su file i used following command:
    Code:
    awk  '{FS="\t"; OFS=" "; print $2,$1}' "$SUFILE" | sort -n | less

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Posts
    3
    In addition i lowered the max stack of the lua interpreter from 250 to 10. to no avail.

Posting Permissions

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