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.

chip support library and no default .bss initialization

I'm referring to C55 Low Power Chip Support Library v2.50.00

The chip select library assumes that statically allocated variables are initialized to zero before main() is called, as required by the C standard. However the TI C environment does not do this by default. I understand one reason for this is to prevent watchdog failure at boot time, and that TI have no intention of providing a default C55x C environment that initializes statically allocated variables to zero.

That being the case it is up to the CSL to provide explicit initialization for it's statically allocated variables. One module where that is clearly a bug is the SPI module, where SPI_Open assumes that hSpi->configured has been initialized to 0 at some stage. Other modules have insecurities if not actual bugs.

  • To clarify, when I say above:

    it is up to the CSL to provide explicit initialization for it's statically allocated variables

    I mean eg:

    static CSL_SpiObj   SPI_Instance = {0};

    instead of:

    static CSL_SpiObj   SPI_Instance;