Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Functions are not getting called even if they are called in Nios II S/W Design/Code

Hi all,

I am new to NIOS but I am trying to learn it. I have written a code, which is having multiple functions, some of the functions are calling other functions. Now here the problem starts, as I am calling other functions from inside of another function, many times the called functions are not getting called or executed. This I have completely verified by observation in the Signal Tap(I am Using PIOs).

For Example: There is a Write Function, One Read Function and a Delay Function. Whenever I am calling Delay Function inside a Write/Read Function, it is not getting called. I don't know the reasons of it but I am attributing it to Stack Overflow or Usage of 100MHz clock in NIOS.

Please help me in finding the reasons for it and a possible solution.

Regards,

Dindayal

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    could you please post some code?!

    Does your NIOS II is configured with data-cache?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes NIOS is configured with 2k of Data Cache and 4k of Instruction Cache. I am attaching the code.

    The problem which I am facing is that whenever I am calling the delay_1us() function, it is not getting called and this is leading to incorrect writing/reading from Single Wire Interface. I don't know the reason of this, it might be because of Stack issues.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    How do you notice the function not been called? you print something or breakpoint in that function?