Skip to main content
Visitor II
February 8, 2024
Solved

NUCLEO-F429 ADC DMA

  • February 8, 2024
  • 4 replies
  • 1505 views

Hi,

I am currently using NUCLEO-F429 for prototyping a medical product.

I am facing an issue while configuring ADC DMA as shown in attached image.

the address of DMABuff going in DMA register is different to the actual adress, hence i am not able to get proper data read out.

The values in DMAbuff are not updates as expected.

But if I hardcode the address the values are updated in DMAbuff

    This topic has been closed for replies.
    Best answer by Pavel A.

    @Manas_Gupta Your buffer is declared as a static variable in .h file. Every .c file that includes the .h file gets its private copy of this buffer. Diagnosis: deficient C knowledge. Prescription: urgent intensive C course, 40 hours at least. Regular code reviews.

     

    4 replies

    Super User
    February 8, 2024

    Weird.

    Can you show the definition of adc1ResultDMABuff?

    What if you try "(uint32_t) adc1ResultDMABuff" instead?

    Visitor II
    February 9, 2024

    Hi,

    DMAbuff is defined in header file  as:

    #ifndef __ULADC_H__
    #define __ULADC_H__
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #include "ULConfig.h"
    #include "adc.h"
    
    
    /*		ADC1		*/
    static volatile uint16_t adc1ResultDMABuff[ADC1_TOTAL_COUNT_IN];
    
    void ULAdc1Init();
    void ULAdc1StartConv();
    
    
    /*		ADC3		*/
    static volatile uint16_t adc3ResultDMABuff[ADC3_TOTAL_COUNT_IN];
    
    void ULAdc3Init();
    void ULAdc3StartConv();
    
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif /* __ULADC_H__ */

    Also I have already tried "(uint32_t) adc1ResultDMABuff"  with same result.

    Super User
    February 9, 2024

    Got me.

    The compiler is usually not a problem but it's hard to see how it could be something else here. Might be worth pinging Keil for support.

    Pavel A.Answer
    Super User
    February 9, 2024

    @Manas_Gupta Your buffer is declared as a static variable in .h file. Every .c file that includes the .h file gets its private copy of this buffer. Diagnosis: deficient C knowledge. Prescription: urgent intensive C course, 40 hours at least. Regular code reviews.