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.

TMS320F28377S: Securing the configuration of the CLB

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE,

Dear E2E community,

I have been experimenting with the CLB to explore its capabilities for reducing external logic chips, and have been impressed with the capabilities of that peripheral.

I'm curious to ask if there is a way to essentially program the CLB in a one-time manner, so that it cannot be overwritten by future firmware updates?

Thanks,

Alex

  • Hello Alex,

    There is a CLB_LOCK register which can be used to lock the designated CLB registers with a key (although this does get unlocked when reset). This register can lock the CLB_LOGIC_CONFIG_REGS and a few of the CLB_LOGIC_CONTROL_REGS (please take a look at the CLB_LOGIC_CONTROL_REGS Registers table to see which registers can be locked). I'm not sure if this is what you're looking for, since a system reset will clear the lock bit (but otherwise the bit cannot be cleared).

  • Hello Omer,

    That looks really interesting, thanks for the pointer. I imagine that it would be possible to use the security features of the C2000 to arrange for a particular bit of code to always run on startup in a way that cannot be modified, before branching to user code that can be updated? If this startup code were to configure the CLB and then set the CLB_LOCK it would presumably have a similar effect of forcing a known CLB configuration.

    Looking at the Technical Reference Manual for this microcontroller, the CLB LOCK appears to cover most of the pertinent registers except from CLB_OUT_EN register. If my understanding is correct, that would still allow user code to turn off any CLB functionality that modifies the outputs of peripherals, even when CLB LOCK has been set.

    Interestingly, the C2000Ware API documentation for the CLB_setOutputMask() function (which sets the CLB_OUT_EN register) has the following note: "If no further modifications are expected, then it is advised to set the block writes bit of the MISC_ACCESS_CTRL Register. This will prevent accidental writes". Link. I am however unable to find any reference to the MISC_ACCESS_CTRL register it mentions.

    I'd be interested to hear your thoughts and thanks again for the pointers so far.

  • I imagine that it would be possible to use the security features of the C2000 to arrange for a particular bit of code to always run on startup in a way that cannot be modified, before branching to user code that can be updated?

    I believe this may be possible if you have your own boot ROM code running on startup, this may be a question to ask separate from this thread.

    Interestingly, the C2000Ware API documentation for the CLB_setOutputMask() function (which sets the CLB_OUT_EN register) has the following note: "If no further modifications are expected, then it is advised to set the block writes bit of the MISC_ACCESS_CTRL Register. This will prevent accidental writes". Link. I am however unable to find any reference to the MISC_ACCESS_CTRL register it mentions.

    This seems to be a typo on the website, the MISC_ACCESS_CTRL register is something only available on the CLB type 3, the F2837xS only has CLB type 1. I will try to see if I can contact someone to fix this, or if I find out that it is in fact correct I'll let you know.

  • Many thanks for the really useful info, much appreciated.
    [For completeness of this forum post, I've noticed that the TMS320F28377S itself does not actually have a CLB, but of course other devices in that family do].