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.

[28x Compiler] RTS lib funtion re-entrancy

Other Parts Discussed in Thread: TMS320F2812

Hi All,

 I have a customer who has a question about the run-time support library for TMS320F2812 DSP.

 They would like to know:
Are the functions included in the run-time support library re-entrant?

 Thanks in advance,
-Adam

  • Adam,

    No, they are not. It's the users responsibility to ensure that nothing happens. If you look at the rts source code, you'll find in many funcitons calls to a lock(). But you'll also see that this lock() is a "nop", so the lock functionality is not implemented. If you use DSP/BIOS, then a correct lock mechanism will be used. This is from the BIOS release notes:

    ...
    The DSP/BIOS Kernel uses internal lock/unlock function to protect the MEM heaps and certain runtime support library (RTS) functions from reentrancy. These functions use LCK_pend/post() but these APIs cannot be safely called from HWI or SWI context.

    There have been several customer problems where customers were unknowingly calling RTS and/or MEM from incorrect context which would cause intermittent/infrequent system crashes.

    We have therefore updated the internal lock function to verify calling context (with TSK_isTSK()) before calling LCK_pend().

    If the calling context is not a TSK, this API will call SYS_abort() which will typically halt the processor with interrupts disabled.

    ...

    If your customer is not using BIOS, they shouldn't call any of the critical RTS functions from an ISR. And if they are using their own OS, they need to implement a lock() function.

    Regards,
       Robert

  • Thanks,

    That really helped.