This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/LAUNCHXL-CC1312R1: Transmitting a packet from a interrupt handler

Part Number: LAUNCHXL-CC1312R1
Other Parts Discussed in Thread: CC1310, CC1312R

Tool/software: TI-RTOS

Is it possible to transmit a data packet from a interrupt handler?

I'm looking at Contiki TSCH implementation and it looks like TSCH depends on real time timer which commands radio from the interrupt handler.

I would like to know if it is possible to transmit data and wait for its completion by busy wait.

I see scheduleCmd puts the command, but the command never executed while waiting in the interrupt handler with busy loop.

The status is pending state. When is the command actually sent to the radio core for execution?

I see CC1310 used different method of sending command in Contiki implementation.

Thank you.

  • I suppose you are looking at proprietary commands since you are using CC1310.

    Yes, you can schedule TX from HWI/SWI, though not recommended. However, for the TX to go through you need to ensure there is not an active RX command running. That means you need to schedule TX, stop RX, and then re-schedule RX when the TX finishes.

    Are you looking in Contiki or Contiki-NG? And if Contiki-NG, which platform?

  • I'm looking at Contiki-NG with CC1312R platform.

    I see it stops RX, but it never execute the TX command.

    Here is some relevant code snippets.

    CMD_STATUS(netstack_cmd_tx) = PENDING;

    RF_CmdHandle tx_handle = RF_scheduleCmd(&rf_netstack,(RF_Op *)&netstack_cmd_tx,&sched_params,NULL,0);

    ...

    // netstack_cmd_rx status is 2 at this point

    CMD_STATUS(netstack_cmd_rx) = DONE_STOPPED;

    RF_cancelCmd(&rf_netstack, cmd_rx_handle, RF_ABORT_GRACEFULLY);

    // netstack_cmd_rx status becomes 0x3404

    ...

    while (1) {

      if ((CMD_STATUS(netstack_cmd_tx) & 0xC00) != 0)

        break;

    }

    The busy loop never finishes, and the status of netstack_cmd_tx remains PENDING (1)

    This is all done in the interrupt handler.

    ...

  • That would be the SimpleLink platform on Contiki-NG. The SimpleLink platform does not support TSCH, as changes in the ieee-mode/prop-mode driver require changes in order to work. This includes scheduling transmissions from interrupts.

  • Are you saying scheduling transmission from interrupt handler is not permitted on SimpleLink platform? Is it something changed from CC1310 platform because CC1310 uses the radio the same way. If I want to implement TSCH support on SimpleLink platform, do I need to move this out of interrupt handler?

  • The current implementation does not support that, yes. It is a matter of implementation.

  • Yes I would like to implement TSCH support on CC1312.

    However the current TSCH implementation expects the transmission done at the interrupt handler, which work on CC1310 prop-mode and rf-core implementation.

    I tried to implement missing features to support TSCH on CC1312 prop-mode driver, but I cannot make CC1312 to transmit a packet inside of interrupt.

    The question is if the CC1312 or more recent SDK has changed such that the transmission inside of the interrupt handler is not permitted or if I'm missing something to make the transmission to work.

    Thank you,

    Paul