Tinyos 2.x was successfully ported to cc2430

Publisher:温暖心绪Latest update time:2015-08-17 Source: eefocusKeywords:Tinyos  cc2430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Purpose: Port Tinyos2.x to cc2430

Process: Establish the Cygwin platform under Windows, and build the Tinyos compilation environment, then compile the Tinyos-based application into a hex file, and download it to the CC2430 chip through the emulator to run.

Raw materials: hardware (wxl  cc2430 node, emulator, etc.), software (Cygwin, Keil, TinyOS  2.x, compilation environment configuration software package, SmartRF04  Flash  Programmer, etc.).

=  =

    Now more and more people are doing WSN research in China. In terms of hardware, we don't have as many hardware development platforms as those in foreign countries. Moreover, the price of crossbow's professional development platform is very expensive. However, as more and more companies begin to pay attention to WSN and zigbee, it is still possible for us to build our own wireless sensor development system within a thousand yuan.

CC2430 is the ideal hardware platform now. In China, most people still use IAR combined with z-stack protocol stack (or its variant xx Dragon version) for development. z-stack protocol stack development is relatively simple and suitable for novices. But if you are doing academic research and need to study networking and related algorithm development in depth, then UC Berkely's TinyOS is the best choice. (I believe that smart people will not wade into the muddy water of z-stack's OSAL...)

Many people have successfully ported TinyOS to CC2430. However, there seems to be no article with detailed operation steps on the Internet. So let me give you some popular science :)

—-

introduce:

First, we need to port TinyOS 2.x to CC2430. If you are good at English, please go to http://tinyos8051wg.sourceforge.net/ to view the relevant information.

TinyOS2.x for 8051 currently supports three compilers - Keil, IAR, sdcc. The compiler we use is Keil - everyone is familiar with it. TinyOS 2.x must work under the Linux platform, and Keil is a software under Windows, so we must first install a software that simulates Linux under Windows - Cygwin.

Before transplantation, we need to prepare the following:

Hardware: CC2430 node, emulator

Software: Cygwin, Keil, TinyOS 2.x, some related environment setting packages, SmartRF04 Flash Programmer

The hardware is the CC2430 development hardware that can be used normally under IAR (whether it is Wireless Dragon, Huafan, or Weigu)

I need to say something about the software:

TinyOS 2.x: Please go to http://tinyos8051wg.sourceforge.net/download  to download the latest version (this article is based on the TinyOS8051wg-0.1pre4.tgz  26 Oct 2008)

Keil: Please install it, remember to install the version without 2K limit.

 

1. Install Keil (Keil  uVersion3)

  (1) Please note that you need to download a version without 2K limit. Here is a link:

http://www.picavr.com/upload/2009_07/Keil C51 V8.09 Chinese cracked version.rar

(2) Directly click on the installation under "Keil  C51  V8.09 Chinese cracked version Keil  C51  V8.09 Chinese cracked version Keil  C51  V8.09 Chinese 1 installation". After completion, the main thing to do is to register. For registration, just refer to the registration instructions in the registration folder.

(3) Note that after completion, there should be the following files in the C:KeilC51BIN directory: C51.exe,  BL51.EXE,  OH51.EXE,  LX51.exe,  Ohx51.exe, etc. These files will be used when compiling the Tinyos project later. If not, an error will almost certainly occur at the end.

 

2. Install Java  1.5  JDK

I started using 1.6, but it didn't work. I don't know if this is the reason. It's best to use version 1.5.

Download address of jdk1.5.0:
http://java.sun.com/j2se/1.5.0/download.jsp

After the installation is complete, in the command line: java  –verson  , "java  version  "1.5.0" appears, indicating that it is version 1.5.

 

3. Install Cygwin

 (1) Download Cygwin. I downloaded it from: http://docs.tinyos.net/index.php/Installing_TinyOS_2.0.2#Manual_installation_on_your_host_OS_with_RPMs  . In Setp  2:  Install  Cygwin, there is a cygwin-files.zip in the first step. Click it to download it.

This address seems to be available for download: http://cone.informatik.uni-freiburg.de/people/aslam/cygwin-files.zip

(2) When installing, first unzip the downloaded cygwin and click setup.exe. It will be installed in the C drive by default. Basically, you don’t need to change the options, all of which are default options: "install  from  Local  Directory"->Root  Directory:  c:cygwin,  Install  for:  All  Users,  Default  Text  file  type:  Unix/Binary->When asked "Select  local  Package  directory", select the cygwin directory you unzipped, such as: "D:/cygwin-files", and wait for a while to complete the installation.

