After a suggestion from 0xc0170 from the mbed community, I changed in startup_MK64F12.s,
; <h> Flash nonvolatile option byte (FOPT)
; <i> Allows the user to customize the operation of the MCU at boot time.
; <o.0> LPBOOT
; <0=> Low-power boot
; <1=> normal boot
; <o.1> EZPORT_DIS
; <0=> EzPort operation is enabled
; <1=> EzPort operation is disabled
FOPT EQU 0xFF
for
; <h> Flash nonvolatile option byte (FOPT)
; <i> Allows the user to customize the operation of the MCU at boot time.
; <o.0> LPBOOT
; <0=> Low-power boot
; <1=> normal boot
; <o.1> EZPORT_DIS
; <0=> EzPort operation is disabled
; <1=> EzPort operation is enabled
FOPT EQU 0xFD
which fixes the problem. (The board now boots fine.)
I noticed that the EzPort state appears to be inverted in the original comments.
(according to K64 sub family reference manual)
Could someone from Freescale confirm this?