nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
339 stars 148 forks source link

[BUG] FSL_FEATURE_FLEXSPI_HAS_RESET never defined #200

Closed JonathonReinhart closed 4 months ago

JonathonReinhart commented 4 months ago

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:

https://github.com/nxp-mcuxpresso/mcux-sdk/blob/1cb5377bf2bf4a7b1b6415c662100dc01b981e07/drivers/flexspi/fsl_flexspi.c#L102-L105

and here:

https://github.com/nxp-mcuxpresso/mcux-sdk/blob/1cb5377bf2bf4a7b1b6415c662100dc01b981e07/drivers/flexspi/fsl_flexspi.c#L265-L268

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);
Albort12138 commented 4 months ago

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

JonathonReinhart commented 4 months ago

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

Albort12138 commented 4 months ago

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.