2057649_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2057649_en-US

2057649_en-US

TCDx Register is cleared out when using TCD Pool in RT1062 with SDK

I'm using SDK 2.16.100 and rt1062 MCU.

I encountered a problem when using DMA

I setup a tcd pool, and submit transfer with 2 or 3 configs to DMA channel 1, and when the edma callback is called , I found the TCD1 is all cleared to 0. When I only submit only one config, and after the edma callback is called, the TCD1 is remained.

Following is my code snippets:

Define global tcd pool



__attribute__((section(".bss.$SRAM_OC"))) edma_tcd_t __ALIGNED(4) g_tcd_pool[DMA_TCD_POOL_COUNT]; 



In my DMA setup Code:



	EDMA_CreateHandle(&g_XY2_100_Feedback_EDMA_Handle, XY2_100_DMA, XY2_100_FEEDBACK_DMA_CH);
	EDMA_SetCallback(&g_XY2_100_Feedback_EDMA_Handle, EDMA_Feedback_Callback, base);
	EDMA_InstallTCDMemory(&g_XY2_100_Feedback_EDMA_Handle, g_tcd_pool, DMA_TCD_POOL_COUNT);




Next, there is for-loop to setup transfer config



	base->remaining_dma_buffer_count = TRANSFER_SIZE;
	for (int i = 0; i < 2 && base->remaining_dma_buffer_count > 0; i ++) {
		const uint32_t transfer_cnt = MIN(DMA_MAX_COUNT, base->remaining_dma_buffer_count);
		const uint32_t offset = TRANSFER_SIZE - base->remaining_dma_buffer_count;
		const uint32_t pointer = (uint32_t)(base->buffer_info.fb_pointer) + offset + (offset / DMA_MAX_COUNT);
		EDMA_PrepareTransfer(&transfer_config,
				(void *)shifter_buffer,
				sizeof(xy2_100_feedback_data_t),
				pointer,  // plus 1 for memory address align assertion
				sizeof(xy2_100_feedback_data_t),
				sizeof(xy2_100_feedback_data_t),
				transfer_cnt * sizeof(xy2_100_feedback_data_t),
				kEDMA_PeripheralToMemory);
		// transferConfig.srcOffset = sizeof(buf_info->pointer[0].x) + sizeof(buf_info->pointer[0].y);
		base->remaining_dma_buffer_count -= transfer_cnt;
		EDMA_SubmitTransfer(&g_XY2_100_Feedback_EDMA_Handle, &transfer_config);
	}

EDMA_StartTransfer(&g_XY2_100_Feedback_EDMA_Handle);


Break at EDMA_StartTransfer , got following memory values:

 
 
 
 

2025-03-07_15-35.png

 

My Global TCD Pool

2025-03-07_15-50.png

Then continue and break inside EDMA_HandleIRQ:

 
 

2025-03-07_15-52.png

Now TCD1 is cleared

2025-03-07_15-52_1.png

Then, sga in the following code will get zero:



uint32_t sga = (uint32_t)handle->base->TCD[handle->channel].DLAST_SGA;



Re: TCDx Register is cleared out when using TCD Pool in RT1062 with SDK

Thanks, I used the definition from example, it worked then.

2025-03-10_18-21.png

Re: TCDx Register is cleared out when using TCD Pool in RT1062 with SDK

Thanks.

I indeed used 32-byte boundary before, and now I changed back to it, the g_tcd_pool address is 0x20280f60, but the TCD1 is still 0 when the EDMA_HandleIRQ is called

( and also I called EDMA_ResetChannel)

2025-03-10_18-16.png

 

2025-03-10_18-15.png

Re: TCDx Register is cleared out when using TCD Pool in RT1062 with SDK

Hi @sprhawk ,

Thank you so much for your interest in our products and for using our community..

Please check the following code.

1:  Please refer to SDK Demo "evkbmimxrt1060_edma_scatter_gather"

__attribute__((section(".bss.$SRAM_OC"))) edma_tcd_t __ALIGNED(4) g_tcd_pool[DMA_TCD_POOL_COUNT]; 

Fig1.png

Fig3.png

2: I suggest you add function EDMA_ResetChannel, just as SDK demo do.

Fig2.png


Please check above.

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-21-2025 02:23 PM
更新者: