With Kinetis L, is it possible to designate a few bytes of flash (to store a firmware version) that can be read through the SWD interface even after flash access has been secured?
You can use a few bytes of flash to do this, but you should take a look on the reference manual of your specific device on the security chapter to verify which registers could be read when memory has been secured.