Dear all,
I am tring to compile the offline on_board demo with QCA4020 on Windows 10
The steps I did are:
1. Navigate to cd target\quartz\demo\<name_of_demo>\build\gcc
2.ecosystem.bat 5 (export ecosystem as offline)
3.Install the device configuration files.
build.bat prepare 4020 cdb
offline
Offline demo build script help:
build.bat [RTOS (FreeRTOS = f, ThreadX = t)] [chipset variant (4020, 4024)] [ONBOARD_VIA] [Radio] [board variant (CDB = cdb)]
Select the options for Radio, Supported Mode as below
Onboarding mode: 1.BLE
Radio: 1.ZIGBEE
Example: build.bat t 4020 1 1 cdb
4.Build the sample application.
build.bat t 4020 1 1 cdb
The compling result shows:
Attempting to convert windows paths: output\LinkerLibs.txt
Generating Linker Scripts...
Linking...
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:\Study\UTD_Reference\HaoShuangLab\Zigbee\qca4020\QCA4020.OR.3.0_QCA_OEM_SDK+CDB\build\scripts\mbn_tools.py", line 1995, in preprocess_elf_file
elf_fp = OPEN(elf_file_name, 'rb')
File "C:\Study\UTD_Reference\HaoShuangLab\Zigbee\qca4020\QCA4020.OR.3.0_QCA_OEM_SDK+CDB\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
how do I fix this bug?
do I need to check createbl.py and mbn.tools.py or others?
what are the meaning of these sentences below?
arm-none-eabi-ld: cannot find -lc_nano
arm-none-eabi-ld: cannot find -lnosys
arm-none-eabi-ld: cannot find -lgcc
are the arm-none-eabi-ld in GNU Tools ARM Embedded or other folder?
You need to set the TOOLLIBPATH and NEWLIBPATH for building the onboard_demo:
Example: if you arm tool chainpath is set as PATH= C:\QCA402X\6 2017-q2-update\bin
I follow the user guide to download the toolchain in https://developer.arm.com/tools-and-software/open-source-software/develo...
download gcc-arm-none-eabi-8-2019-q3-update-win32-sha2
it is installed in C:\Program Files (x86)\GNU Tools ARM Embedded\8 2019-q3-update
I set the environment variables as follow:
PATH=C:\Program Files (x86)\GNU Tools ARM Embedded\8 2019-q3-update\bin
NEWLIBPATH=C:\Program Files (x86)\GNU Tools ARM Embedded\8 2019-q3-update\arm-none-eabi\lib\thumb\v7e-m
TOOLLIBPATH=C:\Program Files (x86)\GNU Tools ARM Embedded\8 2019-q3-update\lib\gcc\arm-none-eabi\8.3.1\thumb\v7e-m
Besides, I do not want to use cloud mode, so I did not follow all the steps in 3.9 (Build ecosystem). I only follow 3.9.1 and set the two environment values, is it OK?
The result is shown as first post:
Attempting to convert windows paths: output\LinkerLibs.txt
Generating Linker Scripts...
Linking...
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:\Study\UTD_Reference\HaoShuangLab\Zigbee\qca4020\QCA4020.OR.3.0_QCA_OEM_SDK+CDB\build\scripts\mbn_tools.py", line 1995, in preprocess_elf_file
elf_fp = OPEN(elf_file_name, 'rb')
File "C:\Study\UTD_Reference\HaoShuangLab\Zigbee\qca4020\QCA4020.OR.3.0_QCA_OEM_SDK+CDB\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
Best Regards
Xian Wang
Can you try using ARM tool chain version ARM GNU 6.2 and confirm if you face same issue ?
I assume you have set the ecosystem to offline(ecosystem.bat 5).
Thank you for the reply.
I think I have already fix this problem.
The path should be point to
TOOLLIBPATH=C:\Program Files (x86)\GNU Tools ARM Embedded\8 2019-q3-update\lib\gcc\arm-none-eabi\8.3.1\thumb\v7e-m\nofp
NEWLIBPATH=C:\Program Files (x86)\GNU Tools ARM Embedded\8 2019-q3-update\arm-none-eabi\lib\thumb\v7e-m\nofp
There is another question that I have now.
The two qca4020 I download seems all coordinators. How could I build end-device one in qca4020?
since the screen shows
offline
Offline demo build script help:
build.bat [RTOS (FreeRTOS = f, ThreadX = t)] [chipset variant (4020, 4024)] [ONBOARD_VIA] [Radio] [board variant (CDB = cdb)]
Select the options for Radio, Supported Mode as below
Onboarding mode: 1.BLE
Radio: 1.ZIGBEE
Example: build.bat t 4020 1 1 cdb
I use build.bat t 4020 1 1 cdb to build and download. It seems it is always coordinator.
I sniffer the traffic on Ubiqua, it also shows two 0x0000 (coordinator) on different channels.
I want to set up one Zigbee link between a coordinator and an end-device.
Hard reset both the QCA4020 devices, delete co-ordinator information under mobile appplication.
In order to use the second device as end-device.
Kindly onboard Device 1(QCA4020 as Co-ordinator.
and Onboard the Seconds Device(QCA4020 ) and mobile application will automaticlly set the role to end -device and choose the MAC address of Device 1 as Co-Ordinator, such that Second device will be able to join the netwrok.
I did several times of experiments.
change the RTOS (f or t).
I am sure that the second device (QCA4020) is still coordinator and the sniffer shows there are two Zigbee networks available in different channels.
Furthermore, I turn off one device (either first one and second one, tried both of them) and then turn on again. The sniffer shows there is beacon request and beacon, but no further negotiation packets appeared. And the two networks are still parallel processing.
I recognized that everytime I finish onboard on my cell phone in QCAOnboarding APP, it always shows the device (both the first one and the second one) type as coordinator. I cannot change the device type by myself.
Compared with TI device, I want to know when does the QCA4020 define the device type?
Is it in the beginning (turnning on) or after the onboarding between the cell phone and the device (QCA4020)?
Best Regards
Xian Wang
Make sure you execute "onboard reset_onboard_info" to hard reset both devices.
Kindly confirm if you have followed "without cloud mode - onboard demo : prerequisites" from development kit.
Kindly refer to onbaord.c for detailed explanation:
Start_onboard_demo()
read_zigbee_config()
sets the signal_onboard _event_zigbee
config_zigbee() // checks if master_key is null will start as co-ordinator, else will start as end_device.
Also, confirm if both QCA4020 devices have different MAC address QCA4020_xxxxxx ?
I try to reset_onboard_info, but I cannot open serial console from COM.
Which port is to be used as autoboot? QDLoader 9008 or either one of Dual RS232-HS (set up in openocd)?
Can you please provide the steps to get into the reset_onboard_info?
Previously, I just download the program again, did not reset the info, maybe I need to reset the onboard_info.
Best Regards
Xian Wang
"onboard reset_board_info " is a console command to reset/erase the device saved information.
You can reflash the devices to hard reset or open serial console and execute "3 4" command to reset the board.
So you mean if I reflash the program, I already do the reset.
If so, then there is problem.
Even if I reflash the program, two devices still set up two different networks in two channels and cannot communicate with each other.
Can I set the device type in the code? or during the download process as AWS_onboard demo?
Best Regards
I just checked the two MAC addresses.
The two devices both showed as QCA4020_f0fd8c. The addresses under the name is different, one shows 53:92:99:F0:FD:8C, the other one shows 54:92:99:F0:FD:8C.
Furthermore, the IEEE address shown on the Ubiqua is same, both are 00:00:00:FF:99:F0:FD:8C. Is there any problems with the MAC addresses in the devices?
Best Regards
Xian Wang
Hi,
To set your qca4020 board as end device need to use awsiot mode with BLE, so it will be similar to offline.
CONFIGURE ONBOARD_DEMO AS END DEVICE
open onboard_demo project properties in eclipse
1. set ECOSYSTEM to awsiot in c/c++ build-> environment tab.
2. In c/c++ build-> behaviour tab set Build(incremental build) to t 4020 1 1 2 cdb.
3. Flash the code to the board you want to configure as end device. Make sure the channel no. and the master key of end device is same as coordinator.
CONFIGURE ONBOARD_DEMO AS COORDINATOR
Here just change the Build(incremental build) to t 4020 1 1 1 cdb. Flash the code to the board you want to configure as coordinator.
Using app via ble configure the board.
Hi Xian Wang,
The issue with your device is since the last six offset values of both QCA4020 devices are same, the onboard mobile application is treating the devices as same.
However, we recommend you to use alternate QCA4020 device with different MAC address that ****F0:FD:8C
Example :
QCA4020 _1 : 53:92:99:F0:FD:8C
QCA4020 _1 : 54:92:99:FF:FF:8F
How to change MAC address in the device?
I just have two available QCA4020, so I think if I can modify the MAC address of the last six offset, it is the same function.
Best Regards
Xian Wang
I have tried to implement AWS_demo on my two devices. The end device can be recognized by the mobile phone.
But the question comes: during the normal processing, the communication between the coordinator and end device terminates after a few packets inter-connection. I have repeated the experiments few times, Ubiqua always shows similar result.
Still, in Ubiqua, the sniffer cannot recognize the two devices since they show the same MAC address. I think maybe I need to change the MAC address to one of the two devices to se if it is able to continue and keep stable communication between the two devices.
How to change MAC address in qca4020?
Best Regards
Xian Wang
QDART tool is required to change the WLAN MAC address which is not exposed in QDN forum.
The tool is only available for direct customers.
However, you can still try using AWS onboard demo with WiFi onboarding for QCA4020_1 and BLE onboarding for QCA4020_2. which will use different BLE MAC and WiFI MAC.
In order to build AWS onboard demo with cloud mode for BLE case use command " build.bat t 4020 2 1 2 cdb" // onboard via BLE as Zigbee End Device.
Kinldy let me know if this helps and also specify if you are using cloud/without cloud mode demo ?
Thank you raja,
it works.
I download the coordinator in BLE onboarding mode, and end-device as WIFI mode, the MAC address of two devices are totally different.
The communication can be stable for long time.
Another problem I have now is for AWS.
I checked the monitor on my AWS account, it does not show the connection. Why is that? There should be some signals show that connection to the server, right?
Best Regards
Xian Wang
If you are using onboard_Demo with AWS cloud mode, you should see the shadow being updated with QCA402x sensor information:
> Sign into your amazon aws console.
> Select "IoT Core" Service, click on "manage" and select your Thing Name .
> Select "shadow" option and you should see Shadow State being changed periodically, also you can verify "Activity" tab to check for updated.
> However, you can delete the shadow document and it should be automatically updated .
> Under "Things -> Thing_Name -> Interact" there will be several MQTT topics which you can subscribe to under "IoT Core Service -> Test -> Subscribe to topic" and check for updated.
OK, I got it.
Another affair is I want analyze the packet information right now, so I want to read packets from Ubiqua.
But the Ubiqua cannot decrypt the packets from qualcomm being encrypted. It seems there is no well-known trust center link key during the communication.
Where is the security information of the Zigbee communication of the devices?
Do I need to read the csv files or somewhere else?
Best Regards
Xian Wang
Kindly refer to zigbee_demo.c file to find the distributed global key which can be used to encrypt the packets on sniffer.
{0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF}, /* Distributed global key. */
It does not work.
I have found the packet to transmit the key encrypted by link key and input the link key, it does not work.
Besides, the address of the coordinator is 0x0000, so I do not think distributed key will work.
Does qualcomm system use some centralized link key?
Best Regards
Xian Wang