1780 views|0 replies

6555

Posts

0

Resources
The OP
 

CC1310 on-chip firmware upgrade project compilation [Copy link]

OAD ( 查看详情 ), or Over the Air Download, is a method of remotely updating firmware via wireless. On chip means on-chip, and the upgrade object does not require external Flash. The new firmware is stored and the old firmware is switched to the new firmware through the internal Flash of the chip. The On chip OAD solution is popular in wireless applications such as sensors, smart door locks, and power monitoring because it can update the firmware without external interfaces.

In the newly released CC1310 on-chip OAD project of TI, many details are not explained, and users may make mistakes during use. Here, we will combine the TI CC1310 SDK 1.60.00.21 version ( 查看详情 ) to explain the precautions in the project compilation and OAD test process.

Preparation for the test:

Two CC1310 Launchpad evaluation boards ( 查看详情 )

CC1310 software development kit: simplelink_cc13x0_sdk_1_60_00_21 ( 查看详情 )

Tool: Uniflash burning tool ( http://www.ti.com.cn/tool/cn/UNIFLASH )

Serial port tool: HTerm

Python environment and tools: Python 2.7

CC1310 on-chip OAD routine compilation

The CC1310 on-chip OAD routines are in the SDK folder examples\rtos\ CC1310 _LAUNCHXL\easylink, corresponding to the collector (rfWsnConcentratorOadServer) and node (rfWsnNodeIntFlashOadClient) routines; we import them into CCS (version 7.0 or above).

The first point to note here is that there is already a compiled firmware in the SDK folder \examples\rtos\ CC1310 _LAUNCHXL\easylink\hexfiles\onChipOad. This firmware cannot be mixed with the project compiled firmware. You can only use the compiled firmware for testing, or only use the project compiled firmware.

We first compile the collector project (no modification is required) and download the project to CC1310 Launchpad 1;

Next, we compile the node project according to the instructions in the README.md file (lines 136-145) and find an error message, as shown below. The cause of the error may be insufficient available storage.

To address this, we can check the specific storage details from the .map file generated by the project compilation, and we can see that the problem is that .const is too large.

If we cancel the FEATURE_OAD_ONCHIP setting in the previous project, recompile, and check the normal .map file, we can find that the .const space is mainly occupied by smartrf_settings_predefined.obj. After inspection, we find that it is mainly caused by the wireless RF patch, which has nothing to do with our verification of OAD.

After restoring the project settings to README.MD, open smartrf_settings_predefined.c in the project directory folder smartrf_settings, modify the following four RF_Mode variables as follows, and then recompile the project.

RF_Mode RF_prop_lrm =

{

.rfMode = RF_MODE_PROPRIETARY_SUB_1,

.cpePatchFxn = 0,

.mcePatchFxn = 0,

.rfePatchFxn = 0,

};

RF_Mode RF_prop_ook =

{

.rfMode = RF_MODE_PROPRIETARY_SUB_1,

.cpePatchFxn = 0,

.mcePatchFxn = 0,

.rfePatchFxn = 0,

};

RF_Mode RF_prop_hsm =

{

.rfMode = RF_MODE_PROPRIETARY_SUB_1,

.cpePatchFxn = 0,

.mcePatchFxn = 0,

.rfePatchFxn = 0,

};

RF_Mode RF_prop_sl_lr =

{

.rfMode = RF_MODE_PROPRIETARY_SUB_1,

.cpePatchFxn = 0,

.mcePatchFxn = 0,

.rfePatchFxn = 0,

};

The compilation was successful. From the figure below, you can see that the compiled program size is 57K, which meets the limit of not more than 60K.

One thing that needs to be explained here is that the other nodeFwVersion modification mentioned in README.MD should be in oad_client.c instead of NodeTask.c;

CC1310 on-chip OAD routine BIN firmware generation and loading test

Because the setting of this project is for IMAGE file, it will not work properly if it is downloaded directly to the chip (because the reset vector of the chip has no executable program, and BIM is needed to jump to the IMAGE program entry). It is necessary to combine the compiled firmware with the BIM firmware managed by Boot. The steps are as follows

Merge BIM and node firmware first (please copy both firmware to the python directory before executing)

python /usr/bin/hexmerge.py -o rfWsnNodeIntFlashOadClient_ CC1310 _LAUNCHXL_all_v1.hex "--overlap=error" rfWsnNodeIntFlashOadClient_ CC1310 _LAUNCHXL_tirtos_ccs.hex bim_intflash_cc1350lp.hex

Next, because BIM needs to check the CRC file of IMAGE, you need to convert the generated hex to bin using the following command. (You need to download and install a CRC calculation component crcmod https://pypi.python.org/pypi/crcmod/1.7#downloads )

python oad_image_tool_13x0.py -t onchip -i production -v 0x0100 -m 0x1000 -ob rfWsnNodeIntFlashOadClient_ CC1310 _LAUNCHXL_all_v1.binrfWsnNodeIntFlashOadClient_ CC1310 _LAUNCHXL_all_v1.hex

After we download the bin file to the node Launchpad 2 through Uniflash , the node firmware can work normally. You can see the indicator light of Launchpad flashing, and the ADC information of SCE can be seen from the serial port of Launchpad 2. We turn on the collector Launchpad 1, and we can see that the node has established communication with the collector and can work normally.

It should also be noted that the version number generated by oad_image_tool_13x0.py -v is only the version number displayed by Available FW on the collector side, not the actual firmware version number.

The next step is to load the program required for the upgrade to the collector. First, we need to set it to IMAGE B according to the instructions in README.MD. Then, use the above python tool to convert the compiled .hex file into a .bin file. Note that the -m parameter of oad_image_tool_13x0.py needs to be set to 0x10000. After that, we right-click on the collector evaluation board and select Update available FW, then press the left and right buttons at the same time, and the collector enters the firmware loading interface, as follows:

Then disconnect the serial port of the collector. We will combine PYTHON to transfer the node firmware that needs to be updated to the external Flash of the collector. Here, because the PYTHON script is written for LINUX, in order to work on WINDOWS, please first install the module pyserial and modify the script oad_write_bin.py (directory C:\ti\simplelink_cc13x0_sdk_1_60_00_21\tools\easylink\oad). The installation of PYTHON is not discussed in the document. For the download and installation of Pyserial, please refer to http://blog.csdn.net/oxp7085915/article/details/52191698

The modified script is as follows (marked in yellow):

#!/usr/bin/python

import serial, sys, io, os

import serial.tools.list_ports

plist =list(serial.tools.list_ports.comports())

if len(plist) <= 0:

print "The Serial port can't find!"

else:

plist_0 =list(plist[0])

port0 = plist_0[0]

file = sys.argv[1]

Disconnect the original serial port assistant (to which the collector is connected), open the command line, and execute the oad_write_bin.py script to transfer the newly generated node firmware bin file to the collector. You can see the transfer prompt. Wait for the transfer to complete.

C:\Python27>python C:\ti\simplelink_cc13x0_sdk_1_60_00_21\tools\easylink\oad\oad

_write_bin.py C:\ti\simplelink_cc13x0_sdk_1_60_00_21\examples\rtos\ CC1310 _LAUNCHXL\easylink\hexfiles\onChipOad\ccs\rfWsnNodeIntFlashOadClient_ CC1310 _LAUNCHXL_app_v2.bin

After the transfer is complete, reopen the serial port to connect to the collector, press the right button on Launchpad and Update Available Firmware will appear. Then press the left button and the right button at the same time, and you can see that the V02 firmware is now available.

Next, select Update Node Firmware using the right button on the Launchpad, and then press the left and right buttons to execute the selection. You can see the upgrade start and complete.

After the upgrade is complete, you can see through Send Fw Ver Req that the firmware has been updated from V01 to V02.

This post is from Wireless Connectivity
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list