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.

Code Composer Debugging Modes compared to IAR

Other Parts Discussed in Thread: CC2500

Hello

I am trying to follow this tutorial http://cnx.org/content/m21579/latest/?collection=col10684/latest in order to familiarise myself with the MSP430 hardware and using it to construct a basic network for a university research project. However this project is based upon using IAR.

I am encountering problems around 4.2 where I am attempting to achieve simple receiving of packets using the MRFI. Unfortunately according to CCS the SPI will read 0 from the amount of packet information in the CC2500 FIFO (RXBYTES = 0). This causes an analogous error to address filtering occurring and the code exits.  

When running this code on IAR it worked fine provided I selected the debug option to run on the FET and not use a simulator. Is there an analogous method for this on code composer? I am presuming that because the SPI is accessing an external chip the CC debugger is not loading in external values from the real world. Even if it does react to external interrupts. 

I have tried reading through the wiki and have searched desperately on CC for analogous settings. I would like to use CC as IAR licence restrictions make it unsuitable for my research project.  

  • When using CCS are you receiving the packet and the RXBYTES read 0 or do you not receive at all?

     

  • I assume I'm receiving the packet as I'm entering the interrupt correctly and only exiting when the MRFI api tries to check  RXBYTES. 

    According to the memory it is ".". When stepping through the code I also noticed that the address value is lost when entering SPI read mode, as in address is always shown as "." to. 

    Luke

  • It could be wise to verify that the interrupt actually comes form the radio and that there is not a isr flag being set somewhere in the code that gives the interrupt. You can verify that you actually have received a sync word by monitoring the interrupt line with a oscilloscope or logic analyzer. 

    Usually if you get a interrupt by sync found and RXBYTES read 0, the packet has been discarded due to address or crc filtering. Do you have this enabled?

    A full overview of your register settings would be helpful to investigate this further.

  • Here is the code I was working with

    #include <msp430.h>
    /*
    * main.c
    */
    #include "mrfi.h"
    #include "radios/family1/mrfi_spi.h"
    int main(void)
    {
    BSP_Init();
    P1REN |= 0x04;
    P1IE |= 0x04;
    MRFI_Init();
    MRFI_WakeUp();
    MRFI_RxOn();
    MRFI_DisableRxAddrFilter();
    __bis_SR_register(GIE+LPM4_bits);
    }
    void MRFI_RxCompleteISR()
    {
    P1OUT ^= 0x02;
    P1OUT ^= 0x01;
    }
    #pragma vector=PORT1_VECTOR
    __interrupt void Port_1 (void)
    {
    P1IFG |= 0x04;
    mrfiPacket_t packet;
    packet.frame[0]=8+20;
    MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED);
    P1OUT ^= 0x01;
    }

    As mentioned in the first post it works fine when used with IAR compiler and not with CCS. I know there are some issues porting code between the two compilers as mentioned in documentation. However looking at the datasheet there seem to be no conflictions. Except possibly some values are un-initiallised in the CC compile that the tutorial assumed was null. 

    I tried compiling with and without disabling address filtering explicitly and the same result occurred. To my knowledge it should by default be turned off. I have checked as well I'm receiving packets using a logic analyser.  

    As I mentioned I believe the errors are caused by CC not reading the SPI correctly. 

    Luke

  • Hi Luke

    I'm sorry to say that my knowledge on CCS is somewhat limited. As most of us on these Low Power RF forums, my expertise is more situated to the radios. For all our software projects we use IAR as the desired compiler, therefore I haven't to much experience working with CCS. Maybe you have more luck in the MSP430 forums if this is a compiler issue. They have more knowledge of CCS.

    That being said, I think it is strange that reading RXBYTES = 0 when you get an interrupt that you have verified comes from the radio, is caused by a compiler issue. Event though some variables may be un-initialized by CCS, the SPI is verified to work so you must assume that the value returned is correct. This is why my first suspicion was that the packet got filtered out.   

  • Hello Martin

    That is ok. This post was moved to this forum by the moderators it was initially posted in the CCS forums. 

    That was suspicion as well. I vaguely remember noticing that the SPI is verified at the start of MRFI initialisation so that filtering occurred in the radio chip. I shall try and repost in another forum to see if my question gets answered.

    Thank you for your time.

    Luke