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.

cc2530 hangs after several minutes of tx over the serial port

Other Parts Discussed in Thread: CC2530, TIMAC, Z-STACK

1. different modules last different times, from 1 minute to 10 minutes

2. tx isr or tx  polling - same story

3. speed is 115K

4. uart0 is used

5. for some reasons adc int lag is getting set ( but adc ISR is disabled )

6.  I have tried all the  examples from TI board - no difference

7. It hangs on           while(!UTX0IF)

8. It works longer, but still hangs if line above is commented out and replaced with 5 ms delay

Never saw anything like this before. Anyone has a simple code that just does the TX over uart0 and works ALL the time?

Or hint what to look for?

Thanks,

 

Nick

 

  • Hi Nick,

     

    From your explanation it is kind of hard to understand what exactly going on...

    Can you be more specific please...

    Have you used breakpoints to observe what's going on with the CPU when it "hangs"?

    What exactly happens when it "hangs" (is it trying to execute some specific line, some sort of infinite loop, or

    it just jumps to unknown address in the code memory and hangs there)?

    What happens inside uart0 ISR?

     

    Br,

    Igor

  •  

    As Igor is stating, what happens with the ISR? Can you set a breakpoint the ISR, and see if it gets hit?
    Are all the necessary UART interrupts enabled correcty? 
    What software are you using, Z-Stack, TIMAC, CC2530 Software Examples?

    LPRF Rocks the World

  • Thanks to Igor and LPRF rocks the World ( it does! )

    1. Basic RF, Light Switch, cc2530, IAR 8051  8.10, modules cc2530BB

    2 Code is based on "Light switch" example and actually is reduced to a init and sending a small packet ( 10 characters ) in a loop to a serial port

    3. Scenario NO  ISR is used for TX

    It works sometimes for 5 minutes but hangs. I am toggling the line in the same loop and it stops also ( scope as a monitor). Debugger shows that

    I am stuck on line while( !UTX0IF ) :

    void send_Char_to_uart(unsigned char i)
    {
     
        U0DBUF = i;  
     
        while(!UTX0IF)        //    << here
           ;
         UTX0IF = 0;
     
    }

    Registers when "stuck" on UTX0IF :

    IEN0 = 0x84

    IEN1 = 0x00

    IEN2 = 0x01

    TCON = 0xA5

    IRCON = 0x04

    U0BAUD = 0xD8

    UOUCR = 0x42

    UOGCR = 0x0B

    U0CSR = 0xC2

     

     

    If I comment out "offensive" line and restart, then character is being printed on a term for several minutes, then printing stops but toggling in the loop continues and data is loaded to U0DBUF ( I can step code ).So processor stays operational.

    I have repeated the same with ISR driven tx ( DL 212 ) with the same result

    I think I have to use even more simple example but could not locate any.

    Here is the call

    void appAgent(void)
    {
       
      uint8 txbuff[APP_PAYLOAD_LENGTH];

     
      for(uint8 i = 0;i<10;i++)
        testb[i] = 0x41 + i;
     
      for(;;)
      {
       send_Char_to_uart('y');


     //  charbuff(testb,10);


        halMcuWaitMs(5);


            TOGGLE_07;
      }

     

    Not sure if this helps to get the picture. Thank you in advance

    Nick

     

     

     

     

     

     

     

     

  • Hi Nick,

     

    Please refer to DN112.

    Meanwhile I'll look into your code to see what's wrong there.

     

    Br,

    Igor

  • The problem is solved.  Somebody else might save a few hours of debugging:

    Flow control bit was set in U0UCR and  in this particular env ( very noisy, by a setup )it backfired, randomly stopping the transmitter...

    Now it works like a charm, using tx isr or tx without  isr

    Exactly what suppose to happen when code is written for a "sunny day" and fast. It takes longer to find the problem afterwords...

    Thank you guys for your support, great forum for a great technology.

     

    Nick