Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12455 Discussions

Is it possible to break out of a function after X amount of time has passed?

JWall40
Beginner
397 Views

I have a function at the start of my main loop that is updating some local buffers from an ethernet interface.

The problem is, sometimes this hangs and takes about 50x the amount of time it should and disrupts other parts of my program. I'd like to create something which breaks out of this function if, for example, 100uS has passed. 

Is this possible on the nios2 processor? I guess if so, I would first need to implement a timer peripheral, but I'm not sure how I could use this to break the function call and return to outside of the function.

Any suggestions are much appreciated. Thanks for reading

0 Kudos
1 Solution
BoonBengT_Intel
Moderator
381 Views

Hi @JWall40,

 

Thank you for posting in Intel community forum and hope all is well.
If I understand your doubts correctly, you can look into using the internal timer core with irq enable for your purpose.

 

More details can be found here in explaining the behavior and functions.
And to implement it, perhaps you can refer to the started steps by step example here.
Hope that clarify your doubts.

 

Best Wishes
BB

View solution in original post

4 Replies
BoonBengT_Intel
Moderator
382 Views

Hi @JWall40,

 

Thank you for posting in Intel community forum and hope all is well.
If I understand your doubts correctly, you can look into using the internal timer core with irq enable for your purpose.

 

More details can be found here in explaining the behavior and functions.
And to implement it, perhaps you can refer to the started steps by step example here.
Hope that clarify your doubts.

 

Best Wishes
BB

BoonBengT_Intel
Moderator
359 Views

Hi @JWall40,

 

Good day, just checking in to see if there is any further doubts in regards to this matter.
Hope we have clarify your doubts.

 

Best Wishes
BB

JWall40
Beginner
348 Views

Yes, all sorted now. Thanks for your help! 

BoonBengT_Intel
Moderator
338 Views

Great! Good to know that it is working now, with no further clarification on this thread, it will be transitioned to community support for further help on doubts in this thread, where we will no longer monitor this thread.
Thank you for the questions and as always pleasure having you here.

 

Best Wishes
BB

Reply