Re: Idle thread vanished!!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Brendan Fennell <brendan.fennell@xxxxxxxxx> writes:

> Hello,
> I'm trying to bring up eCos on an ARM9 board, the starting point I
> have is a port for Redboot but I would like to use the full feature
> set of eCos. I have put together a configuration which I can program
> to the board and have basic I/O over serial.
> The main entry point for my code 'cyg_start' runs as expected but the
> thread I create does not start. I enabled debug trace and the first
> assert I get is "ASSERT FAIL: <2>mlqueue.cxx[265]void
> Cyg_Scheduler_Implementation::add_thread() Idle thread vanished!!!"
> Can anyone tell me why I would get the ASSERT above?
> thanks,
> Brendan.
> ========= code ===========
> voidÂcyg_start(void)
> {
> ÂÂ ÂunsignedÂcyg_start_count = 0;
> ÂÂ Âdiag_printf("Hello from cyg_start: #%u\n", cyg_start_count++);
> ÂÂ Âcyg_thread_create(1,Âtestthd_main, (cyg_addrword_t) 0, "testthd",
> ÂÂ Â Â Â Â Â Â Â Â Â Â(void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]);
> ÂÂ Âcyg_thread_resume(thread[0]);
> ÂÂ Âfor(;;)
> ÂÂ Â{
> ÂÂ Â Â Âcyg_thread_delay (100);
> ÂÂ Â}
> }

You cannot do the above. cyg_start() runs before the scheduler
starts. In fact, you have to start it yourself here. So replace the
for(;;) loop with:


Your program should then run as expected.

Nick Garnett                                      eCos Kernel Architect
eCosCentric Limited      The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.     Tel: +44 1223 245571
Registered in England and Wales:                        Reg No: 4422071

Before posting, please read the FAQ:
and search the list archive:

[Linux Embedded]     [U-Boot V2]     [Linux Kernel]     [Linux MIPS]     [Linux ARM]     [Linux for the Blind]     [Linux Resources]     [Photo]     [Yosemite]     [ISDN Cause Codes]     [ECOS Home]

Add to Google Powered by Linux