Embedded / RTOS

Moderators: None (Apply to moderate this forum)
Number of threads: 373
Number of posts: 682

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Host controlled embedded testing Posted by atmosphere on 30 May 2007 at 6:18 AM
Hi,

I am designing a driver (to run on my HCS08) for communicating with a controller program (running on the PC) via a serial link. The purpose of this is to invoke test functions on the target from the host.

I've come up with a layout for the driver however for the test functions I want to allow any number and any type of arguments and return type. To that end I've created a wrapper structure to store a pointer ( void (*)(void) ) to my test function as well as an enumeration to store what the real underlying function that pointer points to. I then store an array of pointers to possible handler functions for each type combination of arguments and use the enumeration as an offset into the array.

Now this makes the code a little bloated, and since I'm very new to embedded development I'm sure there is something I am missing (an easier way to implement this) or haven't thought of. My questions is, has anyone had any experience with this kind of development (host/target automated embedded testing, or specific to the example I gave: implementing an RMI style system but with embedded systems) ? I'm open to all suggestions,input or comments.

Thanks
Report
Re: Host controlled embedded testing Posted by Lundin on 3 Jun 2007 at 11:39 PM
: Hi,
:
: I am designing a driver (to run on my HCS08) for communicating with
: a controller program (running on the PC) via a serial link. The
: purpose of this is to invoke test functions on the target from the
: host.
:
: I've come up with a layout for the driver however for the test
: functions I want to allow any number and any type of arguments and
: return type. To that end I've created a wrapper structure to store a
: pointer ( void (*)(void) ) to my test function as well as an
: enumeration to store what the real underlying function that pointer
: points to. I then store an array of pointers to possible handler
: functions for each type combination of arguments and use the
: enumeration as an offset into the array.
:
: Now this makes the code a little bloated, and since I'm very new to
: embedded development I'm sure there is something I am missing (an
: easier way to implement this) or haven't thought of. My questions
: is, has anyone had any experience with this kind of development
: (host/target automated embedded testing, or specific to the example
: I gave: implementing an RMI style system but with embedded systems)
: ? I'm open to all suggestions,input or comments.
:
: Thanks
:


I'm still not sure why you need to have the same functions on the micro and the PC, or is this not the case? The usual approach is:

Fancy GUI PC program -> some communication protocol -> serial com routines -> send protocol -> check protocol in the mcu -> parse the data -> do something with the data, which is independent from the PC program.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.