Hello I am developing with kl04 but when do I debug with usb universal multilink, the device connects but immediately generates an interrupt that invokes "PE_ISR (Cpu_ivINT_Hard_Fault)"
It 'a test firmware where I implement only the CPU model with Processor Expert.
How can I fix?
thanks
Hi Vincenzo,
which KL04 exactly? And are you using Kinetis Design Studio V1.1.1?
I think the problem could be your startup code. Below is my KL04Z32 linker file:
/* Generate a link error if heap and stack don't fit into RAM */
__heap_size = 0x0400; /* required amount of heap */
__stack_size = 0x0100; /* required amount of stack */
MEMORY {
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x00007BF0
m_data (RW) : ORIGIN = 0x1FFFFC00, LENGTH = 0x00001000
m_cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
}
Increase the heap size to see if this helps. I think the problem on your side is that the ANSI library code crashes because the library in KDS uses too much heap space.
Otherwise, I have a Processor Expert component which helps to identify the hard fault, see:
A Processor Expert Component to Help with Hard Faults | MCU on Eclipse
The component is available from SourceForge (see McuOnEclipse Releases on SourceForge | MCU on Eclipse)
I hope this helps,
Erich
Thanks for the reply.
Use MKL048VFK4 SQN with Kinetis Design Studio V1.1.1
Until now I have developed with the FRDM-KL05Z and now I have to go on my microcontroller that is the MKL048VFK4 SQN.
Having done the test with Processor Expert thought I did not have these types of problems.
Vincenzo,
I think that there is a a possible problem in the generation of the processorexpert.ld file for KL04Z8 in KDS 1.1.1 :
the data lenght is 0x00000500 I shoud expect 0x00000400.
m_data (RW) : ORIGIN = 0x1FFFFE00, LENGTH = 0x00000500
In the startup.c there is the zero_fill_bss function and exceding the 1K hw limit you had the hardfault.
Change the processorexpert.ld line and you should solve your issue.
Ciao Emilio.
Dear Vincenzo,
If you are using pe pay attention that the ld file is automatically generated by pe if the flag is enabled.
In CPU component inspector check build option and modify there in case you have the flag set.
Regards,
Emilio.