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 studio is reentrant or non reentrant?

Dear all,

I would like to port an RTOS into OMAP L138, and consider using CCS, but the C compiler must be able to produce reentrant code. Anyone can answer me that CCS is reentrant or non reentrant code? I see it can compile TI-RTOS and Linux, so it should be reentrant compiler, is that right? when and why it is reentrant and non reentrant and which version of CCS is re-entrant?

Thanks you so much,

Nhan

  • Please see this wiki article.

    Thanks and regards,

    -George

  • Hi Nhan,

    What do you mean by "reentrant"?

    We say an ISR is reentrant means other ISRs with higher priority can get serviced when the interrupt is "disabled". This makes system complicated for RTOS since any ISR will be interrupted. So, RTOS usually doesn't support reentrant. In fact, there is no need to do that, unless you need a system with very very short interrupt latency.

    If you are asking if a function is reentrant then most likely "errno" is what to be considered. My suggestion is "don't use errno at all". errno is not a good mechanism to report error since each function in call-stack may change it.

    CCS provides a method for you to print message back to host computer. This is good, but also bad since the internal implementation is not well protected. Yes, it is the C I/O buffer. My suggestion is "Don't use it all all". I would suggest you to implement an dedicated UART channel to print message. I have implement this mechanism in my RTOS. If a CPU has SWO then the message will go through SWO. If not, it will go through an UART port. Debuggers such as XDS100 has the back UART channel that you can use to transmit message back to host through USB without adding additional chips.

    Hope the above information is helpful.