ZigBee protocol stack application and Networking (ii): Serial Port Basic Experiment

Source: Internet
Author: User

The data in the experiment is already done, so I downloaded a brand-new zstack-2.5.1a to do the experiment, follow the steps, found a lot of problems.

The first step is to configure the serial port.

Mt_uartinit in the mt_uart.c ();

  

BaudRate is set to 115200 (default is 38400), FlowControl is set to false.

The second step, predefined macros.

Mt_uartinit () There is a small

  

1, 2 lines select different data processing functions according to predefined ztool or Zapp. The rear P1 and P2 are serial 0 and serial 1. We use Ztool, serial 0. We can join in the Compilerpreprocessor place in option--c/c++.

  

The data also defines a lcd_supported=debug, and instead of compiling it, I delete it.

The third step is to configure the serial port in Sampleapp_init (Uint8 task_id).

  

Then rebulid all can receive data in the serial port!

Add:

   

I can only debug when I do the experiment, can not be hex file with smartrf Flash programmer download, will show error can ' t open the special hex file.

Reference website: http://e2e.ti.com/support/wireless_connectivity/f/158/t/158205.

If the pre-compilation x is removed, the data sent will appear a garbled, is the Z-stack MT layer definition of the serial send format,

  

  

ZigBee protocol stack application and Networking (ii): Serial Port Basic Experiment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.