Forums - QCA4020 Onboard demo fails to compile

11 posts / 0 new
Last post
QCA4020 Onboard demo fails to compile
kartik.gupta.dce
Join Date: 19 Jun 18
Posts: 5
Posted: Tue, 2018-06-19 23:17

I downloaded the SDK and Onboard demo failed to compile. 

Here is my environment flags.

user@ubuntu:/home/user/QCA4020.OR.1.1_PostCS1/target/quartz/demo/Helloworld_demo/build/gcc$ export CHIPSET_VARIANT=qca4020
user@ubuntu:/home/user/QCA4020.OR.1.1_PostCS1/target/quartz/demo/Helloworld_demo/build/gcc$ export RTOS=threadx
user@ubuntu:/home/user/QCA4020.OR.1.1_PostCS1/target/quartz/demo/Helloworld_demo/build/gcc$ export BOARD_VARIANT=cdb
user@ubuntu:/home/user/QCA4020.OR.1.1_PostCS1/target/quartz/demo/Helloworld_demo/build/gcc$ export ECOSYSTEM=offline
 
 user@ubuntu:/home/user/QCA4020.OR.1.1_PostCS1/target/quartz/demo/Helloworld_demo/build/gcc$ make prepare
##############################################################################
Starting build for Quartz Onboard Application
 
 
##############################################################################
Build Parameters:
RTOS = threadx
Variant = qca4020
Board = cdb
Revision = 2p0
##############################################################################
cp -u -v ../../../../../quartz/platform/export/platform_oem.h ../../src/export
cp -u -v ../../../../../quartz/platform/export/platform_oem.c ../../src/export
cp -u -v ../../../../../quartz/platform/export/platform_oem_mom.c ../../src/export
cp -u -v ../../../../../quartz/platform/export/platform_oem_som.c ../../src/export
cp -u -v ../../../../../build/tools/devcfg/threadx/DevCfg_master_devcfg_out.xml ../../src/export
cp -u -v ../../../../../build/tools/devcfg/threadx/DevCfg_master_devcfg_out_cdb.xml ../../src/export
cp -u -v ../../../../../build/tools/devcfg/threadx/DevCfg_master_fom_out.xml ../../src/export
cp -u -v ../../../../../build/tools/devcfg/threadx/DevCfg_master_fom_out_cdb.xml ../../src/export
 
 
user@ubuntu$:/home/user/QCA4020.OR.1.1_PostCS1/target/quartz/demo/Onboard_demo/build/gcc$ sh build.sh 1 1 
 
 Selected Onboarding mode is BLE
 
 Selected Radio is ZIGBEE
 
 offline Demo Building started
 
rm -rf output
##############################################################################
Starting build for Quartz Onboard Application
 
 
##############################################################################
Build Parameters:
RTOS = threadx
Variant = qca4020
Board = cdb
Revision = 2p0
...
..
 
....
....
....
...
...
...
...
Compiling ../../src/sensors/sensor_json.c output/objs/sensors/sensor_json.o
arm-none-eabi-gcc -c -g -mcpu=cortex-m4 -mthumb -fno-short-enums -O2 -Os -ffunction-sections -Wall -D WLAN_DEBUG -D ENABLE_P2P_MODE -D ONBOARD_VIA_WIFI -D ZIGBEE -D SUPPORTED_MODE=1 "-D CHIPSET_VARIANT=\"qca4020\"" "-D RTOS=\"threadx\"" "-D BOARD_SUPPORTS_WIFI=1" "-D V2" "-D qurt_mutex_init(x)=qurt_mutex_create(x)" "-D qurt_mutex_destroy(x)=qurt_mutex_delete(x)" "-D qurt_signal_init(x)=qurt_signal_create(x)" "-D qurt_signal_destroy(x)=qurt_signal_delete(x)" "-D FEATURE_QUARTZ_V2" "-D CONFIG_CDB_PLATFORM" "-D JSMN_PARENT_LINKS=1" "-D OFFLINE" "-D ENABLE_DIMMER=1" -I"../../../../../include" -I"../../../../../thirdparty/aws/awsiot/include" -I"../../../../../quartz/ecosystem/aws/port/include" -I"../../../../../include/qapi" -I"../../../../../include/bsp" -I"../../src/qcli" -I"../../src/include" -I"../../src/ecosystem/aws" -I"../../src/zigbee/clusters" -I"../../src/sensors" -I"../../../../../thirdparty/jsmn/include"  -I"../../../../../core/v2" -D_WANT_IO_C99_FORMATS -D __FILENAME__=\"../../src/sensors/sensor_json.c\" ../../src/sensors/sensor_json.c -o output/objs/sensor_json.o
../../src/sensors/sensor_json.c:25:18: fatal error: jsmn.h: No such file or directory
 #include "jsmn.h"
                  ^
