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.

AM6421: can BCDMA and PKTDMA channel priority be configured, and how?

Part Number: AM6421
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi,

I am using AM6421. I have the following problems.

1,

I need to configure 3 channels of BCDMA to copy 3 groups of data from Sharedram to core ram, each group of data use 1 BCDMA channel.

Can I set channel 1 for data copy group1 to have higher priority than channel 2 and channel 3? and How?

2,

I also need 3 uart3 with DAM enabled. can i set uart1 DAM to have higher priority than uart2 DAM and uart3 DMA? how?

3,

for BCDMA, if interrupt mode is enabled, how to configure the interrupt priority? 

In the sysconfig, do not find where to configure the interrupt priority.

4, 

how to configure the parameter of UDMA_CACHELINE_ALIGNMENT for src and dest buf? what is the effect of different value of UDMA_CACHELINE_ALIGNMENT?

5

if I configured UDMA Block Copy Channel 0 for core R50_0, and UDMA Block Copy Channel 0 for core R50_1, are the two channel 0s the same or different channels? 

thank you.

  • Hi Pian 

    Thank you for posting this query on E2E. The key expert to help you with these queries is out of office this week, so please expect some delays in responses

    Regards

    Mukul 

  • Hi Pian,

    For the query 1 & 2, you can have different priorities for different instances as long as each instance is using the unique Interrupt numbers. 

    For query 3, Currently, there is no option to set the interrupt priority for all peripherals using Sysconfig tool. Instead you can register the interrupt and set it's priority manually by using HwiP APIs.

    You can use the HwiP API in the application code itself. You can change the interrupt priority of the peripheral before running the actual application code. (i.e. after Drivers_open API).

    Add the below code in your application.

    #define INT_PRI_SET(j)   (0x1000u + ((j) * 0x4u))
    extern HwiP_Config gHwiConfig;
    void setInterruptPriority(uint32_t intrNum, uint32_t priority)
    {
        volatile uint32_t *addr;
        addr = (volatile uint32_t *)(gHwiConfig.intcBaseAddr + INT_PRI_SET(intrNum));
        *addr = (priority & 0xFu);
    }

    Call the setInterruptPriority function defined above with correct parameters after the Drivers_open() API call.

    setInterruptPriority(i2cHandle->hwAttrs->intNum, priority);

    Regards,

    Tushar

  • Hi Tushar,

    for query 1&2, how to set the channel priority?

    thank you

  • Hi Pian,

    for query 1&2, how to set the channel priority?

    I am not very much familiar with the UDMA, and our expert is also out for this week. 

    As stated above if channel 1 & 2 are using unique interrupt number than you can set their priority in the same way as explained in earlier replies. 

    Regards,

    Tushar

  • Hi Tushar,

    we use DMA with DMA interrupt disabled. in this application, how can we set the channel priority?

    we can wait for the expert.

    thank you.

  • Hi Pian,

    we can wait for the expert.

    Thanks for your co-operation.

    Meanwhile, I found some register that can be used to set priority for DMA channel. Please refer Table 11-236 BCDAM_BCHAN, Table 11-237BCDAM_TCHAN, Table 11-238 BCDAM_RCHAN of the TRM.

    Please refer below image.

    All this above section have a priority control register which can be used to set priority.

    Regards,

    Tushar 

  • Hello Pian,

    Can you please share more details about your use case ?

    Why do you want to set the priority of the DMA channels ?

    Because we have never changed this setting till now, but as mentioned, Tushar above, there are DMA channels scheduler  registers that control the DMA channel scheduling priority.

    Regards,

    Anil.

  • Hi Swargam,

    1 for BCDMA, the application is Core R50-0 need to read 3 groups of data from Sharedram use BCDMA.

    Group1 is 5KB, and is read every 1KHz; Group2 is 20KB, and is read every 100Hz; Group 3 is 20KB and is read every 20Hz.

    Group1 uses BCDMA channel 1, Group 2 uses BCDMA channel 2, and Group3 uses BCDMA channel 3;

    Group1 is real time command and needs to read immediately, so need to set DMA channel 1 with highest priority.

    How to set the BCDMA channel priority with the API in mcu plus sdk?  The application is used in nortos.

    thank you.

  • Hello Pian,

    Based on your requirements, you need 3 DMA channels.

    1Channel reads data for every 1msec and the size is 5KB

    2channlel read data for every 10msec and the size is 20KB.

    3channlel read data for every 50msec and the size is 20KB

    By default, in the MCU+SDK, all channels are configured to the highest priority.

    So, first channel 1 is scheduled, the next 2nd channel and finally the 3rd channel will be scheduled.

    All channels will be scanned in a round-robin fashion.

    Can you please confirm how you read data for every 1msec, 10msec and 50msec ?

    Are you using Timer and in that Timer ISR, triggering DMA ?

    If you are using the timer-based method to trigger DMA, then give the highest priority for the 1msec and give the lowest priority for other timers.

    Let's assume DMA is scanning 2nd channel while Channel 1 real time command is triggered, then DMA will scan after the completion of channel 3.

    And, this scanning will be done very quickly and won't see any time difference. In this case, we don't need to change the Priority of the DMA channels .

    Please let me know if you still want to change the priority of the channels, then we need to keep channel 1 for the highest priority and remaining channels for medium or lower priority 

    Regards,

    Anil.