Can't compile samples from BitCloud (ZigBee) with WinAVR

Go To Last Post
986 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank's, I'll follow you recommandations, dig into the the other sample applications.

For the directories, yes, they should be there after unpacking actually. But I unpack BitCloud_ZDK_1_6_0, and some of them where missing. I manually created them, now this is fine.

Lyte.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm trying to play with peer2peer. I've got following error :
c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: avr:51 architecture of input file `objs/peer2peer.o' is incompatible with avr output

Everything is compiling fine, except the program itself.

Any idea ?

Regards,
Lyte

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you get this error on stock ZDK or have you modified anything?

Also latest release of BitCloud was build using WinAVR 20081205. There may be some incompatibilities between them.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi! After looking Bitcloud manual I found there only possibility to get ADC data from 4,8k to 77k samples per second (free running mode). It is possible to make only 1 reading of ADC per second?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
Hi! After looking Bitcloud manual I found there only possibility to get ADC data from 4,8k to 77k samples per second (free running mode). It is possible to make only 1 reading of ADC per second?

Yes, it is. Setup application timer to fire every second and read single ADC value in callback of this timer.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I got the error on stock ZDK, wihtout any modification.
Then I removed winavr-20090313 and installed winavr-20081205. Same error :
c:/winavr-20081205/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: avr:51 architecture of input file `objs/peer2peer.o' is incompatible with avr output.

I'm using AVR Studio 4 on top of winavr. Any specific setup ?

REgards,
Lyte.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lyte wrote:

I'm using AVR Studio 4 on top of winavr. Any specific setup ?

Try it without AVR Studio. Invoke 'make clean all' from command line.

Are there any other development tools (other version of gcc) installed?

How about other sample applications?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ADC in 1281 works with div. from 2 to 128, or in case of 8MHz, from 62,5kHz to 1MHz. Why constants of sample rates per second of ADC from 4,8k to 77 k?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is possible to make network topology like on attached picture? (ED2 and ED5 may be routers)

When I send data from one ED to other ED, its send via coordinator or directly?

Attachment(s): 

Last Edited: Wed. Oct 14, 2009 - 12:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

All other applications sample are compiling OK. (except peer2peer).
I tried command line 'make clean all'. Same error
I reinstall le ZDK to be sure I got the original file. Same error.

Other development tools : only Dev-Cpp.

Regards,
Lyte.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have AVR Studio 4.16 and WinAVR 20090313 - all compiling is fine

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
It is possible to make network topology like on attached picture? (ED2 and ED5 may be routers)

You can not control actual topology BitCloud will choose best one depending on many factors.

Why do you need this?

code-by wrote:

When I send data from one ED to other ED, its send via coordinator or directly?

Data to/from ED is always sent via its parent.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lyte wrote:

All other applications sample are compiling OK. (except peer2peer).
I tried command line 'make clean all'. Same error
I reinstall le ZDK to be sure I got the original file. Same error.

I afraid I won't be able to help you in this case. It is something specific to your system.

All Makefile-s are basically the same.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I try to make following:
1. coordinator may broadcast the same data to all ED at once
2. EDs communicated with C may be much than two in the picture and have only two neighbours EDs communicated by P2P.
3. any ED (incl. 1,3,4,6) can directly send data to coordinator

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

Just re-install all the stuff on another PC. Work fine now. I'll re-install the OS from scratch on the previous PC.

Thank's for your help.

Regards,
Lyte

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mode of communication from description of P2P sample:
node 0 with node 1;
node 2 with node 3;
node 4 with node 5;
node 6 with node 7.
Can I change code to send from any node to any other, and it send message via coordinator any way or directly?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
Can I change code to send from any node to any other, and it send message via coordinator any way or directly?

You may send to any address. Only BitCloud knows exact path of data. Sometimes it is better to send via some other router instead of direct sending. Do not think that direct line-of-sight link is optimal.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. Yes, when we think about power consumption its better to send with better signal quality. But if I need use well-defined path of message (distance between nodes is enough to send msg directly) ?

2. If I have 10 routers between ED and C, to send data all routers retransmit this message while I need to send it directly. So routers will be busy with when retransmit msg.

3. In p2p sample if distance between node2 and 3 is much small than between node2 and node0 (coordinator), it any away go first to coordinator? or node2 in all cases can't send directly w/o C?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
1. Yes, when we think about power consumption its better to send with better signal quality. But if I need use well-defined path of message (distance between nodes is enough to send msg directly) ?

Then ZigBee is not your choice.

code-by wrote:

2. If I have 10 routers between ED and C, to send data all routers retransmit this message while I need to send it directly. So routers will be busy with when retransmit msg.

BitCloud will figure out best way to transmit. If there is possibility to send data directly it will send them directly.

code-by wrote:

3. In p2p sample if distance between node2 and 3 is much small than between node2 and node0 (coordinator), it any away go first to coordinator? or node2 in all cases can't send directly w/o C?

Distance does not matter. It is RF. It is possible to have nodes couple meters away not able to communicate due to signal fading or some wired combination of signal paths.

Again, do not worry. ZigBee is designed to make best effort.

PS: I'll answer about ADC later.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
ADC in 1281 works with div. from 2 to 128, or in case of 8MHz, from 62,5kHz to 1MHz. Why constants of sample rates per second of ADC from 4,8k to 77 k?

Datasheet clearly states

Quote:
Up to 76.9 kSPS (Up to 15 kSPS at Maximum Resolution)

and
Quote:
The ADC module contains a prescaler, which generates an acceptable ADC clock frequency
from any CPU frequency above 100 kHz.

So prescaler is needed to generate clock that ADC can handle (50 kHz - 200 kHz). You can not "overclock" ADC.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I've uploaded P2P sample on 2 modules ZigBit OEM Modules.
One of them has CS_NWK_ADDR_ID=0 (Coordinator), and the second one CS_NWK_ADDR_ID=1 (End Device).
I connected then on 2 USB port on my PC, and open 2 terminal window.

Communcation is going fine from Coodinator (0) to End Device (1), but not the reverse (from End Device to Coordinator).
The Red Led (Sending) is lighting on the ED, but the Yellow one (receiving) is off on the Coordinator. Nothing arrived on the terminal.

Any idea ? I re-used the P2P.c program, only adding the 2 lines, to setup the nw:

nwkAddr=1; // ntwAddr=0;
CS_WriteParameter(CS_NWK_ADDR_ID, &nwkAddr);

Regards,
Lyte.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Setup looks good. You could just set CS_NWK_ADDR to whatever you want in Configuration file instead of direct source code editing.

Which SDK do you use?

PS: P2P uses Coordinator and routers (not end devices).

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I'll go throught config file instead of direct source code editing.

SDK : I'm using a ZigBit OEM Modules Breakout board (http://www.lextronic.fr/produit....) and BitCloud_ZDK_1_6_0.

OK, P2P is only Coordinator and Routers. Both should communicated in both direction. Correct ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lyte wrote:
SDK : I'm using a ZigBit OEM Modules Breakout board (http://www.lextronic.fr/produit....) and BitCloud_ZDK_1_6_0.

Then you'll have _SLIDERS_ defined and p2p will expect them.

Change this part of code:

#ifndef _SLIDERS_

  // NWK preconfigured address reading for Config Server

  CS_ReadParameter(CS_NWK_ADDR_ID, &nwkAddr);

#else  //#ifndef _SLIDERS_

  // NWK address reading from sliders 

  nwkAddr = BSP_ReadSliders();

  // Set the NWK address value to Config Server

  CS_WriteParameter(CS_NWK_ADDR_ID, &nwkAddr);

#endif //#ifndef _SLIDERS_

to

CS_ReadParameter(CS_NWK_ADDR_ID, &nwkAddr);

lyte wrote:

OK, P2P is only Coordinator and Routers. Both should communicated in both direction. Correct ?

Yes, they are. May be this is hardware problem?

You may try to change line

appUsartDescriptor.flowControl = USART_FLOW_CONTROL_HARDWARE;

to

appUsartDescriptor.flowControl = USART_FLOW_CONTROL_NONE;

In this way p2p won't use HW flow control.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm working on a project using the ZigBit 2.4 GHz Amp Module with U.FL Connector. I set up two PCB-s on which I mounted 2 modules. There is no UID chip.

I have a coordinator and a router. I took as an example the WSN_DEMO application and modified it a little bit:
- every 5 seconds each device sends a message to the other one
- I enabled IRQ0 to send message when triggered
All sent and received messages are outputted by the coordinator using the UART.

I left the devices running and the coordinator connected to my RS-232 port. Everything works OK for a couple of hours (5-6).

After this the coordinator stops sending messages on the RF. It receives all the messages from router and it outputs them on the UART. But the timer looks like it is stopped, IRQ not working.
If I send a command to coordinator which should be sent to router it works. The coordinator sends the command to router. After this everything is back to normal, coordinator is working fine.
It is not a state machine problem because the IRQ send the state machine in the SENDING_MESSAGE state (in which the message is sent to router).

After some time (a couple of hours again) the router stops sending messages. As for the router there is no command (on UART) to force him to send a message a reset is required. All this time the router gets all the messages from the coordinator.

Does anybody have any clue what is the cause of the problem?

I'm using:
- BitCloud API 1.6
- WinAVR-20090313
- most of the code from WSN_DEMO project (should I assign an UID to each device?)

Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. You should set CS_UID on platforms without UID.

2. Nobody will be able to help you without careful study of source code and hours of debugging. But from my experience it really looks like broken state machine. It may broke somehow after state change.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had a code review and came across a simple fact: I do NOT have any code which disables the IRQ nor the timer I used.

So I can't understand why the IRQ and timer get disabled and everything else works (process incoming messages on RF and UART).

I did the following:
1. Set the CS_UID
2. Recompile using BitCloud 1.5

I write the new firmware and let it run.
Now after 19 hours devices are still running perfectly.

When they reach 24 hours I will recompile using the BitCloud 1.6.

By the way: I could not find a history for the releases of BitCloud.
What did BitCloud 1.6 bring new? (Except for the precompiled files for Iar)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EGTOGAMAT wrote:
So I can't understand why the IRQ and timer get disabled and everything else works (process incoming messages on RF and UART).

RF and UART won't work with interrupts disabled.

Are you using HAL_AppTimer()?

EGTOGAMAT wrote:

By the way: I could not find a history for the releases of BitCloud.
What did BitCloud 1.6 bring new? (Except for the precompiled files for Iar)

See file Release Notes.txt in SDK.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

appUsartDescriptor.flowControl = USART_FLOW_CONTROL_NONE;

In this way p2p won't use HW flow control

I set controlflow=None, and now it works.

Tx,
Lyte.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lyte wrote:

I set controlflow=None, and now it works.

Fine. Just be prepared to possible data loss.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

1. You should set CS_UID on platforms without UID.

Looks like this was the key element. I re-compiled with BitCloud 1.6 and after 24 hours everything is ok (using the same state machine)

Thanks again for the hyperfast help :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!
In Lowpower sample - sendStep() function I change

apsDataReq.dstAddress.shortAddress = children.childrenTable[childrenIndex].shortAddr;

to

apsDataReq.dstAddress.shortAddress = 0xFFFF;

and comment following in APS_DataConf():

//childrenIndex++;
//sendStep();

but node don't change sensor type :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EGTOGAMAT wrote:
Looks like this was the key element. I re-compiled with BitCloud 1.6 and after 24 hours everything is ok (using the same state machine)

Zero UID can not be directly connected to hangups. Anyway I am glad that problem solved.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
but node don't change sensor type :(

Try to leave shortAddress as it was but leave comment in APS_DataConf and see what happens.

If it is possible also add some indication (led or something else) to function dataInd() in enddevice.c.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now coordinator change sensor only of node with 0x0001 addr, but I need change in all nodes by sending command once (broadcast).
Where I can found function that compare self address and address of incoming message to accept or not this message?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
Now coordinator change sensor only of node with 0x0001 addr, but I need change in all nodes by sending command once (broadcast).

So 0xffff must work. I don't know what the problem is but I'll think about it.

code-by wrote:

Where I can found function that compare self address and address of incoming message to accept or not this message?

It is done automatically by BitCloud.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know that done by BitCloud, but in what file/function?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
I know that done by BitCloud, but in what file/function?

How it will help you? BitCloud source code is closed.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

May be some error in this function that not accept messages for all nodes with addr. 0xffff?

Its possible to speedup UART from 38400 to 115200 (from coordinator to PC)? When I change USART_BAUDRATE_38400 to USART_SYNC_BAUDRATE_115200 and change speed of COM from 38400 to 115200 in hyperterminal - it don't correctly show incoming data :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
May be some error in this function that not accept messages for all nodes with addr. 0xffff?

It might be an error in BitCloud. Check conf->status value in APS_DataConf() on coordinator.

code-by wrote:

