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.

TMS320F28386D: Suspected bug in CLB generated code

Part Number: TMS320F28386D
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I ran into an odd generated code for the CLB on my project:

CLB_setOutputMask(myCLB0_BASE, (0UL << 0UL), true);
CLB_enableOutputMaskUpdates(myCLB0_BASE);

I don't use any CLB output so this part of the generated code is of no use for me.

But I suspect there is a bug though in that generated code from the sysconfig tool so I prefered raising it.

For me calls seem inverted, the enable output mask updates function should be called prior to setting the output mask otherwise it won't work.

Best regards,

Clément

  • Hi Clément,

    Thanks for reaching out to us about this. From my understanding, the CLB_enableOutputMaskUpdates() function only really needs to be called if CLB_disableOutputMaskUpdates() was called previously, otherwise it doesn't really serve a purpose. This is what is done in CLB example 24 in the SDK. Otherwise if not disabled, CLB_setOutputMask() should work even if enable is not called. I am double checking with software on this, but please correct me if you have experienced otherwise.

    Regards,
    Peter

  • Hi Clément,

    I just received verification that this is true. Essentially, the outputMask is "unlocked" unless the disable function is called, so the initial CLB_setMaskOutput() write works as intended. There is really no need for the enable function to be in the generated code since disable was not called previously, but it is just there to reiterate that future calls to setOutputMask will work. Hopefully this answered your inquiry and let me know if you have any other questions.

    Regards,

    Peter

  • Hi Peter,

    Yes it will work unless the disable function has been called.

    However, if it had been called before, then you would need to call the CLB_enableOutputMaskUpdates function before the CLB_setOutputMask one.

    That is why I am telling the generated code is incorrect/misleading and should be modified.

    I didn't experience it otherwise as I didn't take that part of the code in mine, I was just trying out to help you enhancing the product and fixing a tiny bug Wink

    Regards,

    Clément

  • Hi Clément,

    Yes you are correct! I will send this note over to software. Thanks for letting us know

    Regards,

    Peter