Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Spontaneous ASSERTs

Altera_Forum
Honored Contributor II
914 Views

Hi! 

 

I have a program with 10 tasks (8 + idle + main) and 2 interrupt sources. 

 

The fact is that sometimes I get ASSERTs from eCos differents functions of the SO. Sometimes is from dlmalloc.cxx, when I tree to free, sometimes (don't remember exactly) is from smp.hxx (I only have one CPU, so it shouldn't be any problem), and other stange things... 

 

The fact is that sometimes, when I run it in debug mode, it works OK. And many times, if I add a printf or another instruction, the problem disappears. 

 

I've tried to disable all interrupt sources (except INTERNAL TIMER) in order to prevent any interrupt to corrupt the stack or else, but it does the same. 

 

If anyone has any idea about what can be happening, or how to find the REAL problem... 

 

Thanx 

 

Alex
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
201 Views

What NIOS II core uses? 

May be this behaviour can be connected with the DCache memory? 

Try to increase a size of DCache, for localization of the given problem.
0 Kudos
Altera_Forum
Honored Contributor II
201 Views

I use the Nios II standard core. That is, without DCache. I used fast core a month ago, and I was having problems with DCache, so I decided to use standard core until I am "ready" to use DCache. 

 

So I suppose DCache is not the problem. 

 

From what I've seen until now, it seems that sometimes, when a task calls a function, the parameters passed to it seem to be corrupted. As the parameters are passed through the registers, I'm trying to find if any interrupt or task can corrupt the stack data, or something. How can I debug it? :-? 

 

Thank you 

 

aLeX
0 Kudos
Altera_Forum
Honored Contributor II
201 Views

Hi! 

 

Call me paranoid, but I have disabled the "Scheduler timeslicing" option in the "eCos kernel" -> "Kernel Schedulers" configuration tool, and now it seems to work fine ("it seems"). 

 

Anyone is using Multi-level queue scheduler with timeslicing enabled? 

 

aLeX 

 

P.D: I had timeslicing every 50 ticks, one tick per milisecond.
0 Kudos
Reply