Linking Builtin/ROM code in KEAZ64xxx4

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

Linking Builtin/ROM code in KEAZ64xxx4

Jump to solution
1,531 Views
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)

Labels (1)
0 Kudos
Reply
1 Solution
1,508 Views
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";

View solution in original post

0 Kudos
Reply
1 Reply
1,509 Views
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 Kudos
Reply