S32K344 bare-metal DMA initialization

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344 bare-metal DMA initialization

Jump to solution
3,615 Views
mateusz_swiszcz
Contributor II

I've got a problem with DMA init. I was unable to initialize DMA by using bare-metal programming. The interrupt is not called and no data is passed. Meanwhile interrupt from SPI is working. Could you check my DMA configuration? I also set a "LPSPI_DER_RDDE" bit in "IP_LPSPI/n/->DER" register. This should set DMA for receive data. 

void DMA_Init(volatile uint32_t rxBuffer) {
	/*
	For remaining S32K3xx devices: DMAMUX_0 channel 0-15 and DMAMUX_1 channel 0-15 are
	mapped to eDMA Transfer Control Descriptor(TCD) 0-15 and eDMA Transfer Control Descriptor(TCD)
	16-31, respectively
	*/

	// TCD register init
    IP_TCD->TCD0_SADDR = 0U;
    IP_TCD->TCD0_SOFF = 0;
    IP_TCD->TCD0_ATTR = 0U;
    IP_TCD->NBYTES0.TCD0_NBYTES_MLOFFNO = 0U;
    IP_TCD->NBYTES0.TCD0_NBYTES_MLOFFYES = 0U;
    IP_TCD->TCD0_SLAST_SDA = 0;
    IP_TCD->TCD0_DADDR = 0U;
    IP_TCD->TCD0_DOFF = 0;
    IP_TCD->CITER0.TCD0_CITER_ELINKNO = 0U;
    IP_TCD->CITER0.TCD0_CITER_ELINKYES = 0U;
    IP_TCD->TCD0_DLAST_SGA = 0;
    IP_TCD->TCD0_CSR = 0U;
    IP_TCD->BITER0.TCD0_BITER_ELINKNO = 0U;
    IP_TCD->BITER0.TCD0_BITER_ELINKYES = 0U;

    //===== DMA MUX =====//
	// Enable a source without periodic triggering
	// 1. Determine the DMA channel with which the source is associated.
	// LPSPI1 DMA RX Request -> Source 46
	// 2. Write 0 to CHCFGn[ENBL] and CHCFGn[TRIG] of the DMA channel.
	IP_DMAMUX_0->CHCFG[0] &= ~DMAMUX_CHCFG_ENBL_MASK;
	IP_DMAMUX_0->CHCFG[0] &= ~DMAMUX_CHCFG_TRIG_MASK;
	// 3. You can enable the DMA channel at this point.
	IP_DMAMUX_0->CHCFG[0] |= DMAMUX_CHCFG_ENBL_MASK;
	// 4. Select the source to be routed to the DMA channel.
	IP_DMAMUX_0->CHCFG[0] |= DMAMUX_CHCFG_SOURCE(46);

	//===== eDMA =====//
    // 1. Write to the CSR if a configuration other than the default is wanted.
    // 2. Write the channel priority levels to the CHn_PRI registers and group priority levels to the CHn_GRPRI registers if a
    // configuration other than the default is wanted.
    // 3. Enable error interrupts in the CHn_CSR[EEI] registers if they are wanted.
	// 4. Write the 32-byte TCD for each channel that may request service.
	// CH0_SBR_MID: Default master id -> 0b10
	// Source address -> SPI receive buffer
	IP_TCD->TCD0_SADDR = IP_LPSPI_1->RDR;
	// Destination address
	IP_TCD->TCD0_DADDR = rxBuffer;
	// Source Address Offset
	IP_TCD->TCD0_SOFF = 4;
	// Destination Address Offset
	IP_TCD->TCD0_DOFF = 4;
	// Source size: 32-bit
	IP_TCD->TCD0_ATTR |= DMA_TCD_TCD0_ATTR_SSIZE(0b10);
	// Destination size: 32-bit
	IP_TCD->TCD0_ATTR |= DMA_TCD_TCD0_ATTR_DSIZE(0b10);

	// 4 byte transfer
	IP_TCD->NBYTES0.TCD0_NBYTES_MLOFFNO = 4;
	// Current Major Loop Count
	IP_TCD->CITER0.TCD0_CITER_ELINKNO = 1;
	// Beginning Major Loop Count
	IP_TCD->BITER0.TCD0_BITER_ELINKNO = 1;

	// Interrupt after transfer is complete
	IP_TCD->TCD0_CSR |= DMA_TCD_TCD0_CSR_INTMAJOR_MASK;

	// Enable interrupt
	__NVIC_ClearPendingIRQ(DMATCD0_IRQn);
	__NVIC_SetPriority(DMATCD0_IRQn, 0);
	__NVIC_EnableIRQ(DMATCD0_IRQn);

	// 5. Enable any hardware service requests via the CHn_CSR[ERQ] registers.
	IP_TCD->CH0_CSR |= DMA_TCD_CH0_CSR_ERQ_MASK;
	
}

