When using J-link to load and run a led example some initialization (init script, say for memory) is provided. Looks like such initialization is not implemented in Your code. Please try to add it.
Have a great day, Yuri
----------------------------------------------------------------------------------------------------------------------- Note: If this post answers your question, please click the Correct Answer button. Thank you! -----------------------------------------------------------------------------------------------------------------------