cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 dual ADC w DMA

Handzic.Dirk
Associate III
Posted on June 21, 2018 at 11:37

The original post was too long to process during our migration. Please click on the attachment to read the original post.
5 REPLIES 5
Posted on June 21, 2018 at 13:31

Sounds like a cache coherency issue.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 21, 2018 at 13:55

That is why I added

SCB_InvalidateDCache_by_Addr((uint32_t *) &sample_buffer[0], 4*P_SAMPLES);

to the transfer complete handling. Is there any better way? Initially I had a call to SCB_InvalidateDCache_by_Addr() at half complete transfer as well but due to the high sample rate I had to remove it.

Posted on June 21, 2018 at 14:49

>>Is there any better way?

Use an uncached/unbuffered memory region?

Change the MPU configuration for the region you are using, and expect to act on externally?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 21, 2018 at 14:58

Try this

void MPU_Config(void)

{

  MPU_Region_InitTypeDef MPU_InitStruct;

  /* Disable the MPU */

  HAL_MPU_Disable();

  MPU_InitStruct.Enable           = MPU_REGION_ENABLE;

  MPU_InitStruct.BaseAddress      = 0x30000000;

  MPU_InitStruct.Size             = MPU_REGION_SIZE_128KB;

  MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

  MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;

  MPU_InitStruct.IsCacheable      = MPU_ACCESS_NOT_CACHEABLE;

  MPU_InitStruct.IsShareable      = MPU_ACCESS_NOT_SHAREABLE;

  MPU_InitStruct.Number           = MPU_REGION_NUMBER0;

  MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;

  MPU_InitStruct.SubRegionDisable = 0x00;

  MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_ENABLE;

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

  /* Enable the MPU */

  HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 26, 2018 at 13:26

Thank you Clive,

it seems that your suggested solution works. Since the problem only occured some times I tested your solution for a couple of days.

Best regards

Dirk