AnsweredAssumed Answered

Repeated macro in FLEXSPI_SetFlashConfig()

Question asked by Simon Walke on Jun 5, 2019
Latest reply on Jun 10, 2019 by Jorge Antonio Alcala Vazquez

Our static analysis tools have picked up a potential issue in the code below, part of function FLEXSPI_SetFlashConfig()

 

configValue &= ~(FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK | FLEXSPI_FLSHCR2_AWRWAIT_MASK | FLEXSPI_FLSHCR2_AWRSEQNUM_MASK |
FLEXSPI_FLSHCR2_AWRSEQID_MASK | FLEXSPI_FLSHCR2_ARDSEQNUM_MASK | FLEXSPI_FLSHCR2_AWRSEQID_MASK);

 

The macro FLEXSPI_FLSHCR2_AWRSEQID_MASK appears twice in the expression (looks like a copy 'n paste error at the end of the line).

 

We have no specific bug attributable to this, but my question is whether the second occurrence should be using the sequence ID read mask instead of the write mask, i.e. using FLEXSPI_FLSHCR2_ARDSEQID_MASK.

 

Is this a reasonable assumption ? Obviously we can try it out and see if anything breaks, but just wondered if this has been spotted before ....

Outcomes