2024-02-08 12:08 AM - edited 2024-02-08 01:07 AM
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
Solved! Go to Solution.
2024-02-09 09:05 AM - edited 2024-02-09 09:06 AM
@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.
2024-02-08 06:07 AM
Weird.
Can you show the definition of adc1ResultDMABuff?
What if you try "(uint32_t) adc1ResultDMABuff" instead?
2024-02-08 08:32 PM
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.
2024-02-09 06:43 AM
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.
2024-02-09 09:05 AM - edited 2024-02-09 09:06 AM
@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.