contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.72k stars 2.58k forks source link

Question: In cc2538, info from AUTO_ACKS seems to die in the MAC and RDC layers #751

Closed areaarea closed 9 years ago

areaarea commented 10 years ago

It seems like the return value of the Tx gets trapped inside the MAC and/or RDC layers of the drivers. There seems to be a fair number of int return types that can process this information up the stack, but at the rdc_driver and mac_driver levels, the return types become void and thats where the information dies.

I would like to have this information available at the sending process level, so I am going to extend the ContikiMAC driver (I use this for my RDC) to expose some ACK information. Before I go to through this effort, I wanted to ensure that it is, in fact, the case that this information is not already available with these mechanisms.

I only ask because it seems odd to have the return types for the Tx transaction to be logged and returned only partially up the stack.

Adam

senspace commented 10 years ago

For the platform of cc2538, the contikimac just turns the radio on or off. The MCU doesn't enter the PM1 or PM2. So the power consumption is still very high. Do you find this? /**part of the code****/ file: contikimac.c

/* MCU can sleep during radio off */

ifndef RDC_CONF_MCU_SLEEP

define RDC_CONF_MCU_SLEEP 0

endif

  /* Schedule the next powercycle interrupt, or sleep the mcu
 until then.  Sleeping will not exit from this interrupt, so
 ensure an occasional wake cycle or foreground processing will
 be blocked until a packet is detected */

if RDC_CONF_MCU_SLEEP

  static uint8_t sleepcycle;
  if((sleepcycle++ < 16) && !we_are_sending && !radio_is_on) {
    rtimer_arch_sleep(CYCLE_TIME - (RTIMER_NOW() - cycle_start));
  } else {
    sleepcycle = 0;
    schedule_powercycle_fixed(t, CYCLE_TIME + cycle_start);
    PT_YIELD(&pt);
  }

else

  ....

/**part of the code****/

When "#define RDC_CONF_MCU_SLEEP 1", the MCU can sleep during radio off. But For the platform of cc2530, the function "rtimer_arch_sleep(CYCLE_TIME - (RTIMER_NOW() - cycle_start));" is not defined. So The MCU doesn't enter the PM1 or PM2.

sdawans commented 10 years ago

Hi, please use the github link feature rather than copy pasting.

For example: This issue might be related to #785

senspace commented 10 years ago

Thank you for your reminder. Yes, this issue is related to #785. Do you have some ideas?

dak664 commented 10 years ago

I will give more complete answer in #785 but that sleep method would only work for radios where the hardware sends the 802.15.4 ACK after receiving a packet. Otherwise the interrupt routine must exit to allow the software to send the ACK.

g-oikonomou commented 10 years ago

Adam, the csma driver will expose to upper layers success/failure/number of retransmission attempts.

(Sent callback)

Not sufficient?