Debug Time !
|
Let's check how you can debug a conversation between two Sub-1 GHz Radios.
We'll use the TI-RTOS simplest example, and place some strategic breakpoints.
One on the sender side, just before transmission, when the data packet is prepared.
One at receiver side, at the moment that the data is retrieved.
Set up the Sender and Receiver
In the links below you find instructions to get two separate CCS debug sessions running.
If you've never before used two LaunchPads on a single computer, check them out first.
The remainder of the article assumes that you've configured CCS to run multiple instances, with debug connector talking to the correct LaunchPad.
Load the TI-RTOS RF Packet TX exampe in the CCS Sender session, the RX example in the Receiver session.
Breakpoints
For the Sender, set the breakpoint at the lines where the transmit packet is constructed.
Source rfPacketTx.c, function txTaskFunction().
For the Reciver, it's source rfPacketRx.c, function callback().
Start the receiver debug session, and kick it off. The program will keep spinning until date is received.
Then start the sender debug session. It will stop at the position where the data is prepared.
When the sender session stops, set a watch expression for the packet variable.
Then step over the code to see the random content of the 30 data points getting prepared.
Keep stepping over the code until you reach the RF_EventMask result = RF_runCmd() line.
The receiver debug session is still running interrupted.
Then step over the sending functions. Keep an eye on the receiver CCS session, because it will stop executing.
Our code fell into the receiver callback breakpoint.
You can now step until the memcpy() line. Also create a watch expression for the packet variable in the receiver session.
Step over the memcpy() line. You 'll see that the receiver packet has the identical content as what was randomly generated at sender side.
Thats your proof that the conversation worked.
In the real world, the random package could be sensor values, or messages.
You could use the hardware support for encryption and decryption to scramble the packet before it's beamed.
I'm curious to see what you will be transmitting with these devices...
Top Comments