[Contiki-developers] error after changing mac driver

148 views
Skip to first unread message

Tao Zheng

unread,
Dec 2, 2011, 11:02:55 AM12/2/11
to Contiki developer mailing list
Hey, all,
 
In example ‘udp-ipv6’, I run it in the MSPsim Tmote Sky simulator.
Under the default configuration of MAC and RDC driver, make process is successful.
 
However, after I change mac driver from the default ‘csma_driver’ to ‘tdma_mac_driver’ as following details, the error happenes.
in “../platform/sky/contiki-conf.h”:
from
#ifndef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC     csma_driver
#endif /* NETSTACK_CONF_MAC */
to
#ifndef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC       tdma_mac_driver
#endif /* NETSTACK_CONF_MAC */
After #make,
there are some errors as following,
/home/user/contiki/examples/udp-ipv6/../../platform/sky/./contiki-sky-main.c:300: undefined reference to `tdma_mac_driver'
/home/user/contiki/examples/udp-ipv6/../../platform/sky/./contiki-sky-main.c:303: undefined reference to `tdma_mac_driver'
contiki-sky.a(contikimac.o): In function `input_packet':
/home/user/contiki/examples/udp-ipv6/../../core/net/mac/contikimac.c:847: undefined reference to `tdma_mac_driver'
contiki-sky.a(sicslowpan.o): In function `sicslowpan_init':
/home/user/contiki/examples/udp-ipv6/../../core/net/sicslowpan.c:1703: undefined reference to `tdma_mac_driver'
contiki-sky.a(sicslowpan.o): In function `send_packet':
/home/user/contiki/examples/udp-ipv6/../../core/net/sicslowpan.c:1282: undefined reference to `tdma_mac_driver'
collect2: ld returned 1 exit status
make: *** [udp-server.sky] Error 1
After every changing, I have done #make clear.
But the mistake still happenes.
 
And surprising, for any changing on MAC driver, all appear the same mistakes.
However, for any changing on RDC driver, all appear compiled successful.
 
I dont know why.
 
Thanks all.
 
Tao Zheng
 

La Chi Anh

unread,
Dec 2, 2011, 11:16:38 AM12/2/11
to Contiki developer mailing list
Hi,

You should add tdma_mac.c in core/net/mac/Makefile.mac before compiling.
Cheers

Chi-Anh

2011/12/2 Tao Zheng <tzhe...@gmail.com>:

> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Contiki-developers mailing list
> Contiki-d...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

Tao Zheng

unread,
Dec 3, 2011, 10:42:36 AM12/3/11
to La Chi Anh, Contiki developer mailing list
Hi, Chi-anh,

Thanks for your reply.
I have added tdma_mac.c in /core/net/mac/Makefile.mac, and then, I compile.
But there is still another error.

../../core/net/mac/tdma_mac.c: In function ‘tdma_mac_init’:
../../core/net/mac/tdma_mac.c:242: error: ‘const struct radio_driver’ has no
member named ‘set_receive_function’
../../core/net/mac/tdma_mac.c: At top level:
../../core/net/mac/tdma_mac.c:250: warning: initialization from incompatible
pointer type
../../core/net/mac/tdma_mac.c:251: warning: initialization from incompatible
pointer type
../../core/net/mac/tdma_mac.c:252: warning: initialization from incompatible
pointer type
../../core/net/mac/tdma_mac.c:253: warning: initialization from incompatible
pointer type
../../core/net/mac/tdma_mac.c:254: warning: initialization from incompatible
pointer type
../../core/net/mac/tdma_mac.c:255: warning: initialization from incompatible
pointer type
make: *** [obj_sky/tdma_mac.o] Error 1

Then, I trace to tdma_mac.c:242, found that, there is no any defination of
function 'set_receive_function' in struct of 'const struct mac_driver
tdma_mac_driver'.

What should I do in next?

Thanks all.

Tao Zheng

Tao Zheng

unread,
Dec 3, 2011, 10:53:39 AM12/3/11
to La Chi Anh, Contiki developer mailing list

David Kopf

unread,
Dec 3, 2011, 11:51:22 AM12/3/11
to Contiki developer mailing list, La Chi Anh, Contiki developer mailing list
tdma was apparently never updated to use the contiki 2.5 NETSTACK_RADIO driver structure. Don't know how that should be fixed. It
seems be that tdma is really an RDC driver that should be called by nullmac.

Tao Zheng

unread,
Dec 3, 2011, 10:53:17 PM12/3/11
to Contiki developer mailing list
And you means that 'nullmac.c' contains 'tdma' machenism as the RDC driver?
or what is the relationship between them?

Thanks for all.

Zheng Tao

David Kopf

unread,
Dec 4, 2011, 9:49:07 AM12/4/11
to Tao Zheng, Contiki developer mailing list
That is a source of confusion to me as well. When RDC was split from MAC the
naming was kept the same, e.g. contikimac is now an RDC.

Have you seen http://sourceforge.net/mailarchive/message.php?msg_id=28451182

tong1...@gmail.com

unread,
Nov 14, 2014, 9:03:46 AM11/14/14
to osdeve_mirror_rtos...@googlegroups.com, tzhe...@gmail.com
Dear Tao Zheng,

I just found your email from the internet. May I ask you questions about contiki mac and rdc driver programming?
Btw, is tdma_mac_driver written by yourself? Recently I am also wanting to realize our own mac protocol based on contiki os. May I have a contact with you?
Thanks very much!

Best Regards,
Fei Tong

Computer Science, University of Victoria, Canada

在 2011年12月3日星期六UTC+8上午12时02分55秒,Tao Zheng写道:
Reply all
Reply to author
Forward
0 new messages