I am moving from a simple project on the KL05 Freedom board to my own target. If I start with an absolute bare bones PE project with just a "while(1)" for the main, It locks up in PE_DEBUGHALT() long before I ever get to the main routine.
What I found is that the RAM zero routine "zero_fill_bss()" in startup.c seems to be trying to write to RAM starting at the wrong address. __START_BSS which comes from the PE init file seems to point to the start of RAM at 0x1FFFFE00 which for this part seems wrong. The very first write to this address in zero_fill_bss() causes the DEBUGHALT.
I'm not sure I can patch the PE init file (ProcessorExpert.ld). The problem seems to be right at the top of this file in the MEMORY section under "m_data" where it defines the start of RAM and size.
The reference manual seems to imply for this 1K RAM part, the start should be at 0x1FFFFF00, and end at 0x200002FF with 1/4 - 3/4 split.
And yes, I am using the latest KDS version 1.1.0