This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NV_RESTORE causes linker Error[e16]

Other Parts Discussed in Thread: CC2538

Hi, 

I am using the ZStack 2.5.1a, and have edited and added to esp.c to suit our needs. Everything works fine until I enable NV_RESTORE: it gives me this error: 

Error[e16]: Segment ZIGNV_ADDRESS_SPACE (size: 0x3000 align: 0) is too long for segment definition. At least 0xfd3 more bytes needed. The problem occurred while processing the segment placement command
"-Z(CODE)ZIGNV_ADDRESS_SPACE=_ZIGNV_ADDRESS_SPACE_START-_ZIGNV_ADDRESS_SPACE_END", where at the moment of placement the available memory ranges were "CODE:7d7d3-7f7ff"
Reserved ranges relevant to this placement:
CODE:7c714-7d7d2 BANKED_CODE
CODE:7d7d3-7f7ff ZIGNV_ADDRESS_SPACE
BIT:0-7 BREG
BIT:80-87 SFR_AN
BIT:90-97 SFR_AN
BIT:a0-af SFR_AN
BIT:b8-c7 SFR_AN
BIT:e8-ef SFR_AN
BIT:f8-ff SFR_AN
Error while running Linker

Total number of errors: 1
Total number of warnings: 0

I have tried loading the original unedited esp.c and enabling NV_RESTORE and it works just fine, so I know that the problem is with my code somewhere, but I don't see the relation between the NV memory and address space defining, given that none of my code changes deal with the NV memory. 

I will appreciate any help that I can get as I have much to learn about ZStack. Thanks for your time

  • I know its been more than two years ago since this was written, but I've since discovered this post and also I now know what the problem was, so I thought I'd write it here in case someone else is having similar problems!

    I had declared too many extra variables, and so the linker could therefore not find enough space for the extra variables that were added when NV_RESTORE was enabled.  This problem could have been overcome by reducing the Heap memory setting in “OnBoard.h” (CC2538), or by declaring some of the extra variables in a different memory region, like the non-retention region (CC2538) and worked around the consequent limitations for that region.