Its possible to speedup UART from 38400 to 115200 (from coordinator to PC)? When I change USART_BAUDRATE_38400 to USART_SYNC_BAUDRATE_115200 and change speed of COM from 38400 to 115200 in hyperterminal - it don't correctly show incoming data :(

It is impossible without changing CPU frequency. And changing it impossible due to a lot of reasons.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I send to 0xFFFF the status is 0x00A6

(APS_INVALID_PARAMETER_STATUS = 0xa6, //!

sending to 0x0001 - status is 0x0000 (success)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
When I send to 0xFFFF the status is 0x00A6

(APS_INVALID_PARAMETER_STATUS = 0xa6, //!

sending to 0x0001 - status is 0x0000 (success)

I just remembered that for broadcast transmission you need to set apsDataReq.txOptions.acknowledgedTransmission = 0.

This might help.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to set up a ZigBee topology which will include routers and endpoints.

I would be grateful if I could get a little help for the questions below.

1. I looked over over the documentation of BitCloud but I could not find the maximal number of:
- endpoints accepted by a router
- number of routers in a PAN
- depth of a network (starting from PAN or between 2 devices/routers)
I found in the API help the predefined values for some of the parameters. But there is no maximal value indication.

2. I would like to set up a topology made up just by routers (no low power constraints) if possible.
My question: does BitCloud offer a best-route mechanism? Meaning if I have 3 routers a new router which connects how will it chose the parent?
2.a) I could do a software workaround but can I force a device to:
- scan for a PAN and all address of all "direct view" routers (with depth 1)
- force the new router to connect to a specific router (parent)?

3. Can I use all 16 channels in the same place? I ask this because in theory for wi-fi there are also 16 channels but real life in the same place only 8 channels are used (due to overlap on an adjacent channel a lot of errors occur). As ZigBee data transfer is much lower I think it should work.
Was it ever tested?

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EGTOGAMAT wrote:

I found in the API help the predefined values for some of the parameters. But there is no maximal value indication.

Limited by amount of available memory only.

EGTOGAMAT wrote:

Meaning if I have 3 routers a new router which connects how will it chose the parent?

Parent will be chosen based on best link quality.

EGTOGAMAT wrote:

2.a) I could do a software workaround but can I force a device to:
- scan for a PAN and all address of all "direct view" routers (with depth 1)
- force the new router to connect to a specific router (parent)?

There are no documented API for manual scanning now. But functions are there and you may use them.

For routers 'connection' is something ephemeral. They may change parent.

EGTOGAMAT wrote:
Was it ever tested?

We all work on different channels here and all channels are busy. We see no interference at all.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Changes doesn't help for send broadcast message to all nodes :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
Changes doesn't help for send broadcast message to all nodes :(

What the return code after change?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

with codes 0x00A6 or 0x0000 it not change type of sensor and ED node don't receive any thing.

What is group (multicast) method of sending message? Do I need add address of every node to some group for sending messages?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
with codes 0x00A6 or 0x0000 it not change type of sensor and ED node don't receive any thing.

There is problem in BitCloud with sending broadcast data to EDs. It has been corrected in development version but I do not know when it will be released.

As workaround I'd suggest using unicast or routers instead of EDs.

code-by wrote:

What is group (multicast) method of sending message? Do I need add address of every node to some group for sending messages?

No. You add node to some group (referenced by predefined ID). All other nodes in this group (they also must add themselves to this group) will receive message. You may try this but I do not have any sample on this and it has no advantages over sequential unicast send in this case.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have 2 questions about interrupts:

1. When an interrupt is served does the general interrupt bit get cleared by default? (because the API recommends using global variables a reentrant function can cause wrong results)

2. Is there a function to clear the IRQ interrupt flag? I ask this because I set up the following debounce mechanism:
- at the first call of the interrupt handler I disable the interrupt and start a timer
- when timer is triggered I re-enable the interrupt

I notice that the interrupt handler is executed twice regardless of the debounce timer value (300 ms, 700 ms). I think that the bounce of the button is setting the interrupt flag after I disable the interrupt. When I enable it again the interrupt handler is executed again.
(I did a software workaround but the idea is that the interrupt handler is executed more times - due to bounce).

I could manually clear the interrupt flag (touching direclty the interrupt bit) before enabling the interrupt. May I do this? (in the user guide is recommend not to access directly the mcu registers)

Thanks for help

Pages