Other Parts Discussed in Thread: CC2538, Z-STACK
I follow part 4 of SWRA353 v1.6 to add OTA client functionality on an application. I work on SampleLight application. Either I miss a step or the instruction has missing steps. I followed the steps on the instruction but when I compile the code it outputs this linker error
Error[Li005]: no definition for "HalOTAInvRC" [referenced from C:\Texas Instruments\Z-Stack Home 1.2.2.42930\Projects\zstack\HomeAutomation\SampleLight\CC2538\Router\Obj\zcl_ota.o]
Error[Li005]: no definition for "HalOTARead" [referenced from C:\Texas Instruments\Z-Stack Home 1.2.2.42930\Projects\zstack\HomeAutomation\SampleLight\CC2538\Router\Obj\zcl_ota.o]
Error[Li005]: no definition for "HalOTAWrite" [referenced from C:\Texas Instruments\Z-Stack Home 1.2.2.42930\Projects\zstack\HomeAutomation\SampleLight\CC2538\Router\Obj\zcl_ota.o]
Error[Li005]: no definition for "HalOTAChkDL" [referenced from C:\Texas Instruments\Z-Stack Home 1.2.2.42930\Projects\zstack\HomeAutomation\SampleLight\CC2538\Router\Obj\zcl_ota.o]
Error[Li005]: no definition for "HalOTAInit" [referenced from C:\Texas Instruments\Z-Stack Home 1.2.2.42930\Projects\zstack\HomeAutomation\SampleLight\CC2538\Router\Obj\OnBoard.o]
However, I have the same linker options as SampleSwitch has.
The steps I followed:
1) added zcl_ota.c and zcl_ota.h to Profile folder on IAR
2) added
#if (defined OTA_CLIENT) && (OTA_CLIENT == TRUE)
#include "zcl_ota.h"
#endif
as a header,
#if (defined OTA_CLIENT) && (OTA_CLIENT == TRUE)
zclOTA_event_loop
#endif
into const pTaskEventHandlerFn tasksArr[] = {}, and
#if (defined OTA_CLIENT) && (OTA_CLIENT == TRUE)
zclOTA_Init( taskID );
#endif
into void osalInitTasks( void )()
3) added "$PROJ_DIR$\..\..\..\OTA\Source" into "additiona include directories", and
OTA_CLIENT=TRUE
OTA_HA
OTA_MANUFACTURER_ID=0xBEBE
OTA_TYPE_ID=0x2538
HAL_IMG_AREA=0
preprocessor
4) enabled "generate additional output" on "output converter" tab, then selected "intel extended" output format, and enabled "overrisedefault" option
5) Linker > Config, clicked on "override default" and "$PROJ_DIR$\..\..\..\Tools\CC2538DB\CC2538-OTA-Image-A.icf"
6) Clean > Rebuild all
I see that hal_ota.c and hal_ota.h are missings, then added them manually. now it outputs this error
"Fatal Error[Pe1696]: cannot open source file "armcm3flashutil.h" C:\Texas Instruments\Z-Stack Home 1.2.2.42930\Components\hal\target\CC2538\hal_ota.c 45"
(line 45 is "#include "armcm3flashutil.h""). I couldn't find location of the header. Did I do something wrong by including the extra include directory or do I need to add another directory that is not written on the document?
