Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jdperess
PostPosted: Dec 21, 2011 - 07:19 PM
Rookie


Joined: Oct 17, 2011
Posts: 34


I have a very strange problem, but here are some details first:
I have three dual antenna Zigbit Modules and I am programming them using the JTAG interface. I have verified fuse settings on all three modules. I have verified that i can program my own user application (non-bitcloud) on each device with expected results (blinking led's).

Now for the problem:
When I program one of the modules with the Blink sample application from Bitcloud, it works just as expected. But when i try to program the other two modules with the same blink.hex file, they don't work. The led's don't blink and I get no result.

Does anybody know whats happening? Am I missing something or doing something incredibly dumb? Please Help
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 22, 2011 - 02:43 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

If fuses are exactly the same (what they are, BTW) then I see no reason for this behavior.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Dec 22, 2011 - 04:01 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


I agree, I don't understand it. Here are the fuse settings of all three zigbits.

BODLEVEL = DISABLED
OCDEN = [ ]
JTAGEN = [X]
SPIEN = [X]
WDTON = [ ]
EESAVE = [ ]
BOOTSZ = 1024W_FC00
BOOTRST = [X]
CKDIV8 = [X]
CKOUT = [ ]
SUT_CKSEL = INTRCOSC_6CK_65MS

EXTENDED = 0xFF (valid)
HIGH = 0x9C (valid)
LOW = 0x62 (valid)
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 22, 2011 - 04:03 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Try to disable BOOTRST since you are not using a bootloader, otherwise fuses are correct.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Dec 22, 2011 - 04:15 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Tried that, no help. It's the weirdest problem. I tried some of the other bitcloud applications and the same thing happens with all of them (nothing), except with the one zigbit module that works. All modules seem to be working correctly with everything except bitcloud. Any recommendations on what to try next, or how else to diagnose?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 22, 2011 - 04:20 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

The only thing I can think of is to run it under debugger and see where it gets stuck. Quite possible that it is a hardware problem. BitCloud will hang if there is no communication to the RF-chip.

How do you connect and power your modules?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Dec 22, 2011 - 04:31 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


hmmm, I connect and power my modules through the JTAG interface from an STK600. So it's a possibility that RF modules are fried somehow?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 22, 2011 - 04:34 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Do you use some kind of board or it is just hanging wires? How did you solder it? Check that supply voltage is 3.3v.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Dec 22, 2011 - 04:45 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


I have a pcb with breakout pins. I feel bad but for no reason whatsoever it's working now. We'll see if it happens again, but for now it's resolved. Thanks so much for your help.
 
 View user's profile Send private message  
Reply with quote Back to top
jdperess
PostPosted: Jan 05, 2012 - 02:57 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Geeze, so the problem is happening again. Nothing has changed with my hardware setup. Once again, one of my boards isn't running any bitcloud app correctly. It will run a simple user created program just fine, so I assume that the programming interface is set up correctly.

I have tried using the debugger to see where the app is getting stuck, but I can't seem to figure it out. I have it run to a point in the code where the LEDs are supposed to blink, but they don't.

Are there any things that would prevent the stack from operating, such as something lacking in EEPROM?
Any help would be appreciated


Last edited by jdperess on Jan 05, 2012 - 03:14 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 05, 2012 - 03:04 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Try to insert simple blink code (using AVR registers, not BitCloud API) into the main() function. Try two places: before initialization (the very beginning) and before main loop.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Jan 05, 2012 - 03:21 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Thanks for the quick response.
Ok, so it works before initialization but not after. So this means something in SYS_SysInit() is failing/spinning. Any next ideas?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 05, 2012 - 03:28 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Most likely it is HAL_Init() [open source, so you can check this] or PHY_Init() [closed source]. And I think it is a hardware problem, there is unreliable communication with RF chip, so HAL_Init() will work.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Jan 05, 2012 - 03:37 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Ok, so it's getting stuck before HAL_Init() is called. What are my next steps? The problem is intermittent which seems weird.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 05, 2012 - 04:01 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Impossible. Here is how SYS_SysInit() starts:
Code:
void SYS_SysInit(void)
{
  HAL_Init();
  SYS_InitLog();
  RF_Init();
...
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Jan 05, 2012 - 04:11 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Interesting, I added a simple led turn on code to the beginning of the HAL_Init() function in the file "...\BitCloud_ZIGBIT_1_12_0\BitCloud\Components\HAL\avr\atmega1281\common\src\halInit.c" but nothing happened when I rebuilt and programmed. What else should I do to attempt to find the culprit code?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 05, 2012 - 04:12 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

You need to rebuild the HAL as well.

"make clean all" in the HAL directory.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Jan 05, 2012 - 04:54 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Ok thanks. It does get through HAL_Init. Any other suggestions?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 05, 2012 - 04:56 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Nope, it is MCU-RF interface failure for sure.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Jan 05, 2012 - 05:30 AM
Rookie


Joined: Oct 17, 2011
Posts: 34


Well that's a big problem. My project deadline is coming up in the near future. Now I'm going to have to purchase new modules and resolder to the pcb. What could have caused this? Does atmel warranty these things?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 05, 2012 - 05:33 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

jdperess wrote:
What could have caused this?
It could be manufacturing fault or overheating while soldering.

jdperess wrote:
Does atmel warranty these things?
I have no idea.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 09, 2012 - 02:46 PM
Wannabe


Joined: May 25, 2011
Posts: 95


Hi !

Another strange problem here. BitCloud v12 & ZigBit Amp
I have 3 nodes Coordinator, Router and End Device.


I have a problem when I try to establish network:

1. Power ON Coordinator(data sink).
2. Power ON Router.
Everything works fine till now, sending data, no errors at all, neighbour tables are OK.

3. Power ON End Device.
It joins(status 0x00 on it) to Coordinator (0x92 status). But now things get very interesting. When End Device joins it messes up neighbour table on Coordinator and I'm unable to communicate with Router nor End Device.

In neighbour table of Coordinator I see only one data (I read short address and device type). Short address is from Router and device type is End Device.


This procedure works without any problem:
1. Power ON Coordinator(data sink).
2. Power ON Router.
3. Turn OFF Coordinator.
4. Power on End Device.
5. Power on Coordinator

No errors on any device, send/receive data works on every node.


What could be a problem here?


Thanks and regards!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 09, 2012 - 04:03 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

What are your CS_* settings?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 10, 2012 - 02:45 PM
Wannabe


Joined: May 25, 2011
Posts: 95


Hi Alexru !

As allways you're right. I put same CS_UID to Router and End Device. Copy/paste what else to say. Sad


Solving this problem I found that End Device has more let's say parents in it's neighbour table.
I know that End Device could only have one parent.
I my case, End Device has Coordinator and Router in table, so first End device is connected to Coordinator then I turned OFF Coordinator and it joined to Router, after that I powered Coordinator and everything was OK.

In BitCloud API documentation it's said that CS_ROUTE_TABLE_SIZE and CS_ROUTE_DISCOVERY_TABLE_SIZE should be set to 0(zero) for End Device. Do I have to stick to that?

Is it OK to put on End Device?
CS_NIEB_TABLE_SIZE = 1 [this can be 3 or 4 maybe]
CS_MAX_CHILDREN_AMOUNT = 0
CS_MAX_CHILDREN_ROUTER_AMOUNT =0




What's the difference between PROJECT_NAME = MeshBean_Amp and PROJECT_NAME = MeshBean in Makefile? OK obviously _Amp is for amplified module and regular MeshBean for I don't know ATZB-24-A2.

I put PROJECT_NAME = MeshBean for amplified module end everything works.

What's the difference and what should I be careful/aware of?


Is it OK to put different CS_END_DEVICE_SLEEP_PERIOD on different End Devices?
CS_END_DEVICE_SLEEP_PERIOD can be changed at any time and what about CS_FFD_SLEEP_PERIOD parameter?


Once again many thanks, Alexru !
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 10, 2012 - 11:11 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

xtal_88 wrote:
Solving this problem I found that End Device has more let's say parents in it's neighbour table.
How do you check this?

xtal_88 wrote:
In BitCloud API documentation it's said that CS_ROUTE_TABLE_SIZE and CS_ROUTE_DISCOVERY_TABLE_SIZE should be set to 0(zero) for End Device. Do I have to stick to that?
No, if you don't mind wasting your RAM. Records won't be used anyway.

xtal_88 wrote:
I put PROJECT_NAME = MeshBean for amplified module end everything works.
Except for amplifier itself. You won't notice it on short distances, of course.

xtal_88 wrote:
Is it OK to put different CS_END_DEVICE_SLEEP_PERIOD on different End Devices?
As long as coordinator and routers have maximum value of all EDs it is OK.

xtal_88 wrote:
CS_END_DEVICE_SLEEP_PERIOD can be changed at any time and what about CS_FFD_SLEEP_PERIOD parameter?
I consider CS_FFD_SLEEP_PERIOD a hack and don't recommend to use sleeping routers at all. I don't know if it can be changed in run-time.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 11, 2012 - 07:33 AM
Wannabe


Joined: May 25, 2011
Posts: 95


Thanks for answers!

alexru wrote:
xtal_88 wrote:
Solving this problem I found that End Device has more let's say parents in it's neighbour table.
How do you check this?

By reading End Device neighbour table.



xtal_88 wrote:

As allways you're right. I put same CS_UID to Router and End Device. Copy/paste what else to say. Sad

Why don't I receive any warning about this from stack?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 11, 2012 - 04:00 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

xtal_88 wrote:
By reading End Device neighbour table.
I mean by using API call or just by going through internal table yourself? You may have wrong interpretation of a data in this table.

xtal_88 wrote:
Why don't I receive any warning about this from stack?
First of all IEEE address is supposed to be unique by design.And also there is no reliable way to detect this conflict. That's why IEEE makes such a big deal out of uniqueness of those addresses.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 12, 2012 - 08:31 AM
Wannabe


Joined: May 25, 2011
Posts: 95


Thanks again !

alexru wrote:
xtal_88 wrote:
By reading End Device neighbour table.
I mean by using API call or just by going through internal table yourself? You may have wrong interpretation of a data in this table.


I do it like this:
Code:

ZDO_GetNeibTable(table);
   
for(i=0;i<CS_NEIB_TABLE_SIZE;i++)
{
        // address
        u16_free = table[i].shortAddr;

        // device type
        u8_free = table[i].deviceType;
        ...
}

Could you explain what do you mean by wrong interpretation?


One other issue:
I using security(standard) and I ran on following problem:

I have 3 nodes: Coordinator, Router and End Device(sleeps for 10 sec, awake 2 sec.), network is star topology, so Router doesn't know anything about End device.

I turn OFF Coordinator and End Device wakes up and it sees that it's parent(Coordinator) is gone and it tries to join to Router.

1. On End Device I receive ZDO_NETWORK_LOST_STATUS

2. On Router ZDO_CHILD_JOINED_STATUS

3. After some time on Router I receive ZDO_CHILD_REMOVED_STATUS

4. I reset End Device.

5. Again on Router ZDO_CHILD_JOINED_STATUS

6. On End Device ZDO_AUTHENTICATION_FAIL_STATUS

7. Again after some time on Router I receive ZDO_CHILD_REMOVED_STATUS


I use CS_ZDO_SECURITY_STATUS 0.

I turn ON Coordinator and I'm able to communicate with Router but End Device is gone.


Coordinator is needed for this AUTHENTICATION and that's the reason why End Device can't join to Router.


How to handle this situation?


Thanks !
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 12, 2012 - 09:12 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

1. You need to call ZDO_GetNeibAmount() to get actual amount of records that will be returned in the table. Some records you are seeing this way (looking over CS_NEIB_TABLE_SIZE) might be incorrect.

2.Coordinator is required for normal network operation.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 15, 2012 - 02:50 PM
Wannabe


Joined: May 25, 2011
Posts: 95


alexru wrote:

2.Coordinator is required for normal network operation.


My goal is like this:

1. All nodes have some default CS parameters in Configuration.h file

2. When I want to start network, first of course I add COORDINATOR, but I send to it new CS parameters which are stored in FLASH and form now on COORDINATOR runs on these new parameters.

3. Now I add another device(ROUTER or END DEVICE it doesn't matter), so now I have to "program" COORDINATOR to "rise up" with default parameters so this new device(which has only default parameters) could join to COORDINATOR. Then COORDINATOR sends CS parameters(not default) to new device(which stores this parameters in it's own FLASH) and both nodes can function on these parameters(not default). This step is repeated for every node I want to add in network.

Both comunications are with standard security.

I saw something like this on Internet but I can't remember where.

So COORDINATOR would be out of network just when I add new node in network and that is I don't know 10-15 seconds something like that.

I hope you understand me what I would like to achieve.


Can I do that and are there some restrictions/problems?


Thanks Alexru!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 16, 2012 - 09:57 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

Why not send new parameters to each device from the same device as for the coordinator? Coordinator can't return to its previous network, you'll have to restart it anyway and all devices that were on this network will have to rejoin.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 17, 2012 - 02:51 PM
Wannabe


Joined: May 25, 2011
Posts: 95


alexru wrote:
Why not send new parameters to each device from the same device as for the coordinator?

Sorry, I wasn't clear enough from start.
I "program" COORDINATOR via USART (USB or Ethernet). I find this practical and I don't need any special device dedicated just for "programing".

Or can you suggest another way?

alexru wrote:
Coordinator can't return to its previous network, you'll have to restart it anyway and all devices that were on this network will have to rejoin.

I've tried network(STANDARD SECURITY) like this(COORDINATOR can't have END DEVICEs just ROUTERs):

COORDINATOR -> ROUTER -> END DEVICE

I turned COORDINATOR OFF for 20 minutes and turned it on again end everything works, I didn't receive any errors on ROUTER nor on END DEVICE.

So I don't know why do you mean I have to restart/reset network?


Thanks again, Alexru!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 17, 2012 - 08:19 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

xtal_88 wrote:
I turned COORDINATOR OFF for 20 minutes and turned it on again end everything works, I didn't receive any errors on ROUTER nor on END DEVICE.
Once coordinator is started it will be in the different PAN ID (is non-standard static PAN ID is not used, of course).

xtal_88 wrote:
So I don't know why do you mean I have to restart/reset network?
If router will detect address conflict, for example, it will try to communicate to the coordinator and will not find it. If you don't expect this to be a problem, then don't don anything about it, but normally you would ping coordinator from time to time and rejoin if it is not there.

But since you restart coordinator anyway then your solution might work. When special command is received or button pressed C must restart with default settings and allow new device to join. Then it will communicate real parameters to this device and restart with real parameters. Device will restart with real parameters as well. Seems like a valid commissioning method.

LE: But I still would suggest that other devices will ping the coordinator and rejoin if necessary.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
xtal_88
PostPosted: Jan 31, 2012 - 01:08 PM
Wannabe


Joined: May 25, 2011
Posts: 95


Hi Alexru!

I've established network, COORDINATOR and 3 ROUTERS. BitCloud v.13
Everything works fine.

I set on every device in config file:
Code:

#define CS_MAX_CHILDREN_ROUTER_AMOUNT 2


What bothers me is that looking at NEIGHBOUR TABLE of each node I see 3 records, e.g. on ROUTER 1 I see COORDINATOR and ROUTERS 2 and 3.
I don't know why?

alexru wrote:
1. You need to call ZDO_GetNeibAmount() to get actual amount of records that will be returned in the table. Some records you are seeing this way (looking over CS_NEIB_TABLE_SIZE) might be incorrect.

In few posts you suggested me to use this function. Reading BitCloud API this function only returns amount of routers and children(END DEVICE) amount. How can I know which of these records in NEIGHBOUR TABLE are incorrect?

Routers don't have parents so calling ZDO_GetParentAddr() on ROUTER node doesn't make sense?


Thanks !
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 01, 2012 - 06:42 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4982
Location: San Jose, CA

xtal_88 wrote:
How can I know which of these records in NEIGHBOUR TABLE are incorrect?
Use ZDO_GetNeibTable() to get actual table contents. Only valid records will be returned. It is incorrect to look as the neighbor table directly.

xtal_88 wrote:
Routers don't have parents so calling ZDO_GetParentAddr() on ROUTER node doesn't make sense?
Correct.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits