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.

SCI interrupts

Other Parts Discussed in Thread: HALCOGEN

I'm trying to get a basic echo program going on the TMS470M. In the demo program I can edit the sci callback to do so

void sciNotification(unsigned flags){

 sciSend(sciREG1,1,(unsigned char *)&command);

sciReceive(sciREG1,1,(unsigned char *)&command);

}

However, when I make my own program using halcogen (to enable interupts and sci drivers) and copy the sciNotification function. It wont write to the port or call the callback function. All I see on my terminal is Bad file descriptor.

Any Ideas how I can fix?

  • Your post is being assigned to a 470M device expert. Stay tuned.

    Regards, Sunil
  • Hello Shabbir,

    My apologies for the delay in getting back to you, but can you share your project including the Halcogen project files so I can take a look? Also, what version of Halcogen are you using?

  • Hi Chuck,

    I'm using halcogen 4.03.00. You can find my files  here3348.sci.zip

  • Shabbir,

    The main issue with your code is the use of the _enable_IRQ() intrinsic. This specific intrinsic function is not valid for Cortex M class cores. use _enable_interrupts() instead.

    A second issue with your code is the use of the drivers. If you have a look at the sciSend() and sciReceive() functions, you will see that the length and data are both copied to a global structure used throughout the SCI driver. i.e., send and receive share the same data ans length storage location which means if you call the sciReceive function too soon after the sciSend function, the data and length information for the Tx ISR is overwritten by Rx data and length information. This is counter intuitive and not ideal for interrupt based UARTs since it should be full duplex and be able to transmit and receive at the same time. I will open this discussion with our Halcogen team to see if it can be addressed.

    Another questionable issue I see in your code is that your copied the sciNotification and esmNotification functions to sys_main.c. I am curious why you did this since they are in notifications.c and are called from within the ISR at the end of the Tx or Rx activities/packets. I don't think this is necessary if you include the right header files in notification.c.

    Also, there are a few other posts on sci interrupts and how to enable them, etc if you use the search utility to search for "TMS470M SCI" or "TMS470M Interrupts." These might be helpful to you as well.
  • Hello,

    I have the same problem with interrupt based SCI send/receive. Are there any news?

  • Hello Werner,

    The issue with the shared length and data storage for Tx and Rx has been repaired in Halcogen 4.0.4.