2019-12-04 06:04 AM
2019-12-04 06:21 AM
Check MPU and cache/write thru settings, and make sure to flush the write buffers with a fencing instruction. Think _DSB and DFlash Clean.
2019-12-04 08:40 AM
I have this working just fine without any DSB instructions, just defining the variable as volatile which forces the compiler to reload it at every access.
2019-12-04 08:50 AM
Across two cores, with deferred write buffers, pretty sure you're going to need to get more involved than telling the compiler it's volatile...
2019-12-04 08:57 AM
I’m reporting my experience. Gnu compiler. Im not guessing at the underlying architecture or what theoretically should/could work.
On this chip, does each core have a deferred write buffer?
2019-12-04 09:22 AM
They are both independent cores, so definitely more of a situation where things can happen concurrently. Some of the memory is also dual-ported, so perhaps some race hazards to contend with there also.
ST has provided the HSEM to manage inter-core communication/signalling.
In single core multi-threaded the CPU is one unit and provides both a more unified view of memory, and protection against some hazards, along with the sequential granularity stopping some things from "occurring at the same instant" . In multi-core there's a lot more happening, and more balls in the air.
2019-12-05 05:59 AM
By defining as volatile, I got little success. But got satisfactory result after disable of Icache and dcache in M7 i.e. comment out SCB_EnableICache and SCB_EnableDCache functions in main file.
Thank you all.