Suggestions for fsl_flexspi.c, fsl_flexspi.h

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Suggestions for fsl_flexspi.c, fsl_flexspi.h

228件の閲覧回数
rshipman
Contributor V

Hi,

Can I suggest a couple of asserts for flexspi.c please?

RT1021, SDK 2.15.0

1. In fsl_flexspi.c

Assert #1:

 

status_t FLEXSPI_TransferBlocking(FLEXSPI_Type *base, flexspi_transfer_t *xfer)
{
    <snip>

    /* Configure data size. */
    if ((xfer->cmdType == kFLEXSPI_Read) || (xfer->cmdType == kFLEXSPI_Write) || (xfer->cmdType == kFLEXSPI_Config))
    {
        configValue = FLEXSPI_IPCR1_IDATSZ(xfer->dataSize);
        // Catch when dataSize is > max possible.
        assert(((configValue & (FLEXSPI_IPCR1_IDATSZ_MASK)) >> (FLEXSPI_IPCR1_IDATSZ_SHIFT)) == xfer->dataSize);
    }

 

 

Assert #2:

 

status_t FLEXSPI_TransferNonBlocking(FLEXSPI_Type *base, flexspi_handle_t *handle, flexspi_transfer_t *xfer)
{
    <snip>

        /* Configure data size. */
        if ((xfer->cmdType == kFLEXSPI_Read) || (xfer->cmdType == kFLEXSPI_Write))
        {
            configValue = FLEXSPI_IPCR1_IDATSZ(xfer->dataSize);
            // Catch when dataSize is > max possible.
            assert(((configValue & (FLEXSPI_IPCR1_IDATSZ_MASK)) >> (FLEXSPI_IPCR1_IDATSZ_SHIFT)) == xfer->dataSize);
        }

 

 


2. In fsl_flexspi.h

 

/*! @brief Transfer structure for FLEXSPI. */
typedef struct _flexspi_transfer
{
    uint32_t deviceAddress;         /*!< Operation device address. */
    flexspi_port_t port;            /*!< Operation port. */
    flexspi_command_type_t cmdType; /*!< Execution command type. */
    uint8_t seqIndex;               /*!< Sequence ID for command. */
    uint8_t SeqNumber;              /*!< Sequence number for command. */
    uint8_t *data;                 /*!< Data buffer. */
    size_t dataSize;                /*!< Data size in bytes. */
} flexspi_transfer_t;

 

Make the data field uint8_t* instead of uint32_t*. Because it is cast to uint8_t* when it is used. I think this is a hangover from when _flexspi_handle's data field was uint32_t* (and associated code in the .c file), but is now uint8_t*.

Kind regards.

タグ(2)
0 件の賞賛
1 返信

184件の閲覧回数
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @rshipman,

Thanks for the suggestions.

I will pass them on to the SDK team so they can take a look into this and deliberate on the implementation of these changes.

BR,
Edwin.

0 件の賞賛