Hi,
Device still locked even after unlock command.
I do not think so...
If a Kinetis device is locked / secured we can NOT connect to it and so we can NOT read/write memory.
(Otherwise the security would be useless...)
The w4 command performs a simple write to memory. As long as no device has been explicitly selected
by the "exec device = ..." command, the memory that is written by the w4 command is assumed to be RAM.
I am a bit confused what is the problem right now...
In the title of the thread you initially asked about the TRST signal.
Then in your first post you wrote that flash programming via GDBServer does not work.
Now you write that everything basically seems to work but flash programming via J-Link Commander does not and that your device is possibly locked (which can not be the case since then basic operations would also NOT work).
Did you have a look in UM08001, chapter "Flash download", section "Setup for various debuggers (internal flash)"?
There are some steps required to enable programming of the internal flash of a device.
Best regards
Alex