STM32F103RG: does not flash above 512K

openocd 0.9.0, STM32F103RGT6

I discovered that code located above 512K does not flash, and no error shows. The flash simply remains unchanged. GDB will read flash up to the 1024K point. For the stm32F1x the driver is supposed to probe and determine the limits of the flash, so it suggests that it the cause of the limit. Any way to fix it?