2018-06-21 02:37 AM
2018-06-21 04:31 AM
Sounds like a cache coherency issue.
2018-06-21 06:55 AM
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.
2018-06-21 07:49 AM
>>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?
2018-06-21 07:58 AM
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);}2018-06-26 06:26 AM
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