nxp-mcuxpresso/mcux-sdk

[BUG] FSL_FEATURE_FLEXSPI_HAS_RESET never defined

JonathonReinhart opened this issue · 3 comments

Describe the bug
As far as I can tell, FSL_FEATURE_FLEXSPI_HAS_RESET is not defined for any devices supported by this SDK. See this code search.

This flag is used to guard whether FLEXSPI_Init() will reset the flexspi block:

#if defined(FSL_FEATURE_FLEXSPI_HAS_RESET) && FSL_FEATURE_FLEXSPI_HAS_RESET
/*! @brief Pointers to FLEXSPI resets for each instance. */
static const reset_ip_name_t s_flexspiResets[] = FLEXSPI_RSTS;
#endif

and here:

#if defined(FSL_FEATURE_FLEXSPI_HAS_RESET) && FSL_FEATURE_FLEXSPI_HAS_RESET
/* Reset the FLEXSPI module */
RESET_PeripheralReset(s_flexspiResets[FLEXSPI_GetInstance(base)]);
#endif

The result is that FLEXSPI_Init() does not reset the FlexSPI as it is clearly intended to do.

Since the reset is asserted by default (on RT595), one must manually reset the peripheral (or clear the reset line) before FLEXSPI_Init() in order to to use it, e.g.

RESET_PeripheralReset(kFLEXSPI1_RST_SHIFT_RSTn);

Hi @JonathonReinhart, thanks for your comments. That's indeed an issue, I will fix it as soon as possible.

In b4dca30, you defined FLEXSPI_RESETS_ARRAY to FLEXSPI_RSTS. Any reason to not simply use FLEXSPI_RSTS instead?

In b4dca30, you defined FLEXSPI_RESETS_ARRAY to FLEXSPI_RSTS. Any reason to not simply use FLEXSPI_RSTS instead?

To align with format of other drivers.