How to store a const string at a memory location in Microcontroller?
You can only use that method to write to an area to you actually can write to. Since all you're doing it writing value to the address given in port.
In order to store a string at a specified location you will have to instruct the linker.


In any case, it usually starts with an const char *version = "V1.2AG4ML" in a separate object (file), that you will put in a region manually via the linker script.

How this is done depends on the toolchain you are using, the manual should provide the info you need.