(3) Start the Cygwin shortcut icon on the desktop. The first time Cygwin is run, it will set up some things and create a home directory, in which a user is created with the username of the windows system.

 Note: At this point, create an opt directory in the cygwin root directory, which will be used later. (If you have this directory after installing cygwin, it will be different. Anyway, I didn't have this directory after installation. The following operations will automatically place some files in this directory)

 [page]

4. Download the installation packages of the compilation tools required for Tinyos development (4 in total)

NesC compilation tool: nesc-1.3.0-1.cygwin.i386.rpm

TinyOS related tools:

tinyos-deputy-1.1-1.cygwin.i386.rpm

tinyos-tools-1.3.0-1.cygwin.i386.rpm

tinyos-2.1.0-2.cygwin.noarch.rpm

These things can be found here (haha): http://www.tinyos.net/dist-2.1.0/tinyos/windows/

 

5. Install the above rpm package

(1) In the /home directory is your home directory, mine is Administrator. Copy the four rpm packages to homejohn (i.e. C:cygwinhomeAdministrator), enter the directory: cd  /home/Administrator, and you can see the four files by running ls.

(2) Install the rpm package

rpm  -ivh  nesc-1.3.0-1.cygwin.i386.rpm
rpm  -ivh  tinyos-tools-1.3.0-1.cygwin.i386.rpm
rpm  -ivh  tinyos-deputy-1.1-1.cygwin.i386.rpm
rpm  -ivh  tinyos-2.1.0-2.cygwin.noarch.rpm

Just press Enter each time you enter something.

 

6. Install Tinyos  2.x

(1) Put the downloaded Tinyos file "TinyOS8051wg-0.1pre4.tgz" into the /opt directory.

(Download address: http://tinyos8051wg.sourceforge.net/download )

 

Pay attention to check that there should be a directory called "tinyos-2.x" in this directory at this time. If there is no problem with the previous work, the subsequent operations will almost certainly go wrong.

PS: Some compilation rule files are placed in this folder, such as: opt inyos-2.xsupportmakeMakerules file.

(2) Unzip the "TinyOS8051wg-0.1pre4.tgz" file

tar  –xvzf  TinyOS8051wg-0.1pre4.tgz  , some articles say you can use winrar, but I always get an error when I do this, so it’s better to use the tar command above. Finally, a directory “tinyos-2.x-contrib” is generated under /opt

(3) Set up the compilation environment

cd  tinyos-2.x-contrib

ls   (a diku folder appears)

source  diku/env

Note: There is an env configuration file under the diku folder. We load it through the source command so that the compiler will know what configuration we want to use to compile later.

Note: Every time you restart cygwin, if you want to compile, you need to run this command (source  /opt/tinyos-2.x-contrib/diku/env)

(4) Compile the project file (taking BlinkNoTimerTask as an example)

cd  /diku/common/apps/BlinkNoTimerTask

make  cc2430em

The following errors may occur:

cd  build/cc2430em  &&  ./startup.bat

/bin/sh:  ./startup.bat:  Permission  denied

It means that the permissions are insufficient, and I don't know how to log in as a super user in cygwin (the Internet says to use the login command, but I tried it and it didn't work). My solution is: enter the cc2430em directory,  chmod  777  startup.bat, and then recompile. Anyway, it works, haha.

Tinyos 2.x successfully ported to cc2430 (with uninstallation)
[page]
My final result screenshot is as follows:

Tinyos 2.x successfully ported to cc2430 (with uninstallation)

 

 

 

Finally, the app.hex file is generated under cc2430em, as shown in the figure:

Tinyos 2.x successfully ported to cc2430 (with uninstallation)
7. Burning

(1) Download and install the SmartRF04  Flash  Programmer software. I used the Setup_SmartRF04Prog_1.3.0.exe version (I also installed the Setup_Packet_Sniffer_2_2_0_0.exe and Setup_SmartRF_Studio_6_5_1.exe software, which are the chip and emulator drivers. I don’t know if it’s redundant).

(2) Connect the computer USB to the emulator. After the emulator is connected to the chip, you will be prompted to install the driver. After the driver is automatically installed, it can be used.

(3) Open the SmartRF04 Flash  Programmer under chipcon  and set as follows:

 

 

Tinyos 2.x successfully ported to cc2430 (with uninstallation)

Note: Use System-on-Chip  =>  Flash  iage to select the app.hex file you just compiled  => click Read  IEEE, then Write  IEEE  => check Retain  IEEE  address  when  reprogramming  =>  select the second Erase, program  and  verify  in Action => finally click Perform  actions, Erase, program  and  verify  OK appears, indicating success, and a small light on the chip is flashing rapidly.

At this point, it’s done, haha!

 

 

Uninstall part

If it's useful, don't uninstall it.

   Specific uninstall steps:

1.  In the Cygwin window, use rpm  -qa to list the installed .rpm packages, and uninstall them according to the listed package names

2.  Use rpm  -e  package name or rpm  -e  --nodeps  package name to uninstall the .rpm  file. Note: The package name here cannot include words such as .rpm or .i386.cygwin.

3.  Uninstall Cygwin, delete the shortcut and Cygwin in the start menu. (Delete Cygwin in the C drive directly)

4.  Run regedit, open the registry, delete  HKEY_LOCAL_MACHINESoftWareCygnus  Solutions. Delete the files in the Cygwin root directory.
Keywords:Tinyos  cc2430 Reference address:Tinyos 2.x was successfully ported to cc2430

Previous article:TinyOS porting of CC2430 microcontroller (windows platform)
Next article:STM32 ADC generates random numbers

Recommended ReadingLatest update time:2024-11-16 16:37

How to measure SFP/SFP+/QSFP with the fiber optic tester CFP2-100-Q
SFP module refers to various types of optical modules available (such as SFP+, QSFP, etc.). For this type of module, how can we determine whether the SFP module is working properly? We can use Fluke fiber optic tester to measure the optical power emitted by SFP and SFP itself. Here, we take the new Versiv2-based Cer
[Test Measurement]
How to measure SFP/SFP+/QSFP with the fiber optic tester CFP2-100-Q
X-ray protection circuit
X-ray protection circuit The TA7609P X-ray protection circuit is shown in Figure 8-23, which consists of Q37, Q39, and Q40. Its working principle is as follows: the positive reverse pulse, after rectification by 3D03, forms a fixed DC voltage at both ends of 3C07, which is divided by 3R08, 2DW1, an
[Industrial Control]
X-ray protection circuit
Suspected iPhone 12 disassembly video: uses Qualcomm X55 baseband
      On the morning of October 22, a video from the Internet showed the disassembly of a suspected iPhone 12. This new phone is equipped with Qualcomm's Snapdragon X55 modem (also known as baseband), which is consistent with previous rumors.   A user named @Xiao1u on Weibo posted a video of an iPhone 12 disassembly.
[Mobile phone portable]
Advantages and disadvantages of ARM motherboard and X86 motherboard
Advantages over X86 motherboards:     (1) Power consumption: This is one of the biggest advantages of ARM motherboards. Generally, the power consumption of VIA's X86 motherboards is around 40W or above, while the power consumption of ARM motherboards is extremely low. For example, the power consumption of the micro-em
[Microcontroller]
Design of smart home controller based on multimedia processor VG2
1 Hardware Design The core CPU uses Samsung's S3C44B0. S3C44B0 uses the ARM7TDMI core, which greatly reduces the configuration of components other than the processor in the system circuit by providing comprehensive and general on-chip peripherals, thereby reducing system costs. The network interface chip uses t
[Microcontroller]
Design of smart home controller based on multimedia processor VG2
Using EZ-USB to realize data transmission between TMS320C6X and host
DSP is mainly used in real-time and large data signal processing systems. When it communicates with the host, the data exchange speed and interface complexity are key performance indicators of the system. Therefore, a communication method that can meet the requirements of high speed and simplicity is urgently needed. T
[Microcontroller]
Using EZ-USB to realize data transmission between TMS320C6X and host
Durable and stable: Crucial P2 500GB SSD dual system test
The P series is Crucial's mainstream NVMe solid-state drive series. It recently launched the new P2 NVMe solid-state drive, which is available in 250GB and 500GB capacities. The price-performance ratio is undoubtedly the main selling point of the Crucial P2 NVMe solid-state drive. This time we reviewed the 500GB model
[Embedded]
Durable and stable: Crucial P2 500GB SSD dual system test
arm linux port mtd-utils 1.x
background It is related to the production environment of the company. I don't want to burn nand flash under uboot every time. I also think that the method of upgrading with USB disk is slow. Besides, the relevant driver is not written by me, so I don't want to be controlled by others. I still hope it is more u
[Microcontroller]
arm linux port mtd-utils 1.x
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号