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.

Tivaware incorect ASSERT

Hello,

Just to report some incorrect ASSERT in driverlib which prevent using some function.
I use driverlib 2.1.1.71 but in the new released version, those bug seem to be always here:

1) In file aes.c function

AESConfigSet(uint32_t ui32Base, uint32_t ui32Config) 

used in decrypt mode:

The following assert is always wrong because AES_CFG_DIR_DECRYPT is equal to zero:

ASSERT((ui32Config & AES_CFG_DIR_ENCRYPT) ||
(ui32Config & AES_CFG_DIR_DECRYPT));


2) In file gpio.c function

void GPIOIntTypeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32IntType)

If we use the type GPIO_DISCRETE_INT,

the following assert is always wrong because GPIO_DISCRETE_INT is not checked in ASSERT:

ASSERT((ui32IntType == GPIO_FALLING_EDGE) ||
           (ui32IntType == GPIO_RISING_EDGE) ||
           (ui32IntType == GPIO_BOTH_EDGES) ||
           (ui32IntType == GPIO_LOW_LEVEL) ||
           (ui32IntType == GPIO_HIGH_LEVEL));



Instead this ASSERTshould be used:

  ASSERT( (ui32IntType == GPIO_FALLING_EDGE) 	||
			(ui32IntType == GPIO_RISING_EDGE) 	||
			(ui32IntType == GPIO_BOTH_EDGES) 	||
			(ui32IntType == GPIO_LOW_LEVEL) 	||
			(ui32IntType == GPIO_HIGH_LEVEL) 	||
			(ui32IntType == GPIO_FALLING_EDGE | GPIO_DISCRETE_INT)	||
			(ui32IntType == GPIO_RISING_EDGE  | GPIO_DISCRETE_INT)  ||
			(ui32IntType == GPIO_BOTH_EDGES   | GPIO_DISCRETE_INT)  ||
			(ui32IntType == GPIO_LOW_LEVEL    | GPIO_DISCRETE_INT)  ||
			(ui32IntType == GPIO_HIGH_LEVEL   | GPIO_DISCRETE_INT));

Regards

  • Hello Maxime,

    I believe the GPIO API has been fixed for the next release, but let me confirm both of the APIs.
  • Hello,

    1) I've downloaded the latest TivaWare 2.1.3.156 and it seem that the problem is always here for  function GPIOIntTypeSet.

    2) Also for the incorrect ASSERT in AES function, I think there is more than one incorrect ASSERT in the function

    FYI, I use the function with this paramters:  

    AESConfigSet(AES_BASE, (AES_CFG_KEY_SIZE_256BIT | AES_CFG_MODE_CBC | AES_CFG_DIR_DECRYPT));

    And other ASSERT (tested under the one I mentioned in the first post) are fired.

    Regards

  • Also it seem incorrect ASSERT are present in file aes.c in function:

    void AESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)

    This ASSERT do not cover the case when we do not use DMA but only use interrupt for data in and out. (AES_INT_DATA_IN, AES_INT_DATA_OUT...):

        ASSERT((ui32IntFlags == AES_INT_DMA_CONTEXT_IN) ||
               (ui32IntFlags == AES_INT_DMA_CONTEXT_OUT) ||
               (ui32IntFlags == AES_INT_DMA_DATA_IN) ||
               (ui32IntFlags == AES_INT_DMA_DATA_OUT));

    Regards

  • Hello Maxime,

    We really appreciate you for bringing these issues to our notice. This helps us improve TivaWare.

    Maxime GUYON said:
    1) I've downloaded the latest TivaWare 2.1.3.156 and it seem that the problem is always here for  function GPIOIntTypeSet.

    As Amit had pointed out, we have fixed this issue internally. It will be available in the upcoming release. The fix we have is as follows. I did a preliminary test and it seems to work as expected.

        ASSERT(((ui32IntType & 0xF) == GPIO_FALLING_EDGE) ||
               ((ui32IntType & 0xF) == GPIO_RISING_EDGE) ||
               ((ui32IntType & 0xF) == GPIO_BOTH_EDGES) ||
               ((ui32IntType & 0xF) == GPIO_LOW_LEVEL) ||
               ((ui32IntType & 0xF) == GPIO_HIGH_LEVEL));
        ASSERT(((ui32IntType & 0x000F0000) == 0) ||
               (((ui32IntType & 0x000F0000) == GPIO_DISCRETE_INT) &&
                ((ui32Port == GPIO_PORTP_BASE) || (ui32Port == GPIO_PORTQ_BASE))));

    Maxime GUYON said:
    2) Also for the incorrect ASSERT in AES function, I think there is more than one incorrect ASSERT in the function

    I will look into these and try to have the fix for the upcoming release.

    Thanks,

    Sai