Hi,
The safe way is modify your linker script and add section in RAM for your variable(s). If you have more vars - just put them in a struct - if you don't like to have section for each var.
m_myram (RW) : ORIGIN = 0x20000000, LENGTH = 0x00000010
SECTIONS
{
.my_ram_space (NOLOAD):
{
*(.my_ram_space)
} > m_myram
Variable def:
__attribute__ ((section(".my_ram_space"))) int my_abs_var;
There is example - https://community.nxp.com/docs/DOC-335619 which uses DFLASH for data - the same principle you can use for store data in regular flash area (just use your address 0x20400).
Jiri