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.

CCS如何生成正确的HEX文件

Other Parts Discussed in Thread: CC1312R, UNIFLASH

各位工程师你们好,

我使用的芯片为CC1312R,SDK版本为simplelink_cc13x2_26x2_sdk_4_20_00_35,CCS版本为Version: 10.1.0.00010,使用的例程为rfPacketTx。

目前烧录情况为:

(1)使用XDS在CCS内进行烧录,能够成功烧录且正常运行;

(2)将编译生成的.out文件通过flash programmer2进行烧录,也能成功烧录且正常运行;

(3)将工程配置为生成HEX文件,生成的HEX文件烧录入芯片后,程序没有正常运行;

我的猜测为由于我使用了官方的TI-RTOS,因此工作面板中有两个工程,分别为rfPacketTx和tirtos的工程,而我仅配置rfPacketTx生成HEX,因此生成的HEX是不完整的,无法实现正常的功能?不知道我的理解是否正确,请问我应该如何操作让其生成正确的HEX?

  • 你是在哪里配置生成hex文件的?是否是通过下面方式

  • 我勾选了Enable ARM Hex Utility,但是我发现configuration一栏,我的Configuration选项与您的配置不一样。

  • 看下这里是否有命令

  • 我这里没有此条语句,我是增添这条语句就可以了吗?是否还需要其他操作?
  • 你先加上这句试一下:${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}
  • 按照您的描述我添加了此条语句,但是发现在CCS里面烧录程序时,设备最后发送数据以后能按照流程进入低功耗(5uA),而烧录HEX时,只是能发送数据,但不能正常进入低功耗(442uA),请问这可能是由于什么原因引起的呢?
  • 一般按第一种方法就可以了,可能是编译器的原因。修改完重新编译下,你是用什么烧录程序的?
    用下面命令生成bin文件试试:${CG_TOOL_ROOT}/bin/armobjcopy -O binary --only-section .text --only-section .const --only-section .cinit --only-section .resetVecs ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin
  •  我烧录的HEX是已经重新编译了的,即为上述效果。按照您给的命令生成的bin文件烧录以后,发送数据功能以及低功耗功能都无法实现。我使用SmartRF Flash Programmer 2进行烧录的。

  • 您好, 我发现使用smartrf programmer 2烧录.out文件,设备也无法进入低功耗(440uA),但是在CCS工程中进行烧录,可以进入低功耗(5uA),请问该如何解决此问题呢?
  • 你在程序中做了哪些修改,按下复位试试
  • 我测试了5个设备,重新上电也测试了很多次,现象都是使用programmer 2烧录程序.out/.hex时,无法进入低功耗,但在CCS中烧录就可以进入低功耗。我在程序中增加了无线数据的发送以及无线数据的接收,接收到指定的数据包后,进入低功耗。
  • 你把修改的代码传上来,我将咨询这方面的专家,得到回复会立即回复给你。
  • test.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /*
    * Copyright (c) 2019, 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 *****/
    /* Standard C Libraries */
    #include <stdlib.h>
    #include <unistd.h>
    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    #include <ti/drivers/UART.h>
    #include <ti/drivers/SPI.h>
    /* Driverlib Header files */
    #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
    /* Board Header files */
    #include "ti_drivers_config.h"
    #include "RFQueue.h"
    #include <ti_radio_config.h>
    #include "de_bug.h"
    #include "ebyte_mx25r2035f.h"
    /***** Defines *****/
    static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    /* Receive dataQueue for RF Core to fill in data */
    static dataQueue_t dataQueue;
    static rfc_dataEntryGeneral_t* currentDataEntry;
    static uint8_t packetLength;
    static uint8_t receLenth;
    static uint8_t* packetDataPointer;
    /* Packet RX Configuration */
    #define DATA_ENTRY_HEADER_SIZE 8 /* Constant header size of a Generic Data Entry */
    #define MAX_LENGTH 30 /* Max length byte the radio will accept */
    #define NUM_DATA_ENTRIES 2 /* NOTE: Only two data entries supported at the moment */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    好的,以上是我修改过的代码,十分感谢!

  • 用uniflash下载下hex或.out文件试试,看下这里的回复:https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/t/932559

x 出现错误。请重试或与管理员联系。