Startup Code Crashes on K64F in KDS 3.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Startup Code Crashes on K64F in KDS 3.1

Jump to solution
711 Views
jerrygardner
Contributor III

I've built a project for the K64F on the Freedom board using KDS 3.1. I created the project using File->New->Kinetis SDK 1.x Project.

 

At first my project was simple with just enough code to blink an LED to verify the project build process and that the board worked. The project built fine and ran fine on the board.

 

Next I added about 25 new C files to the project. The project still builds fine, but when I download it to the board and run it, it causes a reset before it even gets to my main() routine. The startup code (in startup_MK64F12.S) calls a routine called __START ("bl    __START"), which maps to a symbol called _start, which is defined in crt0.o. It's while running this code in crt0.o that the reset occurs. I haven't single-stepped the code in crt0.o yet to find exactly where this occurs. Does anyone know why this might be happening?  If I comment out the call to _start, the reset doesn't occur and my main() routine gets entered as expected. My code runs fine, except that all uninitialized data in the BSS do not get zeroed.

 

BTW, I didn't modify the startup files in any way. All I did was to add several of my own C files to the project.

Labels (1)
0 Kudos
Reply
1 Solution
598 Views
jerrygardner
Contributor III

Alice,

I found and fixed the problem. In addition to the C files that I added to my project, I also had an assembly file. This assembly file was mistakenly putting its assembled code in the .init section rather than the .text section. When I fixed this the problem went away.

View solution in original post

0 Kudos
Reply
2 Replies
598 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jerry,

Please send your project to me , i will check and test it on my side .

BR

Alice

0 Kudos
Reply
599 Views
jerrygardner
Contributor III

Alice,

I found and fixed the problem. In addition to the C files that I added to my project, I also had an assembly file. This assembly file was mistakenly putting its assembled code in the .init section rather than the .text section. When I fixed this the problem went away.

0 Kudos
Reply