cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE linked list code generation error

joker
Associate

Hi all,

I'm using STM32Cube IDE (version 1.15.1 Build: 21094_20240412_1041 (UTC)) and have the STM32H573 chip with the LinkedList feature.

Unfortunately the code generation of the linked list does not work properly and forgets to set some config settings.

The LinkedList is a List with 3 nodes.

My third node is a 2D sorting node which should be set to:

joker_0-1716281151165.png

But these lines are missing:

pNodeConfig.Init.SrcInc = DMA_SINC_INCREMENTED;
pNodeConfig.Init.SrcDataWidth = DMA_SRC_DATAWIDTH_HALFWORD;
pNodeConfig.Init.DestDataWidth = DMA_DEST_DATAWIDTH_HALFWORD;

The generated code looks like this:

HAL_StatusTypeDef ret = HAL_OK;

/* DMA node configuration declaration */
DMA_NodeConfTypeDef pNodeConfig;


/* Set node configuration ################################################*/
pNodeConfig.NodeType = DMA_GPDMA_2D_NODE;
pNodeConfig.Init.Request = GPDMA1_REQUEST_SPI1_RX;
pNodeConfig.Init.BlkHWRequest = DMA_BREQ_SINGLE_BURST;
pNodeConfig.Init.Direction = DMA_PERIPH_TO_MEMORY;
pNodeConfig.Init.SrcInc = DMA_SINC_FIXED;
pNodeConfig.Init.DestInc = DMA_DINC_INCREMENTED;
pNodeConfig.Init.SrcDataWidth = DMA_SRC_DATAWIDTH_HALFWORD;
pNodeConfig.Init.DestDataWidth = DMA_DEST_DATAWIDTH_HALFWORD;
pNodeConfig.Init.SrcBurstLength = 1;
pNodeConfig.Init.DestBurstLength = 1;
pNodeConfig.Init.TransferAllocatedPort = DMA_SRC_ALLOCATED_PORT0|DMA_DEST_ALLOCATED_PORT0;
pNodeConfig.Init.TransferEventMode = DMA_TCEM_LAST_LL_ITEM_TRANSFER;
pNodeConfig.Init.Mode = DMA_NORMAL;
pNodeConfig.RepeatBlockConfig.RepeatCount = 1;
pNodeConfig.RepeatBlockConfig.SrcAddrOffset = 0;
pNodeConfig.RepeatBlockConfig.DestAddrOffset = 0;
pNodeConfig.RepeatBlockConfig.BlkSrcAddrOffset = 0;
pNodeConfig.RepeatBlockConfig.BlkDestAddrOffset = 0;
pNodeConfig.TriggerConfig.TriggerPolarity = DMA_TRIG_POLARITY_MASKED;
pNodeConfig.DataHandlingConfig.DataExchange = DMA_EXCHANGE_NONE;
pNodeConfig.DataHandlingConfig.DataAlignment = DMA_DATA_RIGHTALIGN_ZEROPADDED;
pNodeConfig.SrcAddress = (uint32_t)&(SPI1->RXDR);
pNodeConfig.DstAddress = spi_adc_data_raw;
pNodeConfig.DataSize = 5*2*100;



/* Build SPI_node Node */
ret |= HAL_DMAEx_List_BuildNode(&pNodeConfig, &SPI_node);


/* Insert SPI_node to Queue */
ret |= HAL_DMAEx_List_InsertNode_Tail(&ADC_queue, &SPI_node);


/* Set node configuration ################################################*/
pNodeConfig.Init.Request = DMA_REQUEST_SW;
pNodeConfig.Init.Direction = DMA_MEMORY_TO_MEMORY;
pNodeConfig.Init.DestInc = DMA_DINC_FIXED;
pNodeConfig.Init.SrcDataWidth = DMA_SRC_DATAWIDTH_WORD;
pNodeConfig.Init.DestDataWidth = DMA_DEST_DATAWIDTH_WORD;
pNodeConfig.SrcAddress = (uint32_t) &TIM1_CR1_CEN_disable;
pNodeConfig.DstAddress = (uint32_t) &(TIM1->CR1);
pNodeConfig.DataSize = 4;


/* Build TIM1_STOP_node1 Node */
ret |= HAL_DMAEx_List_BuildNode(&pNodeConfig, &TIM1_STOP_node1);

/* Insert TIM1_STOP_node1 to Queue */
ret |= HAL_DMAEx_List_InsertNode_Tail(&ADC_queue, &TIM1_STOP_node1);


/* Set node configuration ################################################*/
pNodeConfig.Init.SrcInc = DMA_SINC_INCREMENTED;
pNodeConfig.Init.TransferEventMode = DMA_TCEM_BLOCK_TRANSFER;
pNodeConfig.RepeatBlockConfig.RepeatCount = 100;
pNodeConfig.RepeatBlockConfig.DestAddrOffset = 200-2;
pNodeConfig.RepeatBlockConfig.BlkDestAddrOffset = -1000+2;
pNodeConfig.SrcAddress = spi_adc_data_raw;
pNodeConfig.DstAddress = spi_adc_data_sorted_raw1;
pNodeConfig.DataSize = 5*2;

/* Build Sorting2D_node Node */
ret |= HAL_DMAEx_List_BuildNode(&pNodeConfig, &Sorting2D_node);

/* Insert Sorting2D_node to Queue */
ret |= HAL_DMAEx_List_InsertNode_Tail(&ADC_queue, &Sorting2D_node);

 

It seems like the second node overwrites it and the third node doesn't.

 

Am I missing something or is it a code generation problem?

Thanks in advance for any insights.

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @joker and welcome to the Community 🙂

Thank you for having reported this point.

I confirm this issue and submit an internal ticket (number 181922) in order to fix this.

Thank you for your contribution.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

1 REPLY 1
Imen.D
ST Employee

Hello @joker and welcome to the Community 🙂

Thank you for having reported this point.

I confirm this issue and submit an internal ticket (number 181922) in order to fix this.

Thank you for your contribution.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen