Skip to main content
Visitor II
March 24, 2025
Solved

How to set a memory address to GPDMA_CxLBAR register when only 16 bit region is open to hold the address?

  • March 24, 2025
  • 2 replies
  • 615 views

My linked-list object's base address in memory is 0x200bffbc.   How can I save this address in GPDMA_CxLBAR register (that holds "the linked-list base address of the memory region, for a given channel x, from which the LLIs describing the programmed sequence of the GPDMA transfers, are conditionally and automatically updated")  when GPDMA_CxLBAR designated region for the address (LBA[31:16]) is only 16 bits long?

 

Anyone can help please? 

    This topic has been closed for replies.
    Best answer by psabela

    Example of creating link list in code
    and setting GPDMA_CxLBAR and GPDMA_CxLLR registers.

    //Create GPDMA link list in code. Example:
    //1. Link list item:
    typedef struct {
     volatile uint32_t CTR1_register; 
     volatile uint32_t CTR2_register; 
     volatile uint32_t CBR1_register; 
     volatile uint32_t CSAR_register; //Source address for the transfer.
     volatile uint32_t CDAR_register; //Destination address for the transfer.
     volatile uint32_t CTR3_register;
     volatile uint32_t CBR2_register;
     volatile uint32_t CLLR_register; 
    } LinkListItem_t;
    
    //2. List object with 2 linked list items and their memory address:
    typedef struct {
     LinkListItem_t node1; //node1 address: 0x200bffa8 (same as base address)
     LinkListItem_t node2; //node2 address: 0x200bffc8
    } LinkList_t; //base address: 0x200bffa8


    GPDMA channel x linked-list base address register (GPDMA_CxLBAR):
    In this example, the address of the link list structure object is 0x200bffa8

    GPDMA_CxLBAR->LBA = 0x200b
    GPDMA_CxLBAR = 0x200b0000



    GPDMA channel x linked-list address register (GPDMA_CxLLR):

    The address of node1 is 0x200bffa8.  Node 0 (staring value of LLR) points to node 1.
    f      |f      |a      |8
    1111|1111|1010|1000
    11|1111|1110|1010|00
        Bits LA[15:2]Bits 1:0 Reserved
    3  |f      |e      |a

    //Bits 15:2 LA[15:2]: pointer (16-bit low-significant address) to the next linked-list data structure
    pNode0->CLLR_register.LA = 0x3fea;
    pNode0->CLLR_register = 0xfe01ffa8; //the last 4 hex values aggree to the last 4 hex of the address 


    The address of node2 is 0x200bffc8.  The node 1 points to node 2.
    f      |f      |c      |8   
    1111|1111|1100|1000
    11|1111|1111|0010|00  Bits LA[15:2]Bits 1:0 Reserved
    3 |f       |f      |2

    //Bits 15:2 LA[15:2]: pointer (16-bit low-significant address) to the next linked-list data structure
    pNode1->CLLR_register.LA = 0x3ff2;
    pNode1->CLLR_register = 0xfe01ffc8; //the last 4 hex values aggree to the last 4 hex of the address 

    The node 2 points back to node 1. (The address of node1 is 0x200bffa8.)

    //Bits 15:2 LA[15:2]: pointer (16-bit low-significant address) to the next linked-list data structure
    pNode2->CLLR_register.LA = 0x3fea;
    pNode2->CLLR_register = 0xfe01ffa8; //the last 4 hex values aggree to the last 4 hex of the address 




    cc @Amel NASRI 

     

     

     

     

     

    2 replies

    psabelaAuthor
    Visitor II
    April 1, 2025

    Never mind.  Got it at last.

    Technical Moderator
    April 3, 2025

    Hi @psabela ,

    Glad to know that your issue is resolved.

    But how you did? That may be interesting for other to know and avoid facing a similar problem.

    -Amel

    psabelaAuthorAnswer
    Visitor II
    April 20, 2025

    Example of creating link list in code
    and setting GPDMA_CxLBAR and GPDMA_CxLLR registers.

    //Create GPDMA link list in code. Example:
    //1. Link list item:
    typedef struct {
     volatile uint32_t CTR1_register; 
     volatile uint32_t CTR2_register; 
     volatile uint32_t CBR1_register; 
     volatile uint32_t CSAR_register; //Source address for the transfer.
     volatile uint32_t CDAR_register; //Destination address for the transfer.
     volatile uint32_t CTR3_register;
     volatile uint32_t CBR2_register;
     volatile uint32_t CLLR_register; 
    } LinkListItem_t;
    
    //2. List object with 2 linked list items and their memory address:
    typedef struct {
     LinkListItem_t node1; //node1 address: 0x200bffa8 (same as base address)
     LinkListItem_t node2; //node2 address: 0x200bffc8
    } LinkList_t; //base address: 0x200bffa8


    GPDMA channel x linked-list base address register (GPDMA_CxLBAR):
    In this example, the address of the link list structure object is 0x200bffa8

    GPDMA_CxLBAR->LBA = 0x200b
    GPDMA_CxLBAR = 0x200b0000



    GPDMA channel x linked-list address register (GPDMA_CxLLR):

    The address of node1 is 0x200bffa8.  Node 0 (staring value of LLR) points to node 1.
    f      |f      |a      |8
    1111|1111|1010|1000
    11|1111|1110|1010|00
        Bits LA[15:2]Bits 1:0 Reserved
    3  |f      |e      |a

    //Bits 15:2 LA[15:2]: pointer (16-bit low-significant address) to the next linked-list data structure
    pNode0->CLLR_register.LA = 0x3fea;
    pNode0->CLLR_register = 0xfe01ffa8; //the last 4 hex values aggree to the last 4 hex of the address 


    The address of node2 is 0x200bffc8.  The node 1 points to node 2.
    f      |f      |c      |8   
    1111|1111|1100|1000
    11|1111|1111|0010|00  Bits LA[15:2]Bits 1:0 Reserved
    3 |f       |f      |2

    //Bits 15:2 LA[15:2]: pointer (16-bit low-significant address) to the next linked-list data structure
    pNode1->CLLR_register.LA = 0x3ff2;
    pNode1->CLLR_register = 0xfe01ffc8; //the last 4 hex values aggree to the last 4 hex of the address 

    The node 2 points back to node 1. (The address of node1 is 0x200bffa8.)

    //Bits 15:2 LA[15:2]: pointer (16-bit low-significant address) to the next linked-list data structure
    pNode2->CLLR_register.LA = 0x3fea;
    pNode2->CLLR_register = 0xfe01ffa8; //the last 4 hex values aggree to the last 4 hex of the address 




    cc @Amel NASRI