Why is my function terminated early?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have a function that's interacting with a serial NOR flash chip over SPI. But every time it executes, it seems like it's terminated early after a second or so. I noticed this because it would be printing out messages, and then all of a sudden stop and the messages from the next function starts to print. I don't even know where to begin troubleshooting this. Is there a length limit on how long a function would run? I'm using ThreadX by default and not using any thread management functions yet. I also noticed that the problem went away when I put the device under GDB. It seems like having breakpoints in the middle of the function forces it to run till completion. Any ideas why?

0 Likes
1 Solution
Anonymous
Not applicable

I think it was because the thread ran out of stack space. I changed the application stack size to 8k and it's working now.

View solution in original post

2 Replies