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.

[参考译文] CC1312R:低于1GHz 论坛

Guru**** 2539840 points
Other Parts Discussed in Thread: CC1312R, SYSCONFIG

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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1124027/cc1312r-sub-1-ghz-forum

器件型号:CC1312R
Thread 中讨论的其他器件: SysConfig

尊敬的 TI:

我们将提供使用 CC1312R MCU 运行低于1GHz 功能的平台、并需要创建第二个 UART 端口。

  a.是否有任何信息介绍了如何在 SENSOR_CC1312R1_LAUNCHXL/collector_CC1312R1_LAUNCHXL 中添加第二个 UART?

   B. EVB 上用于 TX/RX/CTS/CTS/RTS/GD/VCC 的第2个 UART 的引脚是什么、我们可以连接它们以检查 UART 功能?

2.我在 .syscfg 中有 UART 和 UART2。 UART 和 UART2有何不同?

谢谢。

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

    您好、Jarvis、

    您可以在 SysConfig 的 UART2模块中添加第二个 UART2实例。

    UART2是经过改进的 UART 驱动程序、是更新 SDK 中支持的推荐驱动程序。 因此、请使用 UART2。  

    添加新的 UART2实例并选择流控时、可以看到分配给模块的引脚。

    此致、

    SID

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

    您好 Siddanth、

    我想在"sensor_CC1312R1_LAUNCHXL_tirtos7_ccs"和"collector_CC1312R1_LAUNCHXL_tirtos7_ccs"中添加第二个 UART (带 CTS/RTS)。

    启用 SysConfig 中的第二个 UART 后、我要查看哪些文档/示例项目来实现它、因为我不知道这一点?

    谢谢。

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

    您好、Jarvis、  

    有关 UART2驱动程序的使用示例,请访问 :https://dev.ti.com/tirex/explore/node?node=ALsZ3JX073z10vfOu.6PSg__BSEc4rl__LATEST

    我们没有使用硬件流控制的开箱即用示例、但技术参考手册中提供了有关此用法的说明

     第21.4.4.2节中的"流量控制"。  dev.ti.com/.../node

    有关 UART2驱动程序本身的更多文档、请访问 :https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_6_20_00_29/docs/drivers/doxygen/html/_u_a_r_t2_8h.html

    此致、

    SID

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

    您好 Siddanth、

    我尝试将 main_tirtos.c 和 uart2echo.c 添加到 "sensor_CC1312R1_LAUNCHXL_tirtos7_ccs"中、但它会在编译器代码期间显示错误。

    错误是应用程序(main.c)和 main_tirtos.c 中定义的"main"函数

    您是否对其进行了任何评论修改?

    谢谢。

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

    您好、Jarvis、

    Siddanth 的意思是、您应该在 uart2echo 示例中查看与 UART2相关的代码、并在应用中包含所需的函数调用。 最重要的是、从传感器示例开始、您需要在 SysConfig 中添加第二个 UART2实例。 为此、请双击项目中的.syscfg 文件、然后按如下所示添加 UART2实例:

    这将生成所有所需的结构和定义、以支持使用第二个 UART 外设。

    然后在应用程序代码中设置参数并打开 UART2驱动程序的第二个实例:

    const char   echoPrompt[] = "Echoing characters:\r\n";
    UART2_Handle secondUart;
    UART2_Params secondUartParams;
    size_t       bytesWritten = 0;
    uint32_t     status = UART2_STATUS_SUCCESS;
    
    /* Create a UART where the default read and write mode is BLOCKING */
    UART2_Params_init(&secondUartParams);
    secondUartParams.baudRate = 115200;
    
    secondUart = UART2_open(CONFIG_UART2_1, &uartParams);
    
    if (secondUart == NULL) {
        /* UART2_open() failed */
        while (1);
    }
    
    UART2_write(secondUart, echoPrompt, sizeof(echoPrompt), &bytesWritten);

    此时、您应该能够使用辅助 UART 句柄向第二个 UART 总线写入数据或从第二个 UART 总线读取数据。

    此致、

    高斯图

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

    您好 、Fausto、

    我已经按照如下方式修改了代码、并检查了 UART2函数、但仍然无法正常工作。

    源代码中是否存在任何问题?

    sensor_sysconfig_setting

    e2e.ti.com/.../Sensor_5F00_CC1312R1_5F00_tirtos_5F00_ccs_2D00_application_2D00_main.c

    谢谢。

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

    尊敬的 TI:

    我已验证"uart2ECHO_CC1312R1_LAUNCHXL_tirtos7_ticlang"以添加第二个 UART 以便 从  CONFIG_UART2_0读取并写入 CONFIG_UART2_1、修改后的代码已启用。

    当我尝试将"main_tirtos.c"和"uart2echo.c"的相同方法添加到"sensor_CC1312R1_LAUNCHXL_tirtos7_tronicang"时、它将满足编译器错误、添加代码"pthread_attr_init (&attrs)"。

    是否有任何注释可将第二个 UART 添加到 "sensor_CC1312R1_LAUNCHXL_tirtos7_ticlang"?

     

    uart2ECHO_CC1312R1_LAUNCHXL_tirtos7_ticlang

    === uart2echo.c============

    UART = UART2_open (CONFIG_UART2_0、uartParams);

    if (UART == NULL){
    /* UART2_open()失败*/
    while (1);

    uart2 = UART2_open (CONFIG_UART2_1、uartParams);

    if (uart2 == NULL){
    /* UART2_open()失败*/
    while (1);

    /*打开用户 LED 指示初始化成功*/
    GPIO_WRITE (CONFIG_GPIO_LED_0、CONFIG_GPIO_LED_ON);

    UART2_WRITE (UART、echoPrompt、sizeof (echoPrompt)、bytesWritten);

    /*循环永久回显*/
    while (1){
    bytesRead = 0;
    while (bytesRead = 0){
    STATUS = UART2_READ (UART、&INPUT、1、&bytesRead);

    if (status!= UART2_STATUS_SUCCESS){
    /* UART2_READ()失败*/
    while (1);

    字节 Written = 0;
    while (bytesWritten =0){
    //status = UART2_WRITE (UART、&INPUT、1、&bytesWritten);
    状态= UART2_WRITE (uart2、&INPUT、1、&bytesWritten);

    if (status!= UART2_STATUS_SUCCESS){
    /* UART2_write()失败*/
    while (1);



    ===================

    谢谢

    sensor_CC1312R1_LAUNCHXL_tirtos7_ticlang_applicationmain.c
    
    
    
    
    /******************************************************************************
    
     @file main.c
    
     @brief main entry of the example application
    
     Group: WCS LPC
     Target Device: cc13xx_cc26xx
    
     ******************************************************************************
     
     Copyright (c) 2016-2022, Texas Instruments Incorporated
     All rights reserved.
    
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
    
     *  Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
    
     *  Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
    
     *  Neither the name of Texas Instruments Incorporated nor the names of
        its contributors may be used to endorse or promote products derived
        from this software without specific prior written permission.
    
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
     CONTRIBUTORS 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.
    
     ******************************************************************************
     
     
     *****************************************************************************/
    
    /******************************************************************************
     Includes
     *****************************************************************************/
    
    #include <xdc/std.h>
    
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    
    #include <ioc.h>
    
    #include "sys_ctrl.h"
    
    #include "ti_drivers_config.h"
    
    #include <inc/hw_ccfg.h>
    #include <inc/hw_ccfg_simple_struct.h>
    
    /* Header files required for the temporary idle task function */
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    #include <ti/drivers/GPIO.h>
    #include <aon_rtc.h>
    #include <prcm.h>
    
    #include <stdint.h>
    /* POSIX Header files */
    #include <pthread.h>
    #include <ti/drivers/Board.h>
    extern void *mainThread(void *arg0);
    /* Stack size in bytes */
    #define THREADSTACKSIZE    1024
    
    
    #if (defined(FEATURE_BLE_OAD) || defined(FEATURE_NATIVE_OAD)) && !defined(OAD_ONCHIP)
    #include <ti/drivers/SPI.h>
    #endif
    
    #if defined(FEATURE_BLE_OAD)
        #include "ble_oad/oad_switch.h"
    #endif
    
    /* Header files required to enable instruction fetch cache */
    #include <vims.h>
    #include <hw_memmap.h>
    
    #include <ti/sysbios/hal/Hwi.h>
    
    
    #include "cpu.h"
    
    #ifdef NV_RESTORE
    #include "macconfig.h"
    #include "nvocmp.h"
    #endif
    
    #include <string.h>
    #ifdef OSAL_PORT2TIRTOS
    #include "macTask.h"
    #else
    #include "api_mac.h"
    #include "icall.h"
    #endif
    
    #include "ssf.h"
    
    #include "sensor.h"
    
    #ifndef USE_DEFAULT_USER_CFG
    
    #include "mac_user_config.h"
    
    #ifndef CUI_DISABLE
    #include "cui.h"
    #endif
    
    #ifdef USE_ITM_DBG
    #include "itm.h"
    #endif
    
    /* MAC user defined configuration */
    macUserCfg_t macUser0Cfg[] = MAC_USER_CFG;
    
    #endif /* USE_DEFAULT_USER_CFG */
    
    /******************************************************************************
     Constants
     *****************************************************************************/
    
    /* Assert Reasons */
    #define MAIN_ASSERT_MAC          3
    #define MAIN_ASSERT_HWI_TIRTOS   4
    
    #define MAX_ASSERT_TOGGLE_COUNT  500000
    
    #define RFC_MODE_BLE                 PRCM_RFCMODESEL_CURR_MODE1
    #define RFC_MODE_IEEE                PRCM_RFCMODESEL_CURR_MODE2
    #define RFC_MODE_ANT                 PRCM_RFCMODESEL_CURR_MODE4
    #define RFC_MODE_EVERYTHING_BUT_ANT  PRCM_RFCMODESEL_CURR_MODE5
    #define RFC_MODE_EVERYTHING          PRCM_RFCMODESEL_CURR_MODE6
    
    /* Extended Address offset in FCFG (LSB..MSB) */
    #define EXTADDR_OFFSET 0x2F0
    
    #define APP_TASK_PRIORITY   1
    #if defined(DeviceFamily_CC13X2) || defined(DeviceFamily_CC26X2) || \
        defined(DeviceFamily_CC13X2X7) || defined(DeviceFamily_CC26X2X7) || \
        defined(DeviceFamily_CC13X1) || defined(DeviceFamily_CC26X1) || \
        defined(DeviceFamily_CC13X4) || defined(DeviceFamily_CC26X4) || defined(DeviceFamily_CC26X3)
    #define APP_TASK_STACK_SIZE 2048
    #else
    #define APP_TASK_STACK_SIZE 900
    #endif
    
    #define SET_RFC_MODE(mode) HWREG( PRCM_BASE + PRCM_O_RFCMODESEL ) = (mode)
    
    /******************************************************************************
     External Variables
     *****************************************************************************/
    
    extern ApiMac_sAddrExt_t ApiMac_extAddr;
    
    /******************************************************************************
     Global Variables
     *****************************************************************************/
    Task_Struct appTask;        /* not static so you can see in ROV */
    static uint8_t appTaskStack[APP_TASK_STACK_SIZE];
    
    #ifdef OSAL_PORT2TIRTOS
    static uint8_t _macTaskId;
    #endif
    
    /*
     When assert happens, this field will be filled with the reason:
           MAIN_ASSERT_HWI_TIRTOS or MAIN_ASSERT_MAC
     */
    uint8 Main_assertReason = 0;
    
    #ifdef NV_RESTORE
    mac_Config_t Main_user1Cfg = { 0 };
    #endif
    
    /******************************************************************************
     Local Variables
     *****************************************************************************/
    /* Used to check for a valid extended address */
    static const uint8_t dummyExtAddr[] =
        { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
    
    extern void Board_init(void);
    
    /*!
     * @brief       Reads the IEEE extended MAC address from the CCFG
     * @param       addr - Extended address pointer
     */
    static inline void CCFGRead_IEEE_MAC(ApiMac_sAddrExt_t addr)
    {
        uint32_t macAddr = (( HWREG(
                CCFG_BASE + CCFG_O_IEEE_MAC_0 ) &
                CCFG_IEEE_MAC_0_ADDR_M ) >>
                CCFG_IEEE_MAC_0_ADDR_S );
        memcpy(addr, (uint8_t *)&macAddr, (APIMAC_SADDR_EXT_LEN / 2));
    
        macAddr = (( HWREG(
                CCFG_BASE + CCFG_O_IEEE_MAC_1 ) &
                CCFG_IEEE_MAC_1_ADDR_M ) >>
                CCFG_IEEE_MAC_1_ADDR_S );
        memcpy(addr + (APIMAC_SADDR_EXT_LEN / 2), (uint8_t *)&macAddr,
               (APIMAC_SADDR_EXT_LEN / 2));
    }
    
    /*!
     * @brief       Fill in your own assert function.
     *
     * @param       assertReason - reason: MAIN_ASSERT_HWI_TIRTOS or
     *                                     MAIN_ASSERT_MAC
     */
    void Main_assertHandler(uint8_t assertReason)
    {
        Main_assertReason = assertReason;
    
    #if defined(RESET_ASSERT)
        Ssf_assertInd(assertReason);
    
        /* Pull the plug and start over */
        SysCtrlSystemReset();
    #else
        Hwi_disable();
        while(1)
        {
            /* Put you code here to do something if in assert */
        }
    #endif
    }
    
    /*!
     * @brief       Main task function
     *
     * @param       a0 -
     * @param       a1 -
     */
    Void appTaskFxn(UArg a0, UArg a1)
    {
        /* The following code encapsulated in TI_154STACK_FPGA flag is used for
         * internal FPGA evaluation of the 15.4 Stack and should not be used with
         * TI hardware platforms. */
    #ifdef TI_154STACK_FPGA
        /* FPGA build disables POWER constraints */
        Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
        Power_setConstraint(PowerCC26XX_SB_DISALLOW);
    
        IOCPortConfigureSet(IOID_29, IOC_PORT_RFC_GPO0, IOC_IOMODE_NORMAL);
        IOCPortConfigureSet(IOID_30, IOC_PORT_RFC_GPI0, IOC_INPUT_ENABLE);
        IOCPortConfigureSet(IOID_15, IOC_PORT_RFC_TRC, IOC_IOMODE_NORMAL);
        // configure RF Core SMI Command Link
        IOCPortConfigureSet(IOID_22, IOC_IOCFG0_PORT_ID_RFC_SMI_CL_OUT, IOC_STD_OUTPUT);
        IOCPortConfigureSet(IOID_21, IOC_IOCFG0_PORT_ID_RFC_SMI_CL_IN, IOC_STD_INPUT);
    #endif
    
    #ifndef OSAL_PORT2TIRTOS
        /* Initialize ICall module */
        ICall_init();
    #endif
        /* Copy the extended address from the CCFG area */
        CCFGRead_IEEE_MAC(ApiMac_extAddr);
    
        /* Check to see if the CCFG IEEE is valid */
        if(memcmp(ApiMac_extAddr, dummyExtAddr, APIMAC_SADDR_EXT_LEN) == 0)
        {
            /* No, it isn't valid.  Get the Primary IEEE Address */
            memcpy(ApiMac_extAddr, (uint8_t *)(FCFG1_BASE + EXTADDR_OFFSET),
                   (APIMAC_SADDR_EXT_LEN));
        }
    
    #ifdef NV_RESTORE
        /* Setup the NV driver */
        NVOCMP_loadApiPtrs(&Main_user1Cfg.nvFps);
    
        if(Main_user1Cfg.nvFps.initNV)
        {
            Main_user1Cfg.nvFps.initNV( NULL);
        }
    #endif
    
        /* Initialize the application */
    #ifdef OSAL_PORT2TIRTOS
        Sensor_init(_macTaskId);
    #else
        ICall_createRemoteTasks();
    
        /* Initialize the application */
        Sensor_init();
    #endif
    
        /* Kick off application - Forever loop */
        while(1)
        {
            Sensor_process();
        }
    }
    
    /*!
     * @brief       TIRTOS HWI Handler.  The name of this function is set to
     *              M3Hwi.excHandlerFunc in app.cfg, you can disable this by
     *              setting it to null.
     *
     * @param       excStack - TIROS variable
     * @param       lr - TIROS variable
     */
    xdc_Void Main_excHandler(UInt *excStack, UInt lr)
    {
        /* User defined function */
        Main_assertHandler(MAIN_ASSERT_HWI_TIRTOS);
    }
    
    /*!
     * @brief       HAL assert handler required by OSAL memory module.
     */
    void assertHandler(void)
    {
        /* User defined function */
        Main_assertHandler(MAIN_ASSERT_MAC);
    }
    
    
    /*!
     * @brief       "main()" function - starting point
     */
    int main(void)
    {
        Task_Params taskParams;
    
    #ifndef USE_DEFAULT_USER_CFG
        macUser0Cfg[0].pAssertFP = assertHandler;
    #endif
    
        /*
         Initialization for board related stuff such as LEDs
         following TI-RTOS convention
         */
        Board_init();
    
    #if defined(FEATURE_BLE_OAD) && !defined(OAD_IMG_A)
        /* If FEATURE_BLE_OAD is enabled, look for a left button
         *  press on reset. This indicates to revert to some
         *  factory image
         */
        if(!GPIO_read(CONFIG_GPIO_BTN1))
        {
            OAD_markSwitch();
        }
    #endif /* FEATURE_BLE_OAD */
    
    #if (defined(FEATURE_BLE_OAD) || defined(FEATURE_NATIVE_OAD)) && !defined(OAD_ONCHIP)
        SPI_init();
    #endif
    
    #if !defined(POWER_MEAS) && !defined(CUI_DISABLE)
        /* Initialize CUI UART */
        CUI_params_t cuiParams;
        CUI_paramsInit(&cuiParams);
    
        // One-time initialization of the CUI
    
        // All later CUI_* functions will be ignored if this isn't called
        CUI_init(&cuiParams);
    #endif
    
    #ifdef OSAL_PORT2TIRTOS
        _macTaskId = macTaskInit(macUser0Cfg);
    #endif
    
        /* Configure task. */
        Task_Params_init(&taskParams);
        taskParams.stack = appTaskStack;
        taskParams.stackSize = APP_TASK_STACK_SIZE;
        taskParams.priority = APP_TASK_PRIORITY;
        Task_construct(&appTask, appTaskFxn, &taskParams, NULL);
    
    #ifdef USE_ITM_DBG
        ITM_config itm_config =
        {
          48000000,
          ITM_6000000
        };
        ITM_initModule(itm_config);
        ITM_enableModule();
    #endif /* USE_ITM_DBG */
    
        pthread_t           thread;
        pthread_attr_t      attrs;
        struct sched_param  priParam;
        int                 retc;
    
        pthread_attr_init(&attrs);   <-- Error
    
    
    
        BIOS_start(); /* enable interrupts and start SYS/BIOS */
    
        return (0);
    }

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

    您好、Jarvis、

    我刚刚尝试从6.10.00.29 simplelink SDK 导入传感器示例、并在您之前的帖子中使用 UART2命令进行编译、但看不到任何编译错误。 在执行示例时、您是否遇到第二个 UART 功能错误?

    关于您的上一篇帖子:

    您收到"pthread_attr_init (&atttrs)"错误、因为传感器示例不支持 tivix、而仅支持 tirtos7调用。 tiposix 是位于 tirtos7和 FreeRTOS 之上的 POSIX 抽象层、可通过 POSIX 样式函 数调用实现两个操作系统之间的代码兼容性。  

    因此、如果您需要在传感器示例中创建任务、您应该使用 Task_con构 调用来执行它、因为它是在项目中包含的 application/main.c 文件中完成的。 请勿尝试从 uart2echo 示例复制/粘贴整个任务。 只需将 UART2驱动程序调用移植到传感器示例中所需的位置即可。

    如果您遇到更多困难、请告诉我。

    此致、

    高斯图

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

    此外、正如我的同事在前面提到过的、在电子邮件/交付内容中、SDK 6.10.00.29中存在一个有关硬件流控制的错误、导致 CTS 和 RTS 引脚配置不正确。 需要对文件  C 应用以下修复:\ti\simplelink_cc13xx_cc26xx_sdk_6_10_00_29\source\ti\drivers\.meta\uart2\UART2CC26XX.Board.c.xdt:

    修改中的行120和121  

    %         ctsPinName = 'ctsPin' in inst ? inst.ctsPinInstance.$name : 'GPIO_INVALID_INDEX';
    %         rtsPinName = 'rtsPin' in inst ? inst.rtsPinInstance.$name : 'GPIO_INVALID_INDEX';
    

    更改为

    %         ctsPinName = 'ctsPinInstance' in inst ? inst.ctsPinInstance.$name : 'GPIO_INVALID_INDEX';
    %         rtsPinName = 'rtsPinInstance' in inst ? inst.rtsPinInstance.$name : 'GPIO_INVALID_INDEX';
    

    然后清理并重新编译工程、以便将更改包含在编译中。

    此致、

    高斯图

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

    您好、Fausto、

    之前已在 SDK 中修改了"C:\ti\simplelink_cc13xx_cc26xx_sdk_6_10_00_29\sources\ti\drivers\.meta\uart2\UART2CC26XX.Board.c.xdt"。

    是否应在“CONFIG_UART2_1”中启用流控制?

    uart2echo_read 或 uart2echo_write 的源代码中是否有任何更改项?

    我通过设置 CTS (DIO18)/RTS (DIO19)引脚和连接第三个 UART 软件狗启用了流控制、但它仍然无法在示例代码中支持读取/重置。  

    谢谢。

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

    您好、Jarvis、

    是的、您应该在要使用流控制的 UART2外设上启用流控制。 如果要在第二个 UART 外设(UART1)上使用流控制、应在 CONFIG_UART2_1上启用流控制。  

    到底什么情况不起作用? 您能看到使用逻辑分析仪将 CTS/RTS 引脚置为有效吗? 您能否显示 CONFIG_UART2_1执行的 UART 传输的捕捉?

    此致、

    高斯图

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

    尊敬的 Fausto:

    请查看下面的错误图片以及我尝试将第二个 UART 添加到 v15.4堆栈传感器示例的示例代码。

    我将很快检查 CTS/RTS 的波形。

    e2e.ti.com/.../4341.sensor_5F00_CC1312R1_5F00_LAUNCHXL_5F00_tirtos7_5F00_ticlang.zip

    谢谢

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

    尊敬的 Fausto:

     

    如果我使用了 UART2echo 的示例代码并设置 CTS (DIO18) RTS (DIO19)、则来自 CTS/RTS 的波形始终为低电平、且样本低于两个。

    =========== 从 TI UART1读取写入 UART2 ==========================

    while (1){
    bytesRead = 0;
    while (bytesRead = 0){
    STATUS = UART2_READ (UART、&INPUT、1、&bytesRead);

    if (status!= UART2_STATUS_SUCCESS){
    /* UART2_READ()失败*/
    while (1);

    字节 Written = 0;
    while (bytesWritten =0){
    status2 = UART2_WRITE (uart2、&input、1、&bytesWritten);

    if (status2!= UART2_STATUS_SUCCESS){
    /* UART2_write()失败*/
    while (1);

    ===================================================================================================

    =========== 从 UART2读取并写入 TI UART1 =========================================

    while (1){
    bytesRead = 0;
    while (bytesRead = 0){
    status2 = UART2_read (uart2、&input、1、&bytesRead);

    if (status!= UART2_STATUS_SUCCESS){
    /* UART2_READ()失败*/
    while (1);

    字节 Written = 0;
    while (bytesWritten =0){
    状态= UART2_WRITE (UART、&INPUT、1、字节 Written);

    if (status2!= UART2_STATUS_SUCCESS){
    /* UART2_write()失败*/
    while (1);

    ===================================================================================================

    谢谢。

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

    您好、Jarvis、  

    正如我在10天前的回答中所描述的:

    您收到"pthread_attr_init (&atttrs)"错误、因为传感器示例不支持 tivix、而仅支持 tirtos7调用。 tiposix 是位于 tirtos7和 FreeRTOS 之上的 POSIX 抽象层、可通过 POSIX 样式函 数调用实现两个操作系统之间的代码兼容性。  

    因此、如果您需要在传感器示例中创建任务、您应该使用 Task_con构 调用来执行它、因为它是在项目中包含的 application/main.c 文件中完成的。 请勿尝试从 uart2echo 示例复制/粘贴整个任务。 只需将 UART2驱动程序调用移植到传感器示例中所需的位置即可。

    在 zip 文件中提供的示例中、您仅将 pthread_attr_init 调用添加到传感器示例中、我建议您不要添加该调用。 您提供的两个代码片段与 uart2echo 示例非常相似、看起来是正确的、但需要检查示例的其余部分以评估您的移植。 因此、您能否提供有关您正在编写的应用程序的更多信息、这些应用程序在 CTS/RTS 线路上未显示任何活动? 您是否在 TX/RX 线路上也没有看到任何活动?  在我的第一篇文章中、我指出了添加第二个 UART2实例时应遵循的所有步骤以及在 UART 上打印简单字符串时应添加的代码。 您是否至少能够实现此初始步骤?  

    此致、

    高斯图

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

    您好、Fausto、

    请在下面查看。

    查看 UART2_echo tutros7后、我还可以在 源代码中找到"pthread_attr_init"、因此  pthread_attr_init 在 tirtos7示例中是可行的。  

     我是对的吗?

    请在下面重新说明。

    从 SDK 加载 UART2 echo ->添加第二个 UART ->修改 uart2echo.c  

    a.读取第二个 UART 端口 -> RX 引脚(DIO 12)具有 pluse(用于读取端口)-->启用流控 --> RX 正常工作,但 CTS/ RTS 始终为低电平

    b.写入第2个 UART 端口 -> TX 引脚(DIO 11)已被占用。 (用于写入端口) -->启用流控制 -->  TX 正常工作,但 CTS/ RTS 始终为低电平

                  e2e.ti.com/.../Summary.xlsx         

    3.如何使用第二个 UART 端口运行15.4堆栈?                                  

    谢谢。

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

    我将关闭此主题帖、因为它包含所有请求的信息。 如有任何疑问、请重新打开。

    此致、

    高斯图