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.

EZ430+ 2x RF256x boards

Other Parts Discussed in Thread: MSP430F147, MSP430F5438

Hi,

I only have 1xEZ430 and 2xRF256x boards.

The idea is that i connect one RF256x boar to the EZ430 and flash SPPLEDemo on it, and the second RF256x board not the whole board, just the PAN1323 trought the RX , TX pins on the board to the MSP430F147. can i do that?

And then modify the SPPLEDemo to flash it on the MSP430F147.

The MSP430F147 alredy collect some data that I have to send it to the first module to pc terminal, later to a smartphone.

How can I modify the DEMO, where to start? where to paste My code in the existing one DEmo to send the data of 128kB?

Any sugesstions?

Best Regards,

David.

  • Hi,

    Any news on BTstack DEMO modify?

    I decided not to use MSP430F147 because of flash memory as suggested from Zihad (http://e2e.ti.com/support/low_power_rf/f/660/t/301009.aspx).

    I have one more question about Wake-up the pan1326.

    Can i wake-up it over radio or i have to toggle or send logical '1' or '0' on NSHUTD pin?

    I first thought was to wake upr MSP430 with a button connected to an I/O pin with interrupt enable because the MSP is also in the LPM, and then the MSP will send a signal to PAN1326 module to wake-up the BT Module.

    Does the BT module go automatically in LPM when there is no communication?

    Regards,

    David.

  • Hi David,

     

    Please go through the below link to get an idea on how to run the demos.
    http://processors.wiki.ti.com/index.php/CC256x_MSP430_Bluetopia_Basic_Demo_APPS#EZ430
    also have a look at the “SPPLEDemo.c” and “Main.c” files on how to modified the app to your requirement.
    
    
    Yes, once you have any data coming from the remote the radio will send a wake indication and once it has the confirmation(wake ack), it will send the data to the host.
    
    
    Yes, the BT module goes to sleep automatically when there is no communication.
  • Hi Sundeep,

    TnX for reply.

    I know about the demos and I successfully ran the spple demo on bouth target boards and I send and reciver data with lesend and leread in TERMINAL on pc.

    First SPPLEDemo.c

    I noticed when I use LEsend, it send the TEST string stored in DataStr. I want to send my data length of 128By (byte) do i have to modify LEsend function, write function or the event callbacks?

    I can find the Write function in SPPLEDemo.c but can't find the LEsend function. or I change something in

    static void BTPSAPI SPP_Event_Callback(unsigned int BluetoothStackID, SPP_Event_Data_t *SPP_Event_Data, unsigned long CallbackParameter)

    ?

    128By data is genereted from a device with a code that I have to build in the stack and I don't know how?

    Second Main.c

    /* Enable interrupts and call the main application thread.           */
       __enable_interrupt();
       MainThread();

    After the line MainThread, I think that here I have to add some functions if I want to after the button is pressed to the device automatically initialize to server mode?

    Operation of the device:
    1.Push button on the device->wake up the msp340 ->toggle pin on pan wake up the Bluetooth
    2.BT initialize and works as (server,client)?
    3.Send a command from mobile phone
    4. Command file has a heder and some data: eg. command GetDataOpt , heder->first bit indication get or send,second bit
    tip of communication, third bit baud rate and so on. data->128By
    5.The device get some work done and sends the 128By data to the mobile phone.
    6.Bt goes to sleep

    Where to put the code "work done" in the stack?
    "Work done" is a uart communication and GPIO that drives some led indicators , and photodiode, and timer that generates some interrupts.

    Regards,
    David.

  • Hi David,

    Please check the SPPLESendProcess() method in the SPPLEDemo.c file.

    This gets the "buffer to write" from the FillBufferWithString() method. I guess you will have to put your "work done" code here, and start the LE send process (SPPLESendProcess()) when the data is ready.

  • Hi Sundeep,

    If I change DataStr[] and call the function SPPLESendProcess(), probably will send the data stored in DataStr.

    I can call functions like LESend, Write functions form Therminal, but when i like to call the functions without the thermil.

    Let say some phone sends the MSP430 a string: eg. go to server mode then I have to add the function to Scheduler BTPS_AddFunctionToScheduler(ServerMode, NULL, 0)? or send data

    BTPS_AddFunctionToScheduler(SPPLESendProcess, NULL, 0)?

    Where do I put this lines of code, maybe i Main.c?

    Regards,

    David.

  • Hi David,

    You don’t have to worry about adding the function to the scheduler. If you receive any data from the remote device, SPPLEDataIndicationEvent() will be called and I guess this where you have to put your lines of code. For reading the data  you can use “ReadDataCommand()” and for sending the data you can use “SendDataCommand()”.

  • Hi Sundeep,

    Sundeep Mandava said:
    You don’t have to worry about adding the function to the scheduler.

    Ok tnx.

    I'm trying to change the static char DataStr[]="1234" from terminal with My function.

    static int ChangeDataStr(ParameterList_t *TempParam)
    {
       //int  ret_val;
       
       if((TempParam) && (TempParam->NumberofParameters > 0)){
       
       
       DataStr[1]=TempParam->Params[0].strParam;
       }
    }

    But i get

    Error[Pe513]: a value of type "char *" cannot be assigned to an entity of type "char" C:\TI\Connectivity\CC256X BT\CC256x MSP430 Bluetopia SDK\v1.4\MSP430_Experimentor\Samples\SPPLEDemo\SPPLEDemo.c 6805

    Any suggestions?

  • David,

    There is a type mismatch between DataStr and strParam. You will need to fix that.

    Regards,

    Stonestreet One.

  • Hi Stonestreer One,

    Here is My new code:

    static int ChangeDataStr(ParameterList_t *TempParam)
    {
       char  ret_val;
       
       if((TempParam) && (TempParam->NumberofParameters > 0)){
       
          
    
          strncpy(DataStr, TempParam->Params[0].strParam, sizeof(DataStr)-1);
          
          DataStr[sizeof(DataStr)-1] = '\0';
          ret_val=0;
       
       
       }

    I'm testing it with BT classic and it works with write() command, but when i testing it BLE sometimes it get stuck.

    Server Terminal


    SPP+LE>registerspple
    Sucessfully registered SPPLE Service.

    SPP+LE>advertisele 1
       GAP_LE_Advertising_Enable success.

    SPP+LE>
    etLE_Connection_Complete with size 18.
       Status:       0x00.
       Role:         Slave.
       Address Type: Public.
       BD_ADDR:      0xB8FFFEA93656.

    SPP+LE>
    etGATT_Connection_Device_Connection with size 12:
       Connection ID:   1.
       Connection Type: LE.
       Remote Device:   0xB8FFFEA93656.
       Connection MTU:  23.

    SPP+LE>
    SPP+LE>changedatastr 1

    SPP+LE>lesend b8fffea93656 15

    SPP+LE>changedatastr kamoidemonarucakujedanaestsati

    SPP+LE>lesend b8fffea93656 50
    Send Currently in progress.

    SPP+LE>


    Client Terminal


    SPP+LE>connectle b8fffea92fdf
    Connection Request successful.

    SPP+LE>
    etLE_Connection_Complete with size 18.
       Status:       0x00.
       Role:         Master.
       Address Type: Public.
       BD_ADDR:      0xB8FFFEA92FDF.

    SPP+LE>
    etGATT_Connection_Device_Connection with size 12:
       Connection ID:   1.
       Connection Type: LE.
       Remote Device:   0xB8FFFEA92FDF.
       Connection MTU:  23.

    SPP+LE>
    Exchange MTU Response.
    Connection ID:   1.
    Transaction ID:  1.
    Connection Type: LE.
    BD_ADDR:         0xB8FFFEA92FDF.
    MTU:             48.

    SPP+LE>
    SPP+LE>discoverspple
    Usage: DiscoverSPPLE [BD_ADDR].
    Function Error.

    SPP+LE>discoverspple b8fffea92fdf
    GATT_Start_Service_Discovery success.

    SPP+LE>configure
    Service 0x0007 - 0x0011, UUID: 14839AC47D7E415C9A42167340CF2339.


    SPP+LE>
    Service Discovery Operation Complete, Status 0x00.

    SPP+LE>spple b8fffea92fdf
    SPPLE Service found on remote device, attempting to read Transmit Credits, and configured CCCDs.

    SPP+LE>
    Write Response.
    Connection ID:   1.
    Transaction ID:  11.
    Connection Type: LE.
    BD_ADDR:         0xB8FFFEA92FDF.
    Bytes Written:   2.

    SPP+LE>
    Write Response.
    Connection ID:   1.
    Transaction ID:  12.
    Connection Type: LE.
    BD_ADDR:         0xB8FFFEA92FDF.
    Bytes Written:   2.

    SPP+LE>
    Data Indication Event, Connection ID 1, Received 10 bytes.

    SPP+LE>leread b8fffea92fdf
    Read: 10.
    1

    SPP+LE>leread b8fffea92fdf
    Read: 0.


    SPP+LE>


    I marked with red where was the problem , It should send 15 bytes and I only get 10 bytes Received,

    and later when I try to send again then it says Send Currently in progress.

    Where is the problem?

    Regards,

    David.

  • Couple of things David.

    1) LeSend can only send one set of data at a time. You must complete sending your data before doing another LESend.

    2) You'll have to debug your code to see why the 15 bytes were not sent. From the logs I see, The client also receives just a single 1 instead of the 10 1s its supposed to receive. 

    Thanks,

    Stonestreet One.

  • Hi Stonestreet One,

    I can't find the error.

    Is there a way to debug with IAR? I'm using the EZ430-rf256x and if I change some code I have to flash it and then remove from USB port and plug in to run the terminal on PC.

    Edit

    I changed my code a little now I get:

    Server terminal:

    SPP+LE>
    SPP+LE>changedatastr 123

    SPP+LE>lesend 001122334400 3
    No connection with BD_ADDR 001122334400 exists.

    SPP+LE>lesend 001122334400 10
    No connection with BD_ADDR 001122334400 exists.

    SPP+LE>lesend b8fffea93656 3

    Send Complete, Sent 3.

    SPP+LE>
    SPP+LE>lesend b8fffea93656 6

    Send Complete, Sent 6.

    SPP+LE>
    SPP+LE>lesend b8fffea93656 5

    SPP+LE>lesend b8fffea93656 6
    Send Currently in progress.

    SPP+LE>

    Client Terminal:

    SPP+LE>
    Data Indication Event, Connection ID 1, Received 3 bytes.

    SPP+LE>leread 001122334400
    Read: 3.
    123

    SPP+LE>
    Data Indication Event, Connection ID 1, Received 6 bytes.

    SPP+LE>leread 001122334400
    Read: 6.
    123123

    SPP+LE>
    Data Indication Event, Connection ID 1, Received 3 bytes.

    SPP+LE>lerad 001122334400
    Invalid Command: LERAD.

    SPP+LE>leread 001122334400
    Read: 3.
    123

    SPP+LE>

    I have 3 By to send. If I send 3 it's ok if I send 6 it's ok but if I send 5 or 4 the it get stuck.

    I thin is get stuck in this function:

    static int SendDataCommand(ParameterList_t *TempParam)

    from sppledemo.c

    Regards,

    David.

  • David,

    The number of bytes you send with LESend has to be a multiple of the DataStr. That's why the 6 works fine but the 5 or 4 don't.

    Thanks,

    Stonestreet One.

  • Hi Stonestreet One,

    What about the debug ways of EZ430-rf256x ?

    How to use BreakPoints?

    David V said:
    Is there a way to debug with IAR? I'm using the EZ430-rf256x and if I change some code I have to flash it and then remove from USB port and plug in to run the terminal on PC.

    Regards,

    David.

  • Hi,

    We had no problems debugging the boards using IAR. But if you have any issues with it you should contact IAR or TI.

    Regards,

    Stonestreet One.

  • Hi Stonestreet One,

    How did you do this?

    I have only this board http://uk.farnell.com/productimages/nio/standard/5119313.jpg

    Didi you connect MSP-FET430UIF to the pins of uC on back of the board?

    On what mail should I contact IAR or TI?

    Regards,

    David.

  • Hi David,

    If you are using EZ430-RF256x. You should be able to start debugging without any cable.

    But if you are using MSP430F5438. You need to use MSP-FET430UIF cable for debugging.

    You can use the options "Project->Download and Debug" or "Project-> Debug without Downloading" For starting the debugging.

  • Hi Sundeep,

    I tried Project-> Debug without Downloading and Project->Download and Debug.

    IAR stops at

    /* Turn off the watchdog timer                                       */
       WDTCTL = WDTPW | WDTHOLD;

    green marked.

    And then opened TeraTerm -> pressed S3 , and the stack won't initialize.

    Am I doing something wrong?

    Regards,

    David.

  • Hi David,

    Once the IAR stops at the below location

    /* Turn off the watchdog timer                                       */
       WDTCTL = WDTPW | WDTHOLD;

    It means that your in debug mode now it is up to you to put the break points and start debugging (Click on "Debug" to see the available options)

    Please see the link: http://www.ti.com/lit/ug/slau138ac/slau138ac.pdf