Host controlled embedded testing - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Host controlled embedded testing

atmosphereatmosphere Posts: 3Member
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

Comments

  • LundinLundin Posts: 3,711Member
    : 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.

Sign In or Register to comment.