Currently I have three boards where the flash fails verify. Though one board the RTC also fails. So will look at that one later. One had a ALT-RAM fault, luckily that turned out to be a solder whisker on the SRAM chip. There are two other boards with weird faults that need to look into yet as well..
One of the boards which failed was interesting, because the amount of failures was basically random (in the order of 40,000) every time. While the previous fix helped on some other boards, there seemed to be still a underlying cause somewhere.
I suspected the problem was data was not latched correctly before the bus cycle ended. So again I just got AI to check my code with that thought in mind.. And it actually found 2 more bugs

!

- Capture.PNG (127.28 KiB) Viewed 2212 times
So I had one bug where the latching of data wasn't working as expected. It was trying to latch data to late. Hence random faults. And another bug where I had a "inversion" on the WE line latch reset

AI gave me the code snippets to change, which saved me a bunch of typing as well !
TL;DR
Another odd write flash failure sorted !
Now on to diagnosing the other board failures...