Startup Code Crashes on K64F in KDS 3.1

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Startup Code Crashes on K64F in KDS 3.1

跳至解决方案
581 次查看
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.

标签 (1)
0 项奖励
回复
1 解答
468 次查看
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 项奖励
回复
2 回复数
468 次查看
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 项奖励
回复
469 次查看
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 项奖励
回复