Hi Tom,
thank you for answering. I have read all these chapters very thoroughly, but still could not make changes in this memory space. But today after hours of trying I found a way to do that. First of all there is an application note (as you mentioned) that describes this a bit. It is AN3305 and discusses "On-Chip System Protection Basics for HCS08 Microcontrollers". Because Coldfire V1 is based on S08 (as far as I know) then this app note should be quite helpful. There is one paragraph there:
A user program cannot set or clear the FPROT register. Instead, after an exit from reset, FPROT is loaded
with the contents of the NVPROT location, which is in the nonvolatile register block of the flash memory
and cannot be altered by application software. The EPS and FPS bits can be set in the NVPROT location
during programming to enable block protection. The only other way FPROT can be written is through
background debug commands, which provide a way to erase and reprogram protected memory.
I have also seen in the links that you have provided that these TRIM configurations needed to be set with Background Debug Commands. Here this was also mentioned.
So what I did was to make a complete erase of the memory. 0x40A was 0xFF.
Then I flashed the program that I have compiled. 0x40A was still 0xFF although the entry in the S19 file S3060000040A00EB was present.
Then I made another S19 file with these 3 lines:
S0030000FC
S3060000040A00EB
S705000010EA00
Then I made a target task in CW with 2 actions: program and verify. In the program action I load this S19 file and run the task. Afterwards the only change in the memory is that 0x40A is set to 0x00 instead of 0xFF. Then my program runs as expected in user mode and not in bootloader mode (as it did before).
Not sure if this is the proper way of doing this, but for now it is a workaround.