2021-04-08 12:08 PM
I am taking the values from adc1 and sending them via DMA1 to a memory location. I had followed a tutorial for the STM32F series, but I have also looked at the example code in the STMCube IDE. But it still does not work.
I got the ADC_DMA example to work and give me values. But I want to get it to work when I can configure the chip pins via the.IOC file.
I feel like setting up a project with the ability to set pins this way is better, but am I right?
On my Nucleo board, LD8 at the bottom of the board next to the label VBUS lights up when running the program. I can't find anything which tells me why this is. But could this be an indication of my problem?
I have attached some of my code, as hopefully, it may answer some questions. I can't attach it all as it is "too large."
Sorry if my post is confusing. Thank you in advance for any help.
#define ADC_CONVERTED_DATA_BUFFER_SIZE ((uint32_t) 32) /* Size of array aADCxConvertedData[] */
ALIGN_32BYTES (static uint16_t aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE]);
if (HAL_ADC_Start_DMA(&hadc1,
(uint32_t *)aADCxConvertedData,
ADC_CONVERTED_DATA_BUFFER_SIZE
) != HAL_OK)
{
Error_Handler();
}
2021-04-08 02:43 PM
What memory is it going into? What are MPU settings for that?
Cache coherency?
2021-04-09 01:46 AM
I Currently I have the D-Cache and I-Cache enabled.
When I add "aADCxConvertedData" to memory it seems the address is 0x20000100. This is SRAM
I'm a bit unsure where I should look for MPU setting and Cache coherency. Any link you suggest for me to look at?
Sorry for not being helpful
2021-04-09 05:12 AM
STM32H7 is one of the most complex MCUs out there and it's a very bad choice for beginners.
And D-cache is definitely not for beginners. Disable it until you learn how it works.
The related information can be found in AN4838 and AN4839.
2021-04-09 07:01 AM
@Piranha I have to use the STMH7 unfortunately for it's high sampling ADC. Thank you for those links I'll work my way through them.
Do I have to use D-cache for DMA ADC transfer?
Thanks again!
2021-04-09 07:50 AM
@Piranha (Community Member) I have to use the STMH7 unfortunately for it's high sampling ADC. Thank you for those links I'll work my way through them.
Do I have to use D-cache for DMA ADC transfer?
Thanks again!