void DMATCD0_Handler(void) {
	// Print rxBuffer
	printf("rxBuffer: %ld", rxBuffer);
	// Clear interrupt request
	IP_TCD->CH0_INT = 1;
}

 

0 Kudos
Reply
1 Solution
3,524 Views
danielmartynek
NXP TechSupport
NXP TechSupport

HI Mateusz,

Thanks for the project.

 

First, I enabled DMAMUX_0_CH0 at 4028_0000h + 0x3.

IP_DMAMUX_0->CHCFG[3] = 0xAE;

danielmartynek_0-1743512787294.png

 

Then I saw that SBE = 1 Source bus error in the TCD0 descriptor.

The TCD0_SADDR register was not configured (checked in the register view)

IP_TCD->TCD0_SADDR = &IP_LPSPI_1->RDR;

 

Now, it gets to the DMA handler:

danielmartynek_1-1743513063363.png

 

Regards,

Daniel

View solution in original post

8 Replies
3,596 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mateusz_swiszcz,

You should not offset the source address (TCD0_SOFF), but otherwise I don't see any issue in the code.

Is there any error flag set in EDMA?

Do you have the buffers in non-cacheable SRAM?

Can you dump the EDMA and NVIC registers and share it?

 

Thanks,

Daniel

 

0 Kudos
Reply
3,568 Views
mateusz_swiszcz
Contributor II
Hi,

I disabled a source address offset but nothing changed. There's no error flags in EDMA. I have buffers in non-cacheable SRAM. 

NVIC->ISER[0] = 0x10; NVIC->ISER[5] = 0x40; NVIC->ICER[0] = 0x10; NVIC->ICER[5] = 0x40

EDMA->CSR = 0x300000

Other register fields in EDMA and NVIC are null.
0 Kudos
Reply
3,554 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mateusz_swiszcz,

Could you share the whole project so that I can test it?

It can be shared privately via a support ticket.

 

 

0 Kudos
Reply
3,532 Views
mateusz_swiszcz
Contributor II

Hi, @danielmartynek 

The whole projects is in the attachment.

0 Kudos
Reply
3,525 Views
danielmartynek
NXP TechSupport
NXP TechSupport

HI Mateusz,

Thanks for the project.

 

First, I enabled DMAMUX_0_CH0 at 4028_0000h + 0x3.

IP_DMAMUX_0->CHCFG[3] = 0xAE;

danielmartynek_0-1743512787294.png

 

Then I saw that SBE = 1 Source bus error in the TCD0 descriptor.

The TCD0_SADDR register was not configured (checked in the register view)

IP_TCD->TCD0_SADDR = &IP_LPSPI_1->RDR;

 

Now, it gets to the DMA handler:

danielmartynek_1-1743513063363.png

 

Regards,

Daniel

3,414 Views
mateusz_swiszcz
Contributor II

Hi, @danielmartynek 

Why does CHCFG[3] works and CHCFG[0] not when I'm using TCD0 and Channel 0 of DMA? How can i match numbers of CHCFG[n], TCDn, CHn in case of other instances of SPI or other peripheries?

0 Kudos
Reply
3,410 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mateusz_swiszcz,

Here is the offset of the registers:

danielmartynek_0-1744022054705.png

danielmartynek_1-1744022091817.png

 

3,467 Views
mateusz_swiszcz
Contributor II
Thanks for the help, it works
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2069296%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2069296%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI've%20got%20a%20problem%20with%20DMA%20init.%20I%20was%20unable%20to%20initialize%20DMA%20by%20using%20bare-metal%20programming.%26nbsp%3BThe%20interrupt%20is%20not%20called%20and%20no%20data%20is%20passed.%20Meanwhile%20interrupt%20from%20SPI%20is%20working.%20Could%20you%20check%20my%20DMA%20configuration%3F%20I%20also%20set%20a%20%22LPSPI_DER_RDDE%22%20bit%20in%20%22IP_LPSPI%2Fn%2F-%26gt%3BDER%22%20register.%20This%20should%20set%20DMA%20for%20receive%20data.%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Evoid%20DMA_Init(volatile%20uint32_t%20rxBuffer)%20%7B%0A%09%2F*%0A%09For%20remaining%20S32K3xx%20devices%3A%20DMAMUX_0%20channel%200-15%20and%20DMAMUX_1%20channel%200-15%20are%0A%09mapped%20to%20eDMA%20Transfer%20Control%20Descriptor(TCD)%200-15%20and%20eDMA%20Transfer%20Control%20Descriptor(TCD)%0A%0916-31%2C%20respectively%0A%09*%2F%0A%0A%09%2F%2F%20TCD%20register%20init%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_SADDR%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_SOFF%20%3D%200%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_ATTR%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BNBYTES0.TCD0_NBYTES_MLOFFNO%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BNBYTES0.TCD0_NBYTES_MLOFFYES%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_SLAST_SDA%20%3D%200%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_DADDR%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_DOFF%20%3D%200%3B%0A%20%20%20%20IP_TCD-%26gt%3BCITER0.TCD0_CITER_ELINKNO%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BCITER0.TCD0_CITER_ELINKYES%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_DLAST_SGA%20%3D%200%3B%0A%20%20%20%20IP_TCD-%26gt%3BTCD0_CSR%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BBITER0.TCD0_BITER_ELINKNO%20%3D%200U%3B%0A%20%20%20%20IP_TCD-%26gt%3BBITER0.TCD0_BITER_ELINKYES%20%3D%200U%3B%0A%0A%20%20%20%20%2F%2F%3D%3D%3D%3D%3D%20DMA%20MUX%20%3D%3D%3D%3D%3D%2F%2F%0A%09%2F%2F%20Enable%20a%20source%20without%20periodic%20triggering%0A%09%2F%2F%201.%20Determine%20the%20DMA%20channel%20with%20which%20the%20source%20is%20associated.%0A%09%2F%2F%20LPSPI1%20DMA%20RX%20Request%20-%26gt%3B%20Source%2046%0A%09%2F%2F%202.%20Write%200%20to%20CHCFGn%5BENBL%5D%20and%20CHCFGn%5BTRIG%5D%20of%20the%20DMA%20channel.%0A%09IP_DMAMUX_0-%26gt%3BCHCFG%5B0%5D%20%26amp%3B%3D%20~DMAMUX_CHCFG_ENBL_MASK%3B%0A%09IP_DMAMUX_0-%26gt%3BCHCFG%5B0%5D%20%26amp%3B%3D%20~DMAMUX_CHCFG_TRIG_MASK%3B%0A%09%2F%2F%203.%20You%20can%20enable%20the%20DMA%20channel%20at%20this%20point.%0A%09IP_DMAMUX_0-%26gt%3BCHCFG%5B0%5D%20%7C%3D%20DMAMUX_CHCFG_ENBL_MASK%3B%0A%09%2F%2F%204.%20Select%20the%20source%20to%20be%20routed%20to%20the%20DMA%20channel.%0A%09IP_DMAMUX_0-%26gt%3BCHCFG%5B0%5D%20%7C%3D%20DMAMUX_CHCFG_SOURCE(46)%3B%0A%0A%09%2F%2F%3D%3D%3D%3D%3D%20eDMA%20%3D%3D%3D%3D%3D%2F%2F%0A%20%20%20%20%2F%2F%201.%20Write%20to%20the%20CSR%20if%20a%20configuration%20other%20than%20the%20default%20is%20wanted.%0A%20%20%20%20%2F%2F%202.%20Write%20the%20channel%20priority%20levels%20to%20the%20CHn_PRI%20registers%20and%20group%20priority%20levels%20to%20the%20CHn_GRPRI%20registers%20if%20a%0A%20%20%20%20%2F%2F%20configuration%20other%20than%20the%20default%20is%20wanted.%0A%20%20%20%20%2F%2F%203.%20Enable%20error%20interrupts%20in%20the%20CHn_CSR%5BEEI%5D%20registers%20if%20they%20are%20wanted.%0A%09%2F%2F%204.%20Write%20the%2032-byte%20TCD%20for%20each%20channel%20that%20may%20request%20service.%0A%09%2F%2F%20CH0_SBR_MID%3A%20Default%20master%20id%20-%26gt%3B%200b10%0A%09%2F%2F%20Source%20address%20-%26gt%3B%20SPI%20receive%20buffer%0A%09IP_TCD-%26gt%3BTCD0_SADDR%20%3D%20IP_LPSPI_1-%26gt%3BRDR%3B%0A%09%2F%2F%20Destination%20address%0A%09IP_TCD-%26gt%3BTCD0_DADDR%20%3D%20rxBuffer%3B%0A%09%2F%2F%20Source%20Address%20Offset%0A%09IP_TCD-%26gt%3BTCD0_SOFF%20%3D%204%3B%0A%09%2F%2F%20Destination%20Address%20Offset%0A%09IP_TCD-%26gt%3BTCD0_DOFF%20%3D%204%3B%0A%09%2F%2F%20Source%20size%3A%2032-bit%0A%09IP_TCD-%26gt%3BTCD0_ATTR%20%7C%3D%20DMA_TCD_TCD0_ATTR_SSIZE(0b10)%3B%0A%09%2F%2F%20Destination%20size%3A%2032-bit%0A%09IP_TCD-%26gt%3BTCD0_ATTR%20%7C%3D%20DMA_TCD_TCD0_ATTR_DSIZE(0b10)%3B%0A%0A%09%2F%2F%204%20byte%20transfer%0A%09IP_TCD-%26gt%3BNBYTES0.TCD0_NBYTES_MLOFFNO%20%3D%204%3B%0A%09%2F%2F%20Current%20Major%20Loop%20Count%0A%09IP_TCD-%26gt%3BCITER0.TCD0_CITER_ELINKNO%20%3D%201%3B%0A%09%2F%2F%20Beginning%20Major%20Loop%20Count%0A%09IP_TCD-%26gt%3BBITER0.TCD0_BITER_ELINKNO%20%3D%201%3B%0A%0A%09%2F%2F%20Interrupt%20after%20transfer%20is%20complete%0A%09IP_TCD-%26gt%3BTCD0_CSR%20%7C%3D%20DMA_TCD_TCD0_CSR_INTMAJOR_MASK%3B%0A%0A%09%2F%2F%20Enable%20interrupt%0A%09__NVIC_ClearPendingIRQ(DMATCD0_IRQn)%3B%0A%09__NVIC_SetPriority(DMATCD0_IRQn%2C%200)%3B%0A%09__NVIC_EnableIRQ(DMATCD0_IRQn)%3B%0A%0A%09%2F%2F%205.%20Enable%20any%20hardware%20service%20requests%20via%20the%20CHn_CSR%5BERQ%5D%20registers.%0A%09IP_TCD-%26gt%3BCH0_CSR%20%7C%3D%20DMA_TCD_CH0_CSR_ERQ_MASK%3B%0A%09%0A%7D%0A%0Avoid%20DMATCD0_Handler(void)%20%7B%0A%09%2F%2F%20Print%20rxBuffer%0A%09printf(%22rxBuffer%3A%20%25ld%22%2C%20rxBuffer)%3B%0A%09%2F%2F%20Clear%20interrupt%20request%0A%09IP_TCD-%26gt%3BCH0_INT%20%3D%201%3B%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2075088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2075088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F224178%22%20target%3D%22_blank%22%3E%40mateusz_swiszcz%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20offset%20of%20the%20registers%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_0-1744022054705.png%22%20style%3D%22width%3A%20492px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1744022054705.png%22%20style%3D%22width%3A%20492px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F331618i316B02EA895028A9%2Fimage-dimensions%2F492x204%3Fv%3Dv2%22%20width%3D%22492%22%20height%3D%22204%22%20role%3D%22button%22%20title%3D%22danielmartynek_0-1744022054705.png%22%20alt%3D%22danielmartynek_0-1744022054705.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_1-1744022091817.png%22%20style%3D%22width%3A%20492px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1744022091817.png%22%20style%3D%22width%3A%20492px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F331619i2480C0191840CA36%2Fimage-dimensions%2F492x123%3Fv%3Dv2%22%20width%3D%22492%22%20height%3D%22123%22%20role%3D%22button%22%20title%3D%22danielmartynek_1-1744022091817.png%22%20alt%3D%22danielmartynek_1-1744022091817.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2075064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2075064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhy%20does%20CHCFG%5B3%5D%20works%20and%20CHCFG%5B0%5D%20not%20when%20I'm%20using%20TCD0%20and%20Channel%200%20of%20DMA%3F%20How%20can%20i%20match%20numbers%20of%20CHCFG%5Bn%5D%2C%20TCDn%2C%20CHn%20in%20case%20of%20other%20instances%20of%20SPI%20or%20other%20peripheries%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2074177%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2074177%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThanks%20for%20the%20help%2C%20it%20works%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2072069%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2072069%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%26nbsp%3BMateusz%2C%3C%2FP%3E%0A%3CP%3EThanks%20for%20the%20project.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFirst%2C%20I%20enabled%20DMAMUX_0_CH0%20at%204028_0000h%20%2B%200x3.%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EIP_DMAMUX_0-%26gt%3BCHCFG%5B3%5D%20%3D%200xAE%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_0-1743512787294.png%22%20style%3D%22width%3A%20483px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1743512787294.png%22%20style%3D%22width%3A%20483px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F330806i6799A1E2B6DC28BA%2Fimage-dimensions%2F483x152%3Fv%3Dv2%22%20width%3D%22483%22%20height%3D%22152%22%20role%3D%22button%22%20title%3D%22danielmartynek_0-1743512787294.png%22%20alt%3D%22danielmartynek_0-1743512787294.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThen%20I%20saw%20that%20SBE%20%3D%201%20Source%20bus%20error%20in%20the%26nbsp%3BTCD0%20descriptor.%3C%2FP%3E%0A%3CP%3EThe%20TCD0_SADDR%20register%20was%20not%20configured%20(checked%20in%20the%20register%20view)%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EIP_TCD-%26gt%3BTCD0_SADDR%20%3D%20%26amp%3BIP_LPSPI_1-%26gt%3BRDR%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3ENow%2C%20it%20gets%20to%20the%20DMA%20handler%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_1-1743513063363.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1743513063363.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F330807iDF12EF10992C01EA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22danielmartynek_1-1743513063363.png%22%20alt%3D%22danielmartynek_1-1743513063363.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2071708%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2071708%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20whole%20projects%26nbsp%3B%3CSPAN%3Eis%20in%20the%20attachment.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2071226%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2071226%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F224178%22%20target%3D%22_blank%22%3E%40mateusz_swiszcz%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ECould%20you%20share%20the%20whole%20project%20so%20that%20I%20can%20test%20it%3F%3C%2FP%3E%0A%3CP%3EIt%20can%20be%20shared%20privately%20via%20a%20support%20ticket.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2070986%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2070986%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20disabled%20a%20source%20address%20offset%20but%20nothing%20changed.%20There's%20no%20error%20flags%20in%20EDMA.%20I%20have%20buffers%20in%20non-cacheable%20SRAM.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ENVIC-%26gt%3BISER%5B0%5D%20%3D%200x10%3B%20NVIC-%26gt%3BISER%5B5%5D%20%3D%200x40%3B%20NVIC-%26gt%3BICER%5B0%5D%20%3D%200x10%3B%20NVIC-%26gt%3BICER%5B5%5D%20%3D%200x40%3CBR%20%2F%3E%3CBR%20%2F%3EEDMA-%26gt%3BCSR%20%3D%200x300000%3CBR%20%2F%3E%3CBR%20%2F%3EOther%20register%20fields%20in%20EDMA%20and%20NVIC%20are%20null.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2070272%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K344%20bare-metal%20DMA%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2070272%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F224178%22%20target%3D%22_blank%22%3E%40mateusz_swiszcz%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EYou%20should%20not%20offset%20the%20source%20address%20(TCD0_SOFF)%2C%20but%20otherwise%20I%20don't%20see%20any%20issue%20in%20the%20code.%3C%2FP%3E%0A%3CP%3EIs%20there%20any%20error%20flag%20set%20in%20EDMA%3F%3C%2FP%3E%0A%3CP%3EDo%20you%20have%20the%20buffers%20in%20non-cacheable%20SRAM%3F%3C%2FP%3E%0A%3CP%3ECan%20you%20dump%20the%20EDMA%20and%20NVIC%20registers%20and%20share%20it%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThanks%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E