Different applications on same custom board


We have a custom board with S128 MCU. We have different applications for the same board for different customers. I want to split the driver side from the application side. I want to create a board project; make all necessary clock, pin, and driver initialization on that project and provide a simple API. Thanks to that API, the application project will use this API to control the hardware. I don't want to keep copy-paste all the thread synchs, BSP configuration, etc. to just writing to external flash.

Any example or a kick start idea would be really helpful.

  • You can flash as many projects as you want to a single processor; just flash your first project with all the common stuff first at 0x, then flash the app project past that project, say at 0x20000. How you make them link dynamically is up to you.
    Personally, I would just have teo Ecplipse projects - the common part and then app part, bring them into the dame workspace, and flash them as one and forget all that api layer.
  • You could create a Synergy library project that contains the Synergy configuration, and an application project that references this Synergy library project. This is detailed in the e2studio help for Synergy :-




  • My suggestions are:
    * set up your project to have a BSP library project that contains the board config separate from your product code in the main executable project
    * write a code layer that is a thin wrapper to the Synergy interfaces such that pertains specifically to your hardware

    It's up to you whether you put that code layer in the library or your main executable project. If you think you can write it well and not need to change it frequently, maybe put it in the library so that everything hardware is together. What I'm working on now, we have such a layer in our main executable project because we really just wanted to stop the IDE rebuilding the synergy code so often. If you do keep it out of the BSP library, maybe consider making it its own project that can be shared across your different projects?
  • Thanks for all the answers. Having a separate library project other than a static library project would be better. This way I can update the BSP project across all projects without rebuilding and transferring the library.
    What troubles me is ThreadX. Thread counts are different for different projects, some projects may use 5 threads other needs only 3. Therefore I couldn't define threads in the BSP project, they should be specific to the application. I can define threads in the application project but drivers and frameworks should be defined on the BSP project. How can I do this?
    Let me clarify the problem:
    - Don't want to define drivers, frameworks, pin configuration, etc. in each project.
    - Want to have different threads for each project.
  • In reply to emree:

    You don't have to use configuration.xml to create threads, you can do it through the ThreadX API. It'll be a bit of work to set up that configuration.xml would otherwise have hidden for you.
  • In reply to emree:

    As some mentioned, you can create threads with regular ThreadX calls, not using the "graphical" widget that puts them in the project config and autogens the thread entry.

    Note that your note about "define drivers, ... pin configs, etc" cannot be done in two projects unless you are writing a bootloader project that starts up the board and jumps to an application project via the reset vector, which would then redo all the pin config, startup code, etc. This would be the traditional way of keeping a bootloader that always comes up and accepts new code over a network, sd, usb, etc. which is what I'd recommend you do.