compilation terminated.
make: *** [output/objs/sensors/sensor_json.o] Error 1
 
 
What is missing? Why am I having such a problem? Please help. 
  • Up0
  • Down0
manjulak Moderator
Join Date: 5 Dec 14
Posts: 33
Posted: Wed, 2018-06-20 00:44

Can you please try with steps listed in section 2.3 (Prerequisites to build in standalone/without cloud mode) in 80-YA121-140 (QCA402x (CDB2x) Development Kit User Guide) document.

  • Up0
  • Down0
kartik.gupta.dce
Join Date: 19 Jun 18
Posts: 5
Posted: Wed, 2018-06-20 11:35

Now I am getting the following error. 

< Snippet >
Compiling ../../src/zigbee/zigbee_router.c output/objs/zigbee/zigbee_router.o
arm-none-eabi-gcc -c -g -mcpu=cortex-m4 -mthumb -fno-short-enums -O2 -Os -ffunction-sections -Wall -D WLAN_DEBUG -D ENABLE_P2P_MODE -D ONBOARD_VIA_BLE -D ZIGBEE -D SUPPORTED_MODE=5 "-D CHIPSET_VARIANT=\"qca4020\"" "-D RTOS=\"threadx\"" "-D BOARD_SUPPORTS_WIFI=1" "-D V2" "-D qurt_mutex_init(x)=qurt_mutex_create(x)" "-D qurt_mutex_destroy(x)=qurt_mutex_delete(x)" "-D qurt_signal_init(x)=qurt_signal_create(x)" "-D qurt_signal_destroy(x)=qurt_signal_delete(x)" "-D FEATURE_QUARTZ_V2" "-D CONFIG_CDB_PLATFORM" "-D JSMN_PARENT_LINKS=1" "-D OFFLINE" "-D ENABLE_DIMMER=1" -I"../../../../../include" -I"../../../../../thirdparty/aws/awsiot/include" -I"../../../../../quartz/ecosystem/aws/port/include" -I"../../../../../include/qapi" -I"../../../../../include/bsp" -I"../../src/qcli" -I"../../src/include" -I"../../src/ecosystem/aws" -I"../../src/zigbee/clusters" -I"../../src/sensors" -I"../../../../../thirdparty/jsmn/include"  -I"../../../../../core/v2" -D_WANT_IO_C99_FORMATS -D __FILENAME__=\"../../src/zigbee/zigbee_router.c\" ../../src/zigbee/zigbee_router.c -o output/objs/zigbee_router.o
Compiling ../../src/zigbee/zigbee_enddevice.c output/objs/zigbee/zigbee_enddevice.o
arm-none-eabi-gcc -c -g -mcpu=cortex-m4 -mthumb -fno-short-enums -O2 -Os -ffunction-sections -Wall -D WLAN_DEBUG -D ENABLE_P2P_MODE -D ONBOARD_VIA_BLE -D ZIGBEE -D SUPPORTED_MODE=5 "-D CHIPSET_VARIANT=\"qca4020\"" "-D RTOS=\"threadx\"" "-D BOARD_SUPPORTS_WIFI=1" "-D V2" "-D qurt_mutex_init(x)=qurt_mutex_create(x)" "-D qurt_mutex_destroy(x)=qurt_mutex_delete(x)" "-D qurt_signal_init(x)=qurt_signal_create(x)" "-D qurt_signal_destroy(x)=qurt_signal_delete(x)" "-D FEATURE_QUARTZ_V2" "-D CONFIG_CDB_PLATFORM" "-D JSMN_PARENT_LINKS=1" "-D OFFLINE" "-D ENABLE_DIMMER=1" -I"../../../../../include" -I"../../../../../thirdparty/aws/awsiot/include" -I"../../../../../quartz/ecosystem/aws/port/include" -I"../../../../../include/qapi" -I"../../../../../include/bsp" -I"../../src/qcli" -I"../../src/include" -I"../../src/ecosystem/aws" -I"../../src/zigbee/clusters" -I"../../src/sensors" -I"../../../../../thirdparty/jsmn/include"  -I"../../../../../core/v2" -D_WANT_IO_C99_FORMATS -D __FILENAME__=\"../../src/zigbee/zigbee_enddevice.c\" ../../src/zigbee/zigbee_enddevice.c -o output/objs/zigbee_enddevice.o
Compiling ../../src/zigbee/zcl_util.c output/objs/zigbee/zcl_util.o
arm-none-eabi-gcc -c -g -mcpu=cortex-m4 -mthumb -fno-short-enums -O2 -Os -ffunction-sections -Wall -D WLAN_DEBUG -D ENABLE_P2P_MODE -D ONBOARD_VIA_BLE -D ZIGBEE -D SUPPORTED_MODE=5 "-D CHIPSET_VARIANT=\"qca4020\"" "-D RTOS=\"threadx\"" "-D BOARD_SUPPORTS_WIFI=1" "-D V2" "-D qurt_mutex_init(x)=qurt_mutex_create(x)" "-D qurt_mutex_destroy(x)=qurt_mutex_delete(x)" "-D qurt_signal_init(x)=qurt_signal_create(x)" "-D qurt_signal_destroy(x)=qurt_signal_delete(x)" "-D FEATURE_QUARTZ_V2" "-D CONFIG_CDB_PLATFORM" "-D JSMN_PARENT_LINKS=1" "-D OFFLINE" "-D ENABLE_DIMMER=1" -I"../../../../../include" -I"../../../../../thirdparty/aws/awsiot/include" -I"../../../../../quartz/ecosystem/aws/port/include" -I"../../../../../include/qapi" -I"../../../../../include/bsp" -I"../../src/qcli" -I"../../src/include" -I"../../src/ecosystem/aws" -I"../../src/zigbee/clusters" -I"../../src/sensors" -I"../../../../../thirdparty/jsmn/include"  -I"../../../../../core/v2" -D_WANT_IO_C99_FORMATS -D __FILENAME__=\"../../src/zigbee/zcl_util.c\" ../../src/zigbee/zcl_util.c -o output/objs/zcl_util.o
Compiling ../../src/zigbee/clusters/zcl_alarms_demo.c output/objs/zigbee/clusters/zcl_alarms_demo.o
arm-none-eabi-gcc -c -g -mcpu=cortex-m4 -mthumb -fno-short-enums -O2 -Os -ffunction-sections -Wall -D WLAN_DEBUG -D ENABLE_P2P_MODE -D ONBOARD_VIA_BLE -D ZIGBEE -D SUPPORTED_MODE=5 "-D CHIPSET_VARIANT=\"qca4020\"" "-D RTOS=\"threadx\"" "-D BOARD_SUPPORTS_WIFI=1" "-D V2" "-D qurt_mutex_init(x)=qurt_mutex_create(x)" "-D qurt_mutex_destroy(x)=qurt_mutex_delete(x)" "-D qurt_signal_init(x)=qurt_signal_create(x)" "-D qurt_signal_destroy(x)=qurt_signal_delete(x)" "-D FEATURE_QUARTZ_V2" "-D CONFIG_CDB_PLATFORM" "-D JSMN_PARENT_LINKS=1" "-D OFFLINE" "-D ENABLE_DIMMER=1" -I"../../../../../include" -I"../../../../../thirdparty/aws/awsiot/include" -I"../../../../../quartz/ecosystem/aws/port/include" -I"../../../../../include/qapi" -I"../../../../../include/bsp" -I"../../src/qcli" -I"../../src/include" -I"../../src/ecosystem/aws" -I"../../src/zigbee/clusters" -I"../../src/sensors" -I"../../../../../thirdparty/jsmn/include"  -I"../../../../../core/v2" -D_WANT_IO_C99_FORMATS -D __FILENAME__=\"../../src/zigbee/clusters/zcl_alarms_demo.c\" ../../src/zigbee/clusters/zcl_alarms_demo.c -o output/objs/zcl_alarms_demo.o
In file included from ../../src/zigbee/clusters/zcl_alarms_demo.c:10:0:
../../src/include/util.h:12:36: error: unknown type name 'int32_t'
 void get_dev_fw_version(char *buf, int32_t buf_size);
                                    ^
