Hello,
How did you integrate the USB library and CDC device into the HAL layer of the TI Z-Stack?
Is it a difficult process? I'm trying to do exactly the same. Could you give me some hints?
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.
You can request through the official support channels a Beta release of the Z-Stack 2.3.0 or just wait for the official release and web post in a few weeks.
Hello,
I've just seen that the 2.3.0 version of Zstack is now released. So I tried to use it for making my CC2531 chip communicate through USB CDC.
What I did :
- I modified the SampleSwitch example provided to replace any reference to "Components\hal\target\CC2530EB" by "Components\hal\target\CC2530USB"
- I made sure that the include path of the project also included:
- I defined the following constants for the preprocessor:
- I attempted to compile
However, IAR gives me the following errors:
I thus seem to miss the following constants:
Here are my questions:
Thanks!
To find out what a constant is, just look for all occurrences of it in the Z-Stack with IAR press CTRL-SHIFT-F and enter your constant to search for in all .h .c files. The 2 above obviously relate to the UART configuration and control how long to wait after the last byte received before triggering a UART callback and the other is the threshold before asserting flow control.
In the 2.3 release there is a sample application called "ZNP" that uses the USB CDC as a virtual comm port connection to the PC. And there is a new project for the next release that does so even more simply, TVSA, which I will attach to this post.
It looks like you need to add this to _hal_uart_usb.c:
#if defined MT_TASK
#include "mt_uart.h"
#endif
Whoa - the .44 magnum was turned around on me by feedbacks on the sample code for TVSA to demonstrate a sample application built for CC2531 USB device! So - bad idea and let's start again.
The last post is still valid: in _hal_uart_usb.c, add the #include "mt_uart.h"
But instead, use this attached sample code which drops into the GenericApp sample application from the actual 2.3.0 release!
Unzip in this sub-dir:
C:\Texas Instruments\ZStack-CC2530-2.3.0-1.4.0\Projects\zstack\Samples\GenericApp
Hi,
I tried to compile TVSA project, but encounted the following error. Searched in z-stack folder, could not find it defined anywhere. Do I miss anything?
Error[Pe020]: identifier "ZDO_CONCENTRATOR_IND_CBID" is undefined C:\Texas Instruments\ZStack-CC2530-2.3.0-1.4.0\Projects\zstack\Samples\TVSA\Source\tvsa.c 225
Error while running C/C++ Compiler
Is there any document that gives more details about TVSA?
Thanks,
Yiliang
I just tried the latest files in your post. The device can be recognized as a CDC device, and it shows up in sensor monitor as a sink, just like the coordinator device in the original ZDK demo. Do we expect the USB dongle with the new firmware function as a coordinator so other CC2530 based devices can join the network?
Thanks,
Yiliang
Hey Yiliang -
The project for CC2531 (CC2530USB) gives you the choice of all 3 device types: ZC, ZR, & ZED (ZigBee Coordinator, Router, and End Device.) So whichever you compile and dowload will determine what device type is the USB dongle.
Hi DIrty Harry,
Where can i change the $PROJ_DIR$?
I'm getting trouble to open the CC2530USB because of the project directory.
Thanks
The CC2530USB project opens and builds fine in a clean install of the 2.3.0 Z-Stack - have you moved things around, perhaps? Try a clean install and see. If you are moving things or renaming folders, your life will be harder in the future when you want to merge a new release of Z-Stack.
Franz - unzip the .zip file exactly where I specified above. The projects will use the existing GenericApp source files.
Ok Dirty Harry.. it works..
but what is the difference between GenericApp and CC2530USB?
[edited]
$PROJ_DIR$\..\..\..\..\..\COMPONENTS\HAL\TARGET\CC2530USB
$PROJ_DIR$\..\..\..\..\..\COMPONENTS\HAL\TARGET\CC2530USB\usb\library
$PROJ_DIR$\..\..\..\..\..\COMPONENTS\HAL\TARGET\CC2530USB\usb\library\cc2531
$PROJ_DIR$\..\..\..\..\..\COMPONENTS\HAL\TARGET\CC2530USB\usb\class_cdc
$PROJ_DIR$\..\..\..\..\..\COMPONENTS\HAL\TARGET\CC2530EB
[/edited]
Thakns
Is it possible to use the USB dongle as the end node with a Development Board mounted EM as the base station? If so, how would we enable this configuration? I want to be able to download the same program to the USB boards as end nodes and the development boards as Coordinators.
Hi, Harry,
Thanks for the project files, they are really useful.
I want to try MT_SAPI on it, so i added the MT_SAPI_FUNC compile flag, after some cleaning of the compile errors, IAR finally complaints there are 2 osalInitTasks and which leads to build failure.
So, how could the MT_SAPI_FUNC being added successfully?
-zhu
Hello Séverin -
Did you get the USB libary working with a CDC endpoint?
The Z-Stack 2.3.1 is released and available at the CC2530 product page. The only example using USB as CDC with a virtual COM port is the ZNP. So here is an example of GenericApp for all, unzip it here:
C:\Texas Instruments\ZStack-CC2530-2.3.1-1.4.0\Projects\zstack\Samples\GenericApp
Hello Zhu -
I remember you tried to implement the ZNP and then switched to just using a sample app with the HOLD_AUTO_START option and the MT enabled so that you can control it a little like the ZNP. You seem to have a combination of both - thus 2 places trying to establish the OSAL task system. Can you install the 2.3.1 release and just use ZNP or just use, for example, the SE SampleApp?
If you want to use a pure ZNP, the suite of sample application for talking to it are found in the ZAP installer, ZAP-MSP430-1.1.0.exe, named swrc173.zip on the Z-Stack page:
http://focus.ti.com/docs/toolsw/folders/print/z-stack.html
Hello Harry,
Thanks for your quick reply.
Has zstack 2.3.1 released? i can't find it on zstack page, it's said to be there in 1-2 weeks.
I am not the man who was trying HOLD_AUTO_START option,:) i was trying your project files inside CC2530USB.zip, and found that i can't pass the building when added MT_SAPI_FUNC compile flag.
My object is use ZNP via USB, since the zstack 2.3.1 was not released(), i heard that only use the MT is a better way (also from you, in another thread), that's why i was trying MT flags on your project with usb library.
So, any more advice on ZNP via USB?
-zhu
The Z-Stack 2.3.1 is now out and includes the ZNP for CC2531 USB:
http://focus.ti.com/docs/toolsw/folders/print/z-stack.html
Dear Harry,
I am unable to get the USB dongle as CDC device after compiling with project in CC2531.zip file posted by you.
I am using ZStack 2.3.1 to build this project. How ever I was able to get the Dongle as CDC, if I flash it with ZNP project.
I am prefering to use cc2531 project because of its small size.
My question is, Do I need to add any project options or any Source/header file to my project, inordr to bring my Dongle as CDC device?
Thanks in Advance,
RD