Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - jnewcomb

Pages: [1]
1
µTasker general / uTaskerFileCreate.exe - application error
« on: March 17, 2010, 05:42:45 PM »
Hello,
Having a problem with uTaskerFileCreate.exe generating an application error.
I have put together a test case that shows an example of it crashing.
Run the 'RunMe.bat' file

. The table generated looks like this:
static const USER_FILE user_files[] = {
{"eimg.jpg", (unsigned char *)_eimg, sizeof(_eimg), MIME_JPG, FILE_VISIBLE},
{"fimg.jpg", (unsigned char *)_fimg, sizeof(_fimg), MIME_JPG, FILE_VISIBLE},
{"gimg.jpg", (unsigned char *)_gimg, sizeof(_gimg), MIME_JPG, FILE_VISIBLE},
{"himg.jpg", (unsigned char *)_himg, sizeof(_himg), MIME_JPG, FILE_VISIBLE},
{"iimg.jpg", (unsigned char *)_iimg, sizeof(_iimg), MIME_JPG, FILE_VISIBLE},
{"jimg.jpg", (unsigned char *)_jimg, sizeof(_jimg), MIME_JPG, FILE_VISIBLE},
{"kimg.jpg", (unsigned char *)_kimg, sizeof(_kimg), MIME_JPG, FILE_VISIBLE},
{"limg.jpg", (unsigned char *)_limg, sizeof(_limg), MIME_JPG, FILE_VISIBLE},
{"mimg.jpg", (unsigned char *)_mimg, sizeof(_mimg), MIME_JPG, FILE_VISIBLE},
{"nimg.jpg", (unsigned char *)_nimg, sizeof(_nimg), MIME_JPG, FILE_VISIBLE},
{"oimg.jpg", (unsigned char *)_oimg, sizeof(_oimg), MIME_JPG, FILE_VISIBLE},
{"pimg.jpg", (unsigned char *)_pimg, sizeof(_pimg), MIME_JPG, FILE_VISIBLE},
{"qimg.jpg", (unsigned char *)_qimg, sizeof(_qimg), MIME_JPG, FILE_VISIBLE},
{"rimg.jpgÿØÿà JFIF   d d  ÿì Ducky     d  ÿî Adobe dÀ   ÿÛ „ {0} // end of list
};


If you comment out any one of the jpg files in userfiles.txt, the problem goes away.

Has anyone managed to work around this one or knows what causes the application error?
Thanks.

2
µTasker general / Fast task response to an interrupt
« on: February 10, 2010, 08:12:03 PM »
Hi, been playing around with the demo application and like the way it can easily give us all the bells and whistles we need for our project - file system, webserver, usb, tcp, bootloader and so on.. all with a neat little scheduler that fits my preferred programming model of event based state machines.

As an aside, a table driven hierarchical state machine I have used in the past...
http://embedded.com/design/10700829

My past projects tend to run a pre-emptive RTOS - and for most of the 'executing time', they don’t need to. Agreed.
There is one case where I have relied on pre-emption to meet some tight real time constraints - and can't see an obvious solution using the uTasker scheduler. Really I'm looking for some tips/tricks/strategies on if/how I can solve these problems.

It concerns situations, for example,  when external devices give an interrupt to signal they need additional attention - and fairly quickly. A 'hypothetical example' is the SPI CAN driver chip MCP2515. It lets me know a message is waiting in the RX buffer - but I cant read the buffer from within the ISR (SPI comms within an ISR is not good practice!) .. If I leave it too late the buffer gets ovewritten.
So, what I do is have the ISR post an event to a task called 'ReadMCP2515_RxBuf'. The 'ReadMCP2515_RxBuf' task reads out the contents of the buffer over the SPI and places it in a FIFO in RAM for other tasks to consume as and when they can. (Assume CAN messages arrive in bursts)

Most of the time all tasks are waiting on a empty queue, so the real time requirement is met, but there will be conditions where this clashes with a periodic task, such as an ADC read - that in turn will start a flurry of message activity between tasks - status updates, LCD updates.. etc. all the time our 'ReadMCP2515_RxBuf' is not getting any service. (No one said event driven programming was easy!)
Ideally the current SPI operation finishes its chip select - (this could include an LCD update OR and an ADC read..) then the 'ReadMCP2515_RxBuf' should get started as soon as possible.

What are community members thoughts on tacking such an issues?
Multiple entries of 'ReadMCP2515_RxBuf' task in the table of tasks to be run?? That sort of thing??
Thanks,
Jon.

Pages: [1]