../../src/include/util.h:13:1: error: unknown type name 'int32_t'
 int32_t get_localdevice_name(char *buf,int32_t buf_size);
 ^
../../src/include/util.h:13:40: error: unknown type name 'int32_t'
 int32_t get_localdevice_name(char *buf,int32_t buf_size);
                                        ^
../../src/include/util.h:14:1: error: unknown type name 'int32_t'
 int32_t get_ble_localdevice_name(char *buf,int32_t buf_size);
 ^
../../src/include/util.h:14:44: error: unknown type name 'int32_t'
 int32_t get_ble_localdevice_name(char *buf,int32_t buf_size);
                                            ^
../../src/include/util.h:15:1: error: unknown type name 'int32_t'
 int32_t get_remotedevice_name(char *buf, int32_t buf_size);
 ^
../../src/include/util.h:15:42: error: unknown type name 'int32_t'
 int32_t get_remotedevice_name(char *buf, int32_t buf_size);
                                          ^
make: *** [output/objs/zigbee/clusters/zcl_alarms_demo.o] Error 1
 
  • Up0
  • Down0
manjulak Moderator
Join Date: 5 Dec 14
Posts: 33
Posted: Wed, 2018-06-20 13:15

Can you please confirm if you downloaded GNU embedded toolchain on your PC and set the path appropriately? Please take a look at section 6.2 in 80-YA121-140 document.

  • Up0
  • Down0
