Brendan Fennell <brendan.fenn...@gmail.com> 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: cyg_scheduler_start(); Your program should then run as expected. -- Nick Garnett eCos Kernel Architect eCosCentric Limited http://www.eCosCentric.com 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: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss