Linking Builtin/ROM code in KEAZ64xxx4

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

Linking Builtin/ROM code in KEAZ64xxx4

跳至解决方案
1,525 次查看
mfarv
Contributor I

I have a bare metal application that crashes whenever strlen is called.  The same code that previously leveraged PE does not. 

As I understand it this function may exist in ROM on the part, instead of having to be compiled into the flash image.  Is this correct, and if so how do I tell the linker that fact since the default linker file does not appear to include it?  (Modified bare metal linker script is attached)

标签 (1)
0 项奖励
回复
1 解答
1,502 次查看
mfarv
Contributor I

The issue was not related to the linker at all.  Another author had declared a string like this:

static const uint8_t *Carriage = "\r\n";

When strlen(Carriage) was run against this, it crashed.

When the declaration was rewritten, it works.

static const uint8_t Carriage[] = "\r\n";

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,503 次查看
mfarv
Contributor I

The issue was not related to the linker at all.  Another author had declared a string like this:

static const uint8_t *Carriage = "\r\n";

When strlen(Carriage) was run against this, it crashed.

When the declaration was rewritten, it works.

static const uint8_t Carriage[] = "\r\n";

0 项奖励
回复