kartik.gupta.dce
Join Date: 19 Jun 18
Posts: 5
Posted: Wed, 2018-06-20 14:44

Yes, It is on correct path and I did download it from arm website: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

Here is the path and is correctly set:

target/quartz/demo/Onboard_demo/build/gcc$ which arm-none-eabi-gdb
/usr/local/sbin/arm-toolchain/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gdb
  • Up0
  • Down0
manjulak Moderator
Join Date: 5 Dec 14
Posts: 33
Posted: Thu, 2018-06-21 11:45

We are not able to replicate this issue. Tried on both Ubuntu16.04 and 14.04. Can you please give us details about your PC?

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2018-06-21 11:52


Can you please also try with toolchain version 6.x (gcc-arm-none-eabi-6-2017-q2-update) .
 

  • Up0
  • Down0
sfabianlyl
Join Date: 31 Dec 18
Posts: 5
Posted: Wed, 2019-02-13 08:29

I am also facing similar problems. During the linking stage, the following error appeared:

arm-none-eabi-ld: cannot find -lc_nano
arm-none-eabi-ld: cannot find -lnosys
arm-none-eabi-ld: cannot find -lgcc
Usage: python diagMsgCompact.py <Output ELF> <Output string database File> <Input ELF> <input pickle file> <CompactType: Intermediate or Final>

diagMsgCompact.py: error: Specified ELF file does not exist.
Hashing...
Traceback (most recent call last):
  File "..\..\..\..\..\build\scripts\createxbl.py", line 708, in <module>
    main()
  File "..\..\..\..\..\build\scripts\createxbl.py", line 234, in main
    zi_oob_enabled)
  File "..\..\..\..\..\build\scripts\createxbl.py", line 296, in merge_elfs
    mbn_tools.preprocess_elf_file(elf_in_file_name1)
  File "C:\Users\User\Desktop\QCA4020.OR.3.0_00011.1\target\build\scripts\mbn_tools.py", line 1995, in preprocess_elf_file
    elf_fp = OPEN(elf_file_name, 'rb')
  File "C:\Users\User\Desktop\QCA4020.OR.3.0_00011.1\target\build\scripts\mbn_tools.py", line 2197, in OPEN
    raise RuntimeError, "The file could not be opened: " + file_name
RuntimeError: The file could not be opened: output\Quartz.elf
 

What seems to be the problem?

  • Up0
  • Down0
sfabianlyl
Join Date: 31 Dec 18
Posts: 5
Posted: Wed, 2019-02-13 08:32

and yes I am using 6 2017-q2-update toolchain. The Path is as follows:

C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin

 

Should i include

C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\arm-none-eabi\bin

?

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Wed, 2019-02-13 10:28

The issue is due to PATH not able to find the arm-none-eabi-ld tool chain.

Kindly include the below LIBPATHS along with existing PATH and try again:

Example:
If ARM GNU toolchain is installed under C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\

set path as follows.
TOOLLIBPATH=C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\thumb\v7e-m NEWLIBPATH=C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\arm-none-eabi\lib\thumb\v7e-m

  • Up0
  • Down0
darshan.prajapati
Join Date: 4 Feb 20
Posts: 8
Posted: Mon, 2020-02-10 13:18

The original problem of jsmn.h not found in this thread occures due to incorrect include path provided in SDK by Qualcomm. Qualcomm SDK tries to find jsmn.h file in target/thirdparty/external_libs/jsmn directory but actually its located at /target/thirdparty/aws/awsiot/external_libs/jsmn.

To solve the problem, create external_libs directory in thirdparty directory and copy jsmn directory there from awsiot/external_libs. That should resolve your problem.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.