This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A question with SimpleApp workspace in IAR workbench

Other Parts Discussed in Thread: Z-STACK

In SimpleApp workspace,  we have 8 options to choose, as illustrated in the attached image below. Each time I choose a different one, I did not see any change in  associated files. In fact, All the 8 options share the same files. 

Can anyone tell me how to create these 8 options and how different options affect the code differently? For example, when I switch from simplecontrollerDB to simpleControllerEB, which part has changed to cater to different hardware?


  • Hi,

    The Z-Stack source code contains a mountain of conditional compilation switches. It will drive you crazy to start will and then you'll learn to live with it. It has to be this way because of the limited amount of flash and ram on the target processor.

    The "8 options" are different target builds. The main difference between them is in the compiler switches defined for each. If you look in the Project->Options->C++Compiler->Preprocessor the first defined symbol (CC2430BB say) defines the target hardware for the build.

    The next major difference is to decide if the target is to be an end node, router or coordinator. This is controlled by Project->Options->C++Compiler->Extra Options and Linker->Extra Options.

    The same mechanism is used to control the inclusion/exclusion of security, ZDO capabilities, the diagnostic interface, it's a masterpiece of confusion.

    You need to be very careful when you change these switches (as you will) that you make sure you do it consistently across all builds.

    The only two important build files are the .ewp and .ewd. I keep a "master copy" of these. When I need to create a new project I copy these into a new folder, rename them and include them in the workspace.

     

    Cheers, Steve.

     

  • Thank you Steve for your clear explanation.

    Now I know how they works. I still would like to know how to add a new one into the workspace.

    In SimpleApp, there are SimpleCollectorEB and SimpleSensorDB already. In my application, I think that only coordinator and end-device is not enough. There is a need for SimpleRouterDB or SimpleRouterEB.

    I tried to copy the SimpleCollector and renamed to SimpleRouter, and add a SimpleRouter.c file in Source. But this failed to work.

    Can you enlighten me how to do this correctly?