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.

CC2538: The problem of using DMA for variable-length serial port transmission.

Part Number: CC2538

Hi team,

Here's the request from the customer:

  1. Looking at the user manua and found that when a peripheral uses DMA, the interrupt calls the corresponding interrupt processing function of the peripheral, and the interrupt generated by the peripheral will be masked (customer doesn't know if the understanding is wrong?). Then it is usually impossible to use DMA + serial port idle interrupt to receive indefinite length data. How to realize the receiving and processing of variable length serial port data in CC2538?
  2. While using the serial port, there is also a need to use RF reception. In this case, how to set up the DMA control and processing of RF, no example was found.
  3. When looking for information on the Internet, customer saw that someone used the HAL library of STM32 instead of the example given by TI. Is this possible? Can get rid of the example given by TI and develop directly in the way of cortex-M3?

Could you help check this case? Thanks.

Best Regards,                                                        

Nick    

  • Hi Nick,

    1. The DMA's destination address and transfer size can be configured. There are maximum RX/TX transfer size definitions within code examples, but it is possible to generate an interrupt from the peripheral and service the DMA before the entire allocated transfer size has been filled.  They would benefit from examples provided in Z-Stack (MT API data reception through UART DMA varies in size) and Foundation Firmware.
    2. There are examples provided from the online community, please see this similar E2E thread and ContikiNG radio control.
    3. This is possible given suitable libraries are provided and referenced in the project's build, this happens for ContikiNG and RIOT as well.  It ultimately depends on the context.

    Regards,
    Ryan

  • Hi Ryan,

    but it is possible to generate an interrupt from the peripheral and service the DMA before the entire allocated transfer size has been filled.

    Can the peripherals here be the override interrupt of uart? Could it be a timer interrupt?

    Best Regards,                                                        

    Nick   

  • Can you please clarify exactly what the request is?  Different peripherals which are supported by DMA are provided in Section 10.3.1 and 10.3.2 of the CC2538 User's Guide.  Interrupts, including priority and control, are further explained in Chapter 5.  The idea is that interrupts should be quickly serviced and exited, sometimes raising a flag to handle further processing during the main event loop, so that the MCU does not stay inside an ISR state for too long. 

    Regards,
    Ryan