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.

How to develop CC2530

Other Parts Discussed in Thread: CC2530, Z-STACK

HI, everyone.

Now, I am developing CC2530.

But I don't know how to develop CC2530.

Firstly, I prepared ZStack for CC2530 and IAR EW8051.

I download ZStack and installed.

After that, I opened sample file of ZStack using EW8051.

There are many folders.

I would like to know how to custmize sample file for CC2530.

And I would like to know that I should develop folders and files.

Here I create the system that consists of coordinator and end devices.

I am a beginner of micro controller.

Please tell us kindly.

Best regards, 

  • Hi Kami,

     

    Inside the sample project (i.e GenericApp) there is a "source" folder.

    Inside this folder there are 3 files "GenericApp.c", "GenericApp.h" and "OSAL_GenericApp.c"

    As a first step try to understand "GenericApp.c " and "GenericApp.h", you'll be probably basing

    your application by changing some content in this files.

    The rest of the files and folders in the project are not of an interest to you at this moment.

    In addition you have to get familiar with couple of APIs, like HAL_API and OSAL_API, which will

    help you in further development (you can find these pdf file in Z-stack installation folder/Documents).

     

    Br,

    Igor

     

  • Hi Igor.

    Thank you for your reply.

    What is the different of coordionator and end device for program?

    Is it written in GenericApp.c ?

    Best regards,

    kami

     

  • Hi Kami,

     

    There are a lot of differences, however most of them found inside Stack modules,

    thus you shouldn't be troubled so much with this question (at least not now). :)

    A good start point for you, at this moment, is the Z-Stack developer's guide, by reading it

    you'll get the main idea, the differences and a lot of other stuff regarding ZigBee, Stack,

    End devices, routers, coordinator and etc..

     

    Br,

    Igor

  • Hi Iror.

     

    Thank you for your reply.

    I don't know option settings.

    [Project]>[Options]

    For example, I don't the setting

     

    [Project]>[Options]>[C/C++ Compiler]>[Diagnostics]

    Supress these Diagnostics: Pe001, Pa010

     

    Is there the reference document about this ?

    Best regards,

    kami

     

     

  • Hi Kami,

     

    Try the Help tab in IAR EW (Guides like 8051 Embedded Workbench User Guide, etc...)

     

    Br,

    Igor

  • Hi Iror.

     

    In " GenericApp.c" , it is written

     

    This application sends "Hello World" to another "Generic" applicaiton every 15 Seconds.

    The application will also receive "Hello World" packets.

     

    Here, I have a question.

    Where is written sending time "15 Seconds" ?

    Probably, it indicates Timer program.

     

    Best regards,

    kami

  • Hi Kami,

     

    I think there is a minor mistake, the period should be 5 seconds, not 15, however this is not the point.

    The answer you are looking for lies in the ZDO_STATE_CHANGE (search for it in GenericApp.c).

    You'll find a call for scheduling an OSAL timer (which later invokes another event):

    osal_start_timerEx( GenericApp_TaskID,
         GENERICAPP_SEND_MSG_EVT,
         GENERICAPP_SEND_MSG_TIMEOUT );

    GENERICAPP_SEND_MSG_TIMEOUT defined in GenericApp.h and the value of this constant is 5000

    (which means 5 seconds).

    In order to better understand this function, please refer to "OSAL_API.pdf" document.

    There is one more place the with the same call of this function, it is in GENERICAPP_SEND_MSG_EVT

    event, where the event is basically reschedules itself.

     

    Br,

    Igor

  • Hi Igor.

     

    Thank you for your reply.

    I agree your responce.

     

    I have more 2 questions.

    See GenericApp.c .

    1)

    I don't know global and local variables.

    I think these variables are struct.

    I would like to know these detail.

     

    2)

    Where is the main function?

    Is there in Zmain folder ?

     

    Best regards,

    kami

     

  • Hi Kami,

     

    1) Can you please specify the names of these variables?

     

    2) The main function can be found in zmain.c, which is located in

    ZStack-CC2530-2.5.0\Projects\zstack\ZMain\TI2530DB\ 

     

    Br,

    Igor

  • Hi Igor.

     

    Please tell me

    variables :

    • cld_t
    • SimpleDescriptionFormat_t

    structs :

    • devStates_t
    • afAddrType_t

     

    Best regards,

    kami

  • Hi Igor.

     

    I found the files which are written these varuables.

     

    Thank you!

    kami

  • Hi.

    I´m trying to develop the CC2530 kit too but I still don't understand a few things about its programation.

    I already tested the SmartRF Studio whit 2 boards but my problem is that i don't get how to set them as a coordinator and end device.

    Are similar to xbee's programation??

    Hope that you can help me.

    Regards

  • Hi Rogelio,

     

    I'm not much of an expert in Xbee, however, to achieve a full functionality of ZigBee utilizing

    cc2530 devices, you can download and install the TI's ZigBee stack, which is the Z-Stack.

    Inside you'll find several application demos, which you can use to set your specific device as

    a coordinator, router, or an end device.

    Please note that you'll have to install the IAR EW 8051 evaluation version (30 days time limitation)

    in order to work with Z-Stack  (changing the code).

     

    If you have any additional questions regarding installation, or how tos, please, don't hesitate to ask.

     

    Br,

    Igor

  • Thanks Igor

    I already installed the IAR EW 8051 and the Z-stack but i have some problems openning the samples.

    When i want to open the "GenericApp" workspace (or another samples of the Z-stack) the program send me an error :

    "Broken options were detected in the project fila.

    A backup copy will be made.

    (See log window for details)"

    And the project can't be openned.

    After that sends me another error:

    "LOAD: Configuration 'SimpleControllerEB' in the project 'GenericApp' contains broken options for tool 'General': 

      The format of this file is not supported by this version of the workbench. It appears to have been written by a newer version of the workbench. 

    Diagnostics: 'Settings 'General': unsupported version - '. 

      Options for 'General' will be set to default. 

      Creating backup of original project file. "

     

     

    Maybe it's too obvious but what can i do??

    Best regards

    Roger

     

  • Hi Roger,

     

    Seems like you installed the wrong version of IAR, not for 8051 devices,

    is it the case?

     

    Br,

    Igor

  • No, the IAREW 8051 and Z-stack are both for 8051.

     

  • Did you try to completely remove Z-Stack and do a clean install again?

  • Yep, I did it again but the same result. :(

  • Ok...

    I have two more ideas here:

    1. Remove IAR Workbench and do a clean install again.
      (by the way, can you please post a link for the IAR version you installed on your PC)? 
    2. Download additional Z-stack sample project form here, unzip it to your
      Z-stack installation folder\Projects\zstack\Samples and then try to open it with IAR

    Br,

    Igor

  • Almost forgot, the IAR EW8051 version should be 8.10!!! Projects in Z-stack v2.5.0

    doesn't support earlier versions of IAR, so be sure you are using the 8.10 version!!

    Let me know if it works.

     

    Br,

    Igor

  • Same problem! D:

    I installed the IAREW 8051 7.60 (The trial version of the IAR page)  the .iso it's kind of heavy (120 MB)

  • If you have Z-stack v2.5.0 installed on your PC it won't work with

    IAR v7.60, you must have the 8.10 version.

  • Haha I should have known before :P

    I already installed the 8.10 version and that problem was solved but there was another problems.

    When I rebuilt "Genericap" and "SensorDemo", the IAR showed the problem in most of all files (64 problems):

    "[Og007]: Assembler list file generation not allowed in this version of the compiler 

    Error while running C/C++ Compiler"
    Sorry for the bothers and thank you for all the help until now
    Best regards

  • Hey 

    I decided to put aside that problem for a while and focus in the CC2530.

    Do you know if its possible to wake up a device of sleep mode (PM3 its what I want to use)  with an internal interupt like the Recive mode interupts??

    Hope that you can help me.

     

    Best Regards

    Roger

  • Hi Roger,

     

    Please refer to cc2530 users guide, chapter 4.

    Sections 4.1.3 and 4.1.4 will answer your question

     

    Br,

    Igor

  • Hi Igor,

    I have a problem with this function osal_start_timer Ex. The packets are delivered every 15 seconds, not 5 seconds, even though the function suggests that the interval will be 5 seconds. Even after changing the value of GENERIC_APP_SEND_MSG_TIMEOUT to even 1000, the app still sends it out at an interval of 15 seconds. So, the value of the timeout doesn't matter to this function, I don't know why, I need help figuring it out.

    Also, in the Packet Sniffer, the MAC payload refers to the transmitted data, right? Like "Hello World" in the application comes under MAC Payload? In that case, what is Application data?
  • Hi,

    Why won't you start a fresh thread, so anyone could pitch in.

    Anywho:

    osal_start_timerEx defines a timer and an event which will be invoked when the timers expires.

    If you'r changing some interval and the outcome isn't changed, then you'r changing the wrong interval.

    Try to debug and see what timer is responsible for 15 seconds event.

    Nitesh Reddy said:
    Also, in the Packet Sniffer, the MAC payload refers to the transmitted data, right? Like "Hello World" in the application comes under MAC Payload? In that case, what is Application data?

    The data transmitted (in an abstract way) as application data, which is a payload of a network layer, where network

    layer is a payload of the MAC layer.

    So "hello world" is the app_data, which is wrapped by network layer which is wrapped by MAC layer, each of these layers has

    it's own header, and sometimes a footer.