Brian Kelly

kl25z startup issue on Linux

Discussion created by Brian Kelly on Nov 5, 2017
Latest reply on Nov 13, 2017 by Jorge Antonio Alcala Vazquez

Hi, 

I am developing a test software to test the interface with UART0 on the KL25Z board on the Linux Ubuntu 17.04 platform using the openOCD debug interface. I have been developing a data processing module using the circular buffer method and then transmit the data from the buffer to the KL25Z board via the UART0 interface. While testing the software on the openOCD interface using the gdb, I have found that the execution process did not go all the way to main() function call. I already set up a temporary breakpoint on gdb to get the execution to stop at main(). 

It seems like everytime I try to execute the .elf executable file on the KL25Z board, it initally makes the call to startup_MKL25Z4.S file. It stops at line 118 Reset_Handler: cpsid i (Mask Interrupts). It seems like it stays stuck there and keep looping in there. It never got past that point. It never got to the main() function call for our software code to start to execute. So, I would need your help on how to get the .elf file to boot up and start to execute from the main() function call. 

How do I get the software to move past "cpsid i" under Reset_Handler? What is the best way to load up the startup_MKL25Z4.S code on the KL25Z using GDB/openOCD debugger set up on the Linux platform? I want to see this software to execute well on the KL25Z from the linux command lines. 

Please help! Thank you so much for your help! By the way, I have attached my screenshots of what I have done so far. 

Brian Kelly 

Attached: 
openocdGDB_startup.jpg - this is the GDB process of loading and starting up the .elf file on the KL25Z board 
openocdGDB_running.png- This is what happens after I type "continue" on GDB. It just stays stuck on Line 118 cpsid i. It just keeps looping in there and never really mvoe past that line. 
openocdGDB_ctrl-c_interrupt.jpg - this is what happens after I type "ctrl-c" to stop the exection on gdb and it called to USB0_IRQinterrupt. when I typed continue, it stays there and never went back to the start. 
gdb_script.png - this is the gdb script that I have used to load the file on the board and then run it. 

startup_MKL25Z4.S info: 
file: startup_MKL25Z4.S 
purpose: CMSIS Cortex-M0P Core Device Startup File 
version: 2.5 
date: 2015-2-19 
build: b150220

Outcomes