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

Thread: Teensy Call Stack

  1. #1
    Junior Member
    Join Date
    Jul 2021
    Posts
    19

    Teensy Call Stack

    I'm struggling to get TeensyDebug running.
    (see https://forum.pjrc.com/threads/67867...ebug-and-Audio if you're interested. The title says "VisualTeensy" but I'm actually back to Teensyduino, just to reduce the unknowns. Still can't get it to work.)

    So, as a work-around - would it be possible to send the current call-stack info out via Serial, e.g. when my app receives a certain point of interest? i.e.: can my app read the call-stack somehow?

  2. #2
    Junior Member
    Join Date
    Jul 2021
    Posts
    19
    I looked into this a little bit more.
    I read the stack pointer using __get_MSP() in .\hardware\teensy\avr\cores\teensy4\cmsis_gcc.h . I think it works, the values looked believable

    But then you have to interpret the stack to extract the function call return addresses, looks like. I didn't go too far with this but it looks like quite a job. The easiest might be to re-use some gdb code...?

    But unfortunately I don't have time to do this at the moment so I'll have to leave it here

Posting Permissions

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