UnixDev
New Contributor
1 month agoeCoS OS throws execption when freeing memory
We have a firmware applicaiton that makes use of eCoS RtoS and NIOSII core. We have a logic that we first allocate memory dynamically and then if required delete the previous allocated memory and allocate bigger one - this step goes on until requirement is met. But we are observing exception from eCos during execution of these steps - in other words say when we ietrate over the above logic for 7th time, while freeing memory that time we get exception but allocation which is done prior to free succeeds:
ExceptionHandler(data = 0x0, exception_number = 0x0, info = 0x017FFF74)
cyg_hal_exception_handler(regs = ???)
_software_exception_handler(asm)
exception
Cyg_Mempool_dlmalloc_Implementation::free(this = 0x0158AD40, mem = ???, unnamed = ???)
Cyg_Mempolt2<Cyg_Mempool_dlmalloc_Implementation>::free(this = 0x0158AD40, p = ???, size = ???)
free(ptr = ???)
npfree(ptr = 0x017136A0)
vf_free_buffer(buffer = 0x017136A0, size = 0x0007E000)
vfwrite_locked(buf = 0x016956B0, size = 0x1, items = 0x0400, vfd = 0x01696F10)
vfwrite(buf = 0x016956B0, size = 0x1, items = 0x0400, vfd = 0x01696F10)
getfile(asm)
WriteFileToFlash(notUsed = 0x0)
ecos_thread_entry(entry = 0x0D)
Cyg_Scheduler_Base::get_current_thread(inline)
Cyg_Thread::self(inline)
Cyg_Thread::exit(inline)
Cyg_HardwareThread::thread_entry(thread = 0x01262448)
end of frameCan anyone please let me know why exception is thrown at later part of step process execution and what the fix for this issue?