Bus Error when DMA tries to write to ADC0 register SC1

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

Bus Error when DMA tries to write to ADC0 register SC1

851 Views
isa_leo
Contributor I

Hi,

Some weeks ago I've implemented on a MK22DN512 a way to capture samples from different ADC channels doing PDB-ADC-DMA as explained in the app note "Using DMA to Emulate ADC Flexible Scan Mode on Kinetis K Series" and it is working very well.

Now I'm working on another project using the FRDM-MKE15 eval board instead and ported the code to capture samples on multiple ADC channels and it does not work. Right at the beginning, after DMA Ch1 transferred the first sample, DMA Ch0 attempts to modify ADC->SC1[0] to change the ADC channel but a Bus Error fault gets raised.

As a test, I've changed the destination address in the TCD to be some arbitrary local variable and I don't get a bus error and everything runs smoothly.

In the code, the destination gets initialize like so:

tcd.DADDR = (uint32_t)&(ADC_BASE->SC1[0]);

In MCUXpresso, I can see DADDR getting initialize to the correct value (0x4003B000) but for some reason write access from DMA to that register generates a Bus Error.

I'm a bit at lost about what is going on...

Compared to the MK22, does the MKE15 needs some special/extra configurations so the DMA engine can access peripherals ? Does not seem like it cause we can read the ADC_RA register from DMA ch1 with no issues.

Any thoughts ?

Thanks,

LM

0 Kudos
Reply
2 Replies

735 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @isa_leo,

First of all, I'd like to apologize for the late answer, but I hope this helps your project anyways. 

The DMA module from both boards are fundamentally different, from registers to even initialization. Could you please help me check you are correctly initializing both modules, comparing the SDKs available? Also, these examples could help you apply the DMA module to the ADC in case something is off or if any step is missing; ADC-DMA multi-channels trigger based on NXP MCUxpr... - NXP Community

Best regards, Julian

0 Kudos
Reply

800 Views
isa_leo
Contributor I

Nobody had this problem before ?

0 Kudos
Reply