_start problem with KL05Z

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

_start problem with KL05Z

跳至解决方案
1,707 次查看
Ardoster
Contributor III

Hi

 

I'm starting up with the KL05Z and Kinetis Design Studio, but I'm having problems when my code arrives to _start. To put you in context, I've operated as follows:

 

1 - I've created a new Kinetis Design Studio: NEW_PROJECT -> KINETIS DESIGN STUDIO.

2 - Selected in the processor list the MKL05Z32xxx4

3 - I don't select the options Kinetis SDK (not available), neither the Processor Expert tick. I want a bare metal project.

4 - Click Finish

 

The generated project compiles correctly, but has the problem that when arrives to _start hangs. I've replaced the _start function by main, and now the application runs correctly, but I think there's a problem with static and global variables, because they are not being initialized. It must be a problem with startup files.

 

How can I fix it?

 

Thanks you in advance

 

Regards,

Eduardo

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,366 次查看
BlackNight
NXP Employee
NXP Employee

Hi Eduardo,

can you check you linker file, if you have this:

/* Entry Point */

ENTRY(Reset_Handler)

HEAP_SIZE  = DEFINED(__heap_size__)  ? __heap_size__  : 0x00000200;

STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x00000100;

/* Specify the memory areas */

MEMORY

{

  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000100

  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010

  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x00007BF0

  m_data                (RW)  : ORIGIN = 0x1FFFFC00, LENGTH = 0x00001000

}

Erich

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,367 次查看
BlackNight
NXP Employee
NXP Employee

Hi Eduardo,

can you check you linker file, if you have this:

/* Entry Point */

ENTRY(Reset_Handler)

HEAP_SIZE  = DEFINED(__heap_size__)  ? __heap_size__  : 0x00000200;

STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x00000100;

/* Specify the memory areas */

MEMORY

{

  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000100

  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010

  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x00007BF0

  m_data                (RW)  : ORIGIN = 0x1FFFFC00, LENGTH = 0x00001000

}

Erich

0 项奖励
回复
1,367 次查看
Ardoster
Contributor III

Hi

Thanks you!!!!! The problem was in the HEAP_SIZE. The generated linker file configured this value to 100, instead 200 as yours. Correcting this value, the _start function is called now correctly.

Thanks again!!!!

Regards,

Eduardo

0 项奖励
回复
1,367 次查看
BlackNight
NXP Employee
NXP Employee

You are welcome :-)

It is that problem that the GNU libraries in KDS require an excessive amount of heap memory. This problem does not exist for the ARM Embedded Lauchpad tools (that's why I'm using launchpad in many of my projects, see Switching ARM GNU Tool Chain and Libraries in Kinetis Design Studio | MCU on Eclipse).

Erich

0 项奖励
回复