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.

[参考译文] TMDSCNCD263:SPI 数据宽度配置

Guru**** 2387830 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1234581/tmdscncd263-spi-data-width-configuration

器件型号:TMDSCNCD263

大家好、

我正在 针对微型 AM263使用 MCAL v8.6.2、我已将 SPI0和 SPI1配置为 CAT2 ISR。

两个通道的数据宽度都配置为8位。 附加了捕捉供您参考。  

对于 SPI0 AM、8位、因为它已配置为  

但我在 SPI1的逻辑分析仪中获得了9位。

您能告诉我犯了什么错误吗?

谢谢  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    我已经将其分配给了我们的 SPI 专家。

    谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    您能否共享 SPI 配置? SPI_Cfg.c、SPI_PBcfg.c

    谢谢。此致、

    Sunil Kumar M S

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Sunil:

    请查找文件

    /*
    *
    * Copyright (c) 2022 Texas Instruments Incorporated
    *
    * All rights reserved not granted herein.
    *
    * Limited License.
    *
    * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
    * license under copyrights and patents it now or hereafter owns or controls to make,
    * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
    * terms herein.  With respect to the foregoing patent license, such license is granted
    * solely to the extent that any such patent is necessary to Utilize the software alone.
    * The patent license shall not apply to any combinations which include this software,
    * other than combinations with devices manufactured by or for TI ("TI Devices").
    * No hardware patent is licensed hereunder.
    *
    * Redistributions must preserve existing copyright notices and reproduce this license
    * (including the above copyright notice and the disclaimer and (if applicable) source
    * code license limitations below) in the documentation and/or other materials provided
    * with the distribution
    *
    * Redistribution and use in binary form, without modification, are permitted provided
    * that the following conditions are met:
    *
    * *       No reverse engineering, decompilation, or disassembly of this software is
    * permitted with respect to any software provided in binary form.
    *
    * *       any redistribution and use are licensed by TI for use only with TI Devices.
    *
    * *       Nothing shall obligate TI to provide you with source code for the software
    * licensed and provided to you in object code.
    *
    * If software source code is provided to you, modification and redistribution of the
    * source code are permitted provided that the following conditions are met:
    *
    * *       any redistribution and use of the source code, including any resulting derivative
    * works, are licensed by TI for use only with TI Devices.
    *
    * *       any redistribution and use of any object code compiled from the source code
    * and any resulting derivative works, are licensed by TI for use only with TI Devices.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
    *
    * may be used to endorse or promote products derived from this software without
    * specific prior written permission.
    *
    * DISCLAIMER.
    *
    * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
    * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
    * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
    * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
    * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    * OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /**
     *  \file     Spi_Cfg.h
     *
     *  \brief    This file contains generated pre compile configuration file
     *            for SPI MCAL driver
     */
    
      /*****************************************************************************
        Project: Lecu
        Date   : 2023-06-06 10:38:03
        This file is generated by EB Tresos
        Do not modify this file, otherwise the software may behave in unexpected way.
     ******************************************************************************/
    
    /**
     *  \defgroup MCAL_SPI_CFG SPI Configuration
     *
     *  This files defines SPI MCAL configuration structures
     *  @{
     */
    
    #ifndef SPI_CFG_H_
    #define SPI_CFG_H_
    
    /* ========================================================================== */
    /*                             Include Files                                  */
    /* ========================================================================== */
    #include "Os.h"
    #include "Dem.h"
    #include "Det.h"
    #include "Spi_Cbk.h"
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    /**
    *  \brief SPI Build Variant.
    *   Build variants.(i.e Pre Compile,Post Build or Link time)
    */
    
    #define SPI_PRE_COMPILE_VARIANT       (STD_OFF)
    
    #define SPI_VARIANT_POST_BUILD        (STD_ON)
    
    #define SPI_LINK_TIME_VARIANT         (STD_OFF)
    
    /** \brief SPI Config ID */
    #define SPI_CFG_ID          (0x1U)
    
    /**
     *  \brief Pre Compile config macro name.
     */
    
    
    /** \brief Buffer mode - Internal or External or Both */
    #define SPI_CHANNELBUFFERS          (SPI_IB_EB)
    
    /** \brief Internal Buffer length in bytes - applicable only for SPI_IB */
    #define SPI_IB_MAX_LENGTH           (64U)
    
    /** \brief Enable/disable SPI dev detect error */
    #define SPI_DEV_ERROR_DETECT        (STD_ON)
    
    /** \brief Enable/disable SPI job log */
    #define SPI_JOB_LOG                 (STD_OFF)
    
    /** \brief Maximum job log entries when logging is ON */
    #define SPI_MAX_JOB_LOG             (100U)
    
    /*
     * Scalability levels
     */
    /** \brief Basic Synchronous functions */
    #define SPI_LEVEL_0                     (0U)
    /** \brief Basic Asynchronous functions */
    #define SPI_LEVEL_1                     (1U)
    /** \brief Synchronous and Asynchronous functions */
    #define SPI_LEVEL_2                     (2U)
    
    /** \brief Concurrent sync transmit support - by defualt this is off */
    #define SPI_SUPPORT_CONCURRENT_SYNC_TRANSMIT    (STD_OFF)
    
    /** \brief Scalability level */
    #define SPI_SCALEABILITY            (SPI_LEVEL_2)
    
    /** \brief Enable/disable SPI get version info API */
    #define SPI_VERSION_INFO_API        (STD_ON)
    
    /** \brief Enable/disable SPI HW Status API */
    #define SPI_HW_STATUS_API           (STD_ON)
    
    /** \brief Enable/disable SPI cancel API */
    #define SPI_CANCEL_API              (STD_ON)
    
    /*
     * All below macros are used for static memory allocation and can be changed to
     * match the usecase requirements.
     */
    /** \brief Maximum channels allowed per job */
    #define SPI_MAX_CHANNELS_PER_JOB    (2U)
    
    /** \brief Maximum jobs allowed per sequence */
    #define SPI_MAX_JOBS_PER_SEQ        (2U)
    
    /** \brief Maximum channels across all jobs/sequence/hwunit */
    #define SPI_MAX_CHANNELS            (2U)
    
    /** \brief Maximum jobs across all sequence/hwunit */
    #define SPI_MAX_JOBS                (2U)
    
    /** \brief Maximum sequence across all hwunit */
    #define SPI_MAX_SEQ                 (2U)
    
    /**
     *  \brief Maximum HW unit - This should match the sum for the below units ISR
     *  which are ON.
     */
    #define SPI_MAX_HW_UNIT             (2U)
    
    /**
     *  \brief Maximum external device cfg
     */
    #define SPI_MAX_EXT_DEV             (2U)
    
    
    
    
    
    /*
     All below macros are used for enabling the ISR for a particular hardware.
     */
    
    
    /** \brief Enable/disable SPI MCSPI0 unit ISR */
    
    #define SPI_UNIT_MCSPI0_ACTIVE      (STD_ON)
    
    /** \brief Enable/disable SPI MCSPI1 unit ISR */
    
    #define SPI_UNIT_MCSPI1_ACTIVE      (STD_ON)
    
    /** \brief Enable/disable SPI MCSPI2 unit ISR */
    
    #define SPI_UNIT_MCSPI2_ACTIVE      (STD_OFF)
    
    /** \brief Enable/disable SPI MCSPI3 unit ISR */
    
    #define SPI_UNIT_MCSPI3_ACTIVE      (STD_OFF)
    
    
    /** \brief Enable/disable SPI MCSPI4 unit ISR */
    
    #define SPI_UNIT_MCSPI4_ACTIVE      (STD_OFF)
    
    
    
    
    
    
    
    /** \brief ISR type */
    #define SPI_ISR_TYPE                (SPI_ISR_CAT2)
    
    /** \brief OS counter ID - used for timeout in case of error */
    #define SPI_OS_COUNTER_ID           ((CounterType)0U)
    
    /**
     *  \brief SPI timeout - used in McSPI IP reset
     *   Each tick is 31.25us (for 32K Counter). Wait for 100ms which comes to
     *   below value
     */
    #define SPI_TIMEOUT_DURATION        (32000U)
    
    /** \brief Enable/disable SPI register read back API */
    #define SPI_REGISTER_READBACK_API   (STD_ON)
    
    /** \brief Enable/disable SPI safety API */
    #define SPI_SAFETY_API   (STD_ON)
    
    /** \brief Symbolic Name Channel Id  - 0 SpiChannel_0 */
    #define SpiConf_SpiChannel_SpiChannel_0   0
    /** \brief Symbolic Name Channel Id  - 1 SpiChannel_1 */
    #define SpiConf_SpiChannel_SpiChannel_1   1
    
    /** \brief Symbolic Name Chip Select  - 0 */
    #define SpiConf_SpiExternalDevice_CS0 (SPI_CS0)
    
    
    /** \brief Symbolic Name Job Id - 0 SpiJob_0 */
    #define SpiConf_SpiJob_SpiJob_0            0
    
    
    /** \brief Symbolic Name Chip Select  - 1 */
    #define SpiConf_SpiExternalDevice_CS1 (SPI_CS0)
    
    
    /** \brief Symbolic Name Job Id - 1 SpiJob_1 */
    #define SpiConf_SpiJob_SpiJob_1            1
    
    /** \brief Symbolic Name Sequence Id - 0 SpiSequence_0 */
    #define SpiConf_SpiSequence_SpiSequence_0  0
    /** \brief Symbolic Name Sequence Id - 1 SpiSequence_1 */
    #define SpiConf_SpiSequence_SpiSequence_1  1
    
    
    #define SpiConf_SpiExternalDevice_SpiExternalDevice_0_CS0 SCS0
    #define SpiConf_SpiExternalDevice_SpiExternalDevice_1_CS0 SCS0
    /** \brief Symbolic Name HW Unit - 0 */
    #define SpiConf_SpiExternalDevice_SpiExternalDevice_0_HwUnitId0 CSIB0
    /** \brief Symbolic Name HW Unit - 0 */
    #define SpiConf_SpiExternalDevice_SpiExternalDevice_1_HwUnitId1 CSIB0
    
    
    /**
     *  \name SPI DEM Error codes to report
     *
     *  Pre-compile switches for enabling/disabling DEM events
     *  @{
     */
    #define DemConf_DemEventParameter_SPI_DEM_NO_EVENT (0xFFFFU)
    #define SPI_DEM_NO_EVENT DemConf_DemEventParameter_SPI_DEM_NO_EVENT
    
    #ifndef SPI_E_HARDWARE_ERROR
    /** \brief Hardware failed */
    #define SPI_E_HARDWARE_ERROR        (DemConf_DemEventParameter_SPI_E_HARDWARE_ERROR)
    #endif
    /**
     *  \name SPI HW unit Info
     *  @{
     */
    
    /** \brief MCSPI0 instance */
    #define SPI_UNIT_MCSPI0                     ((Spi_HWUnitType) CSIB0)
    /** \brief MCSPI1 instance */
    #define SPI_UNIT_MCSPI1                     ((Spi_HWUnitType) CSIB1)
    /** \brief MCSPI2 instance */
    #define SPI_UNIT_MCSPI2                     ((Spi_HWUnitType) CSIB2)
    /** \brief MCSPI3 instance */
    #define SPI_UNIT_MCSPI3                     ((Spi_HWUnitType) CSIB3)
    /** \brief MCSPI4 instance */
    #define SPI_UNIT_MCSPI4                     ((Spi_HWUnitType) CSIB4)
    
    
    /**
     *  \brief Total HW units - used for array allocation. This should be +1 of the
     *  max unit number
     */
    #define SPI_HW_UNIT_CNT                 (5U)
    
    extern const uint32 Spi_HwUnitBaseAddr[SPI_HW_UNIT_CNT];
    
    /* @} */
    
    /* ========================================================================== */
    /*                         Structures and Enums                               */
    /* ========================================================================== */
    
    
    /** \brief SPI Configuration struct declaration */
    extern const struct Spi_ConfigType_s SpiDriver;
    
    
    /* ========================================================================== */
    /*                          Function Declarations                             */
    /* ========================================================================== */
    /**
     *  \brief SPI Hwunit ISR
     */
    
    /*Function prototypes-ISR() are declared by OS for SPI_ISR_CAT2 */
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif  /* #ifndef SPI_CFG_H_ */
    
    /* @} */
    
    /*
    *
    * Copyright (c) 2022 Texas Instruments Incorporated
    *
    * All rights reserved not granted herein.
    *
    * Limited License.
    *
    * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
    * license under copyrights and patents it now or hereafter owns or controls to make,
    * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
    * terms herein.  With respect to the foregoing patent license, such license is granted
    * solely to the extent that any such patent is necessary to Utilize the software alone.
    * The patent license shall not apply to any combinations which include this software,
    * other than combinations with devices manufactured by or for TI ("TI Devices").
    * No hardware patent is licensed hereunder.
    *
    * Redistributions must preserve existing copyright notices and reproduce this license
    * (including the above copyright notice and the disclaimer and (if applicable) source
    * code license limitations below) in the documentation and/or other materials provided
    * with the distribution
    *
    * Redistribution and use in binary form, without modification, are permitted provided
    * that the following conditions are met:
    *
    * *       No reverse engineering, decompilation, or disassembly of this software is
    * permitted with respect to any software provided in binary form.
    *
    * *       any redistribution and use are licensed by TI for use only with TI Devices.
    *
    * *       Nothing shall obligate TI to provide you with source code for the software
    * licensed and provided to you in object code.
    *
    * If software source code is provided to you, modification and redistribution of the
    * source code are permitted provided that the following conditions are met:
    *
    * *       any redistribution and use of the source code, including any resulting derivative
    * works, are licensed by TI for use only with TI Devices.
    *
    * *       any redistribution and use of any object code compiled from the source code
    * and any resulting derivative works, are licensed by TI for use only with TI Devices.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
    *
    * may be used to endorse or promote products derived from this software without
    * specific prior written permission.
    *
    * DISCLAIMER.
    *
    * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
    * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
    * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
    * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
    * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    * OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /**
     *  \file     Spi_PBcfg.c
     *
     *  \brief    This file contains generated post build configuration file
     *            for SPI MCAL driver
     */
    
      /*****************************************************************************
        Project: Lecu
        Date   : 2023-06-06 10:38:03
        This file is generated by EB Tresos
        Do not modify this file, otherwise the software may behave in unexpected way
     ******************************************************************************/
    /*******************************************************************************
     *  INCLUDES
     ******************************************************************************/
    #include "Spi.h"
    #include "Spi_Irq.h"
    
    
    /*******************************************************************************
     *  VERSION CHECK
     ******************************************************************************/
    #if ((SPI_SW_MAJOR_VERSION != (8U)) || (SPI_SW_MINOR_VERSION != (6U)))
      #error "Version numbers of Spi_PBcfg.c and Spi.h are inconsistent!"
    #endif
    /*******************************************************************************
     *  LOCAL CONSTANT MACROS
     ******************************************************************************/
    
    /*******************************************************************************
     *  LOCAL FUNCTION MACROS
     ******************************************************************************/
    
    /*******************************************************************************
     *  LOCAL DATA TYPES AND STRUCTURES
     ******************************************************************************/
    
    /*******************************************************************************
     *  LOCAL DATA PROTOTYPES
     ******************************************************************************/
    
    /*******************************************************************************
     *  GLOBAL DATA
     ******************************************************************************/
    #define  SPI_START_SEC_CONFIG_DATA
    #include "Spi_MemMap.h"
    /* generation of runtime configuration       */
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    
    
    extern void SpiApp_McspiJob0EndNotification(void);
    extern void SpiApp_McspiJob1EndNotification(void);
    
    extern void SpiApp_McspiSeq0EndNotification(void);
    extern void SpiApp_McspiSeq1EndNotification(void);
    
    CONST(struct Spi_ConfigType_s, SPI_CONFIG_DATA) SpiDriver =
    {
        .maxChannels = 2U,
        .maxJobs = 2U,
        .maxSeq  = 2U,
        .maxHwUnit = 2U,
        .maxExtDevCfg = 2U,
        .channelCfg =
        {
                [0] =
                {
                    .channelBufType = SPI_EB,
                    .dataWidth = 8U,
                    .defaultTxData = 0U,
                    .maxBufLength = 100U,
                    .transferType = SPI_MSB,
                },
                [1] =
                {
                    .channelBufType = SPI_EB,
                    .dataWidth = 8U,
                    .defaultTxData = 0U,
                    .maxBufLength = 100U,
                    .transferType = SPI_MSB,
                },
            },
        .jobCfg =
        {
                [0] =
                {
                    .jobPriority = SPI_JOB_PRIORITY_0,
                    .hwUnitId = SPI_UNIT_MCSPI0,
                    .Spi_JobEndNotification = SpiApp_McspiJob0EndNotification,
                    .channelPerJob = 1U,
                    .channelList =
                    {
                        [0] = 0U,
                    },
                },
                [1] =
                {
                    .jobPriority = SPI_JOB_PRIORITY_1,
                    .hwUnitId = SPI_UNIT_MCSPI1,
                    .Spi_JobEndNotification = SpiApp_McspiJob1EndNotification,
                    .channelPerJob = 1U,
                    .channelList =
                    {
                        [1] = 1U,
                    },
                },
            },
        .seqCfg =
        {
                [0] =
                {
                    .seqInterruptible = (uint8) TRUE,
                    .Spi_SequenceEndNotification = SpiApp_McspiSeq0EndNotification,
                    .jobPerSeq = 1U,
                    .jobList =
                    {
                        0U,
                    },
                },
                [1] =
                {
                    .seqInterruptible = (uint8) TRUE,
                    .Spi_SequenceEndNotification = SpiApp_McspiSeq1EndNotification,
                    .jobPerSeq = 1U,
                    .jobList =
                    {
                        1U,
                    },
                },
            },
        .hwUnitCfg =
        {
                [0] =
                {
                    .hwUnitId = SPI_UNIT_MCSPI0,
                },
                [1] =
                {
                    .hwUnitId = SPI_UNIT_MCSPI1,
                },
            },
        .extDevCfg =
        {
                [0] =
                {
            .mcspi =
                    {
                        .csEnable = (uint16) TRUE,
                        .csMode   = SPI_CONTINUOUS,
                        .csPolarity = SPI_HIGH,
                        .csIdleTime = SPI_DATADELAY_0,
                        .clkDivider = 99U,
                        .clkMode = SPI_CLK_MODE_0,
                        .txRxMode     = SPI_TX_RX_MODE_BOTH,
                        .startBitEnable =  (uint16) FALSE,
                        .startBitLevel  = SPI_LOW,
                        .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                        .transmissionLineEnable  = DATA_LINE_0_TRANSMISSION,
                    },
                },
                [1] =
                {
            .mcspi =
                    {
                        .csEnable = (uint16) TRUE,
                        .csMode   = SPI_CONTINUOUS,
                        .csPolarity = SPI_HIGH,
                        .csIdleTime = SPI_DATADELAY_0,
                        .clkDivider = 49U,
                        .clkMode = SPI_CLK_MODE_1,
                        .txRxMode     = SPI_TX_RX_MODE_BOTH,
                        .startBitEnable =  (uint16) TRUE,
                        .startBitLevel  = SPI_LOW,
                        .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                        .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                    },
                },
            },
    };
    
    
    
    CONST(Spi_ChannelConfigType_PC, SPI_CONFIG_DATA) Spi_ChannelConfig_PC[] =
    {
        [0] =
            {
                .channelId = SpiConf_SpiChannel_SpiChannel_0,
            },
        [1] =
            {
                .channelId = SpiConf_SpiChannel_SpiChannel_1,
            },
    };
    
    CONST(Spi_JobConfigType_PC, SPI_CONFIG_DATA) Spi_JobConfig_PC[] =
    {
        [0] =
            {
                .jobId = SpiConf_SpiJob_SpiJob_0,
                .csPin = SpiConf_SpiExternalDevice_CS0,
                .externalDeviceCfgId = (uint8)0,
            },
        [1] =
            {
                .jobId = SpiConf_SpiJob_SpiJob_1,
                .csPin = SpiConf_SpiExternalDevice_CS1,
                .externalDeviceCfgId = (uint8)1,
            },
    };
    
    CONST(Spi_SeqConfigType_PC, SPI_CONFIG_DATA) Spi_SeqConfig_PC[] =
    {
        [0] =
            {
                .seqId = SpiConf_SpiSequence_SpiSequence_0,
            },
        [1] =
            {
                .seqId = SpiConf_SpiSequence_SpiSequence_1,
            },
    };
    
    
    
    /**
     *  \brief This type defines a range of HW SPI Hardware microcontroller
     *         peripheral allocated to this Job
     */
    const uint32 Spi_HwUnitBaseAddr[SPI_HW_UNIT_CNT] =
    {
     
     
       0x52200000 ,      	            /* MCSPI0 */
       0x52201000 ,      	    /* MCSPI1 */
       0x52202000 ,      	    /* MCSPI2 */
       0x52203000 ,      	    /* MCSPI3 */
       0x52204000      	    /* MCSPI4 */
    };
    
    #ifdef __cplusplus
    }
    #endif
    
    #define  SPI_STOP_SEC_CONFIG_DATA
    #include "Spi_MemMap.h"
    
    #define  SPI_START_SEC_ISR_CODE
    #include "Spi_MemMap.h"
    /**
     *  \brief SPI Hwunit ISR
     */
    
    
    ISR(Spi_IrqUnitMcspi0TxRx)
    {
        Spi_IntISR_McspiTxRx(SPI_UNIT_MCSPI0);
    }
    
    ISR(Spi_IrqUnitMcspi1TxRx)
    {
        Spi_IntISR_McspiTxRx(SPI_UNIT_MCSPI1);
    }
    
    #define  SPI_STOP_SEC_ISR_CODE
    #include "Spi_MemMap.h"
    /*******************************************************************************
     *  END OF FILE: Spi_PBcfg.c
     ******************************************************************************/
    

    谢谢。此致、

    鲁比纳  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    您能澄清以下问题吗?

    1. 在连接的配置中、 SPI0实例配置为  环回模式、SPI1实例未配置为环回模式。 这是预期结果吗?
    2. 在您所连接的快照中、您能解释什么是0xFF、0x12、0x1FF 吗? 很抱歉、我清楚地理解了。

    谢谢。此致、

    Sunil Kumar M S

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Sunil:

    1.没有配置要求。 从那里 将 SPI1配置为环回模式

    2.在此快照中  

    12是 MOSI 数据。

    FF 和1FF 是来自 MISO 的数据。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    您能解释一下您在这里设置的测试吗?

     SPI0和 SPI1是否已连接至任何从器件?

    我看到您在环回模式下配置了 SPI0、而没有配置 SPI1。

    此外、您还配置了 SPI1_CS1、CS1是否连接到从器件?

    谢谢。此致、

    Sunil Kumar M S

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Sunil:

    到目前为止、未连接从器件。 我只是单独验证 SPI TX。  

    谢谢。此致、

    J·鲁比纳

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    您能否共享 SPI0和 SPI1的 MOSI 和 MISO 波形? 请勿启用逻辑分析仪来分析 SPI 数据? 我想在没有它的情况下进行检查。   

    谢谢。此致、

    Sunil Kumar M S

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    这里有更新吗?

    谢谢。此致、

    Sunil Kumar M S

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Sunil:

    请查找 MISO 和 MOSI 的 SPI 1波形

    请找到 SPI 0 MISO 和 MOSI 的波形

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rubina:

    感谢您分享这些波形。 如果我查看 SPI1 配置、您已经启用了起始位。 因此、将 在 MSB 之前添加起始位、以指示
    下一个 MCSPI 字是必须作为命令处理还是作为数据处理。 请参阅部分 "MCSPI 协议和数据格式" 其他信息。

     

    谢谢。此致、

    Sunil Kumar M S

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Sunil:

    谢谢你。 我来签入配置并将其更新为  

    谢谢。此致、

    J·鲁比纳