ADC DMA Example doesn't work

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

ADC DMA Example doesn't work

1,996 Views
simon98
Contributor III

Hi,

 

i'm developing a project on S32K3X8EVB-Q289 using MBDT v1.5

 

i'm trying to implement ADC with DMA and after some effort i found this ticket online:

https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/DMA-enabling-in-MBDT/m-p/1819674

 

based on this i tried to implent all the instructions that @Irina_Costachescu gave.

 

The prolem comes up when i try to build... matlab give me this error:

simon98_0-1750087663761.png

 

I don't know how to solve this problem... could someone tell me how to fix that or if i'm missing something?

 

thanks

 

Simon

 

0 Kudos
Reply
3 Replies

1,287 Views
dragostoma
NXP Employee
NXP Employee

Hi, @simon98,

The latest NXP Model-Based Design Toolbox for S32K3 version 1.8.0 includes an updated model example that uses ADC and DMA: s32k344_pwm_adc_dma_s32ct in adc folder. You can use this model as a reference for your application.

 

Hope this helps,

Dragos

0 Kudos
Reply

357 Views
simon98
Contributor III

Hi @dragostoma,

I was only now able to test the ADC with DMA example from MBDT version 1.8.

At first, I encountered the same issue: the callback was executed, but in FreeMASTER I couldn’t see the value of the variable ADC_POT0 updating (the same behavior I had in version 1.6).

After several attempts, I tried adding the following MCL blocks to check whether the DMA was actually working correctly:

2.png

To investigate further, I opened the project with S32DS 3.6. While debugging, I can see that ADC_POT0 changes according to the potentiometer position even if the MCL blocks in Simulink are commented out. However, in FreeMASTER, ADC_POT0 does not update.

Therefore, I was wondering what causes this behavior and whether it is possible to fix FreeMASTER’s behavior in some way.

Attached you will find the project I used for these tests.

I look forward to your kind feedback.

Thank you,
Simon

0 Kudos
Reply

1,951 Views
simon98
Contributor III
I've made a little step forward importing the configuration from the example provided nut i'm stil stuck with this problem:

https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-DMA-Example-doesn-t-work-with-my-S3...
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2117066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EADC%20DMA%20Example%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2117066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei'm%20developing%20a%20project%20on%26nbsp%3BS32K3X8EVB-Q289%20using%20MBDT%20v1.5%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei'm%20trying%20to%20implement%20ADC%20with%20DMA%20and%20after%20some%20effort%20i%20found%20this%20ticket%20online%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FModel-Based-Design-Toolbox-MBDT%2FDMA-enabling-in-MBDT%2Fm-p%2F1819674%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FModel-Based-Design-Toolbox-MBDT%2FDMA-enabling-in-MBDT%2Fm-p%2F1819674%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ebased%20on%20this%20i%20tried%20to%20implent%20all%20the%20instructions%20that%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F100054%22%20target%3D%22_blank%22%3E%40Irina_Costachescu%3C%2FA%3E%26nbsp%3Bgave.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20prolem%20comes%20up%20when%20i%20try%20to%20build...%20matlab%20give%20me%20this%20error%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22simon98_0-1750087663761.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22simon98_0-1750087663761.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22simon98_0-1750087663761.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F343121iD565C64EB88618B5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22simon98_0-1750087663761.png%22%20alt%3D%22simon98_0-1750087663761.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20don't%20know%20how%20to%20solve%20this%20problem...%20could%20someone%20tell%20me%20how%20to%20fix%20that%20or%20if%20i'm%20missing%20something%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethanks%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESimon%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2267756%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20DMA%20Example%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267756%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%2F240160%22%20target%3D%22_blank%22%3E%40simon98%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThe%20latest%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Model-Based-Design-Tools%2FNXP-Model-Based-Design-Toolbox-for-S32K3-version-1-8-0-Product%2Fta-p%2F2261332%22%20target%3D%22_self%22%3ENXP%20Model-Based%20Design%20Toolbox%20for%20S32K3%20version%201.8.0%26nbsp%3B%3C%2FA%3Eincludes%20an%20updated%20model%20example%20that%20uses%20ADC%20and%20DMA%3A%26nbsp%3B%3CSTRONG%3Es32k344_pwm_adc_dma_s32ct%20%3C%2FSTRONG%3Ein%26nbsp%3B%3CSTRONG%3Eadc%3C%2FSTRONG%3E%20folder.%26nbsp%3BYou%20can%20use%20this%20model%20as%20a%20reference%20for%20your%20application.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHope%20this%20helps%2C%3C%2FP%3E%0A%3CP%3EDragos%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2124852%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20DMA%20Example%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2124852%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI've%20made%20a%20little%20step%20forward%20importing%20the%20configuration%20from%20the%20example%20provided%20nut%20i'm%20stil%20stuck%20with%20this%20problem%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FModel-Based-Design-Toolbox-MBDT%2FADC-DMA-Example-doesn-t-work-with-my-S32CT-Configuration%2Fm-p%2F2124851%23M10317%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FModel-Based-Design-Toolbox-MBDT%2FADC-DMA-Example-doesn-t-work-with-my-S32CT-Configuration%2Fm-p%2F2124851%23M10317%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2330792%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20DMA%20Example%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2330792%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%2F199423%22%20target%3D%22_blank%22%3E%40dragostoma%3C%2FA%3E%2C%3C%2FP%3E%3CDIV%3E%3CP%3EI%20was%20only%20now%20able%20to%20test%20the%20ADC%20with%20DMA%20example%20from%20MBDT%20version%201.8.%3C%2FP%3E%3CP%3EAt%20first%2C%20I%20encountered%20the%20same%20issue%3A%20the%20callback%20was%20executed%2C%20but%20in%20FreeMASTER%20I%20couldn%E2%80%99t%20see%20the%20value%20of%20the%20variable%20%3CSTRONG%3EADC_POT0%3C%2FSTRONG%3E%20updating%20(the%20same%20behavior%20I%20had%20in%20version%201.6).%3C%2FP%3E%3CP%3EAfter%20several%20attempts%2C%20I%20tried%20adding%20the%20following%20MCL%20blocks%20to%20check%20whether%20the%20DMA%20was%20actually%20working%20correctly%3A%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F378983iE2B272BDD2284365%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CP%3ETo%20investigate%20further%2C%20I%20opened%20the%20project%20with%20%3CSTRONG%3ES32DS%203.6%3C%2FSTRONG%3E.%20While%20debugging%2C%20I%20can%20see%20that%20%3CSTRONG%3EADC_POT0%3C%2FSTRONG%3E%20changes%20according%20to%20the%20potentiometer%20position%20even%20if%20the%20MCL%20blocks%20in%20Simulink%20are%20commented%20out.%20However%2C%20in%20FreeMASTER%2C%20%3CSTRONG%3EADC_POT0%3C%2FSTRONG%3E%20does%20not%20update.%3C%2FP%3E%3CP%3ETherefore%2C%20I%20was%20wondering%20what%20causes%20this%20behavior%20and%20whether%20it%20is%20possible%20to%20fix%20FreeMASTER%E2%80%99s%20behavior%20in%20some%20way.%3C%2FP%3E%3CP%3EAttached%20you%20will%20find%20the%20project%20I%20used%20for%20these%20tests.%3C%2FP%3E%3CP%3EI%20look%20forward%20to%20your%20kind%20feedback.%3C%2FP%3E%3CP%3EThank%20you%2C%3CBR%20%2F%3ESimon%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E