Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section .data' will not fit in region rom' #1968

Closed
lamnd09 opened this issue Dec 3, 2016 · 75 comments
Closed

section .data' will not fit in region rom' #1968

lamnd09 opened this issue Dec 3, 2016 · 75 comments

Comments

@lamnd09
Copy link

lamnd09 commented Dec 3, 2016

Hello,
I try to run an example (ipv6/rpl-tsch/) on COOJA, z1 and I got this error.
Even if I downloaded a new contiki Instant virtual machine, it is still error.

/usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: node.z1 section .data' will not fit in region rom'
/usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: region `rom' overflowed by 2 bytes

Thank you.

@lamnd09
Copy link
Author

lamnd09 commented Dec 3, 2016

I think there are some things wrong with RPL or TSCH, because I changed the new computer or contiki instant, but it is still same error.

@alignan
Copy link
Member

alignan commented Dec 3, 2016

I tested using msp430-gcc-4.7.2 as it is working OK, this is the same version the Travis tests use. You could either upgrade your toolchain version, or reduce some fat in the code.

@lamnd09
Copy link
Author

lamnd09 commented Dec 4, 2016

Thank you very much,
That's exactly what I need, it's working well now 👍

@lamnd09 lamnd09 closed this as completed Dec 4, 2016
@yadeleke
Copy link

Hi,

Could you please tell me the steps you took to solve this problem. Thanks

@alignan
Copy link
Member

alignan commented Feb 14, 2017

Have you at least tried the above steps? hard to know what you have tried already... open a new issue.

@yadeleke
Copy link

I have fixed it now. My issue was i didn't know how to upgrade toolchain.

@lamnd09
Copy link
Author

lamnd09 commented May 18, 2017

Hi,
This instruction work perfectly for me. Hope it's useful.
https://github.com/pksec/msp430-gcc-4.7.3

@rhr407
Copy link

rhr407 commented May 25, 2017

Hello there,
I am also working on z1 and came around with the 2 bytes error as mentioned by @lamnd09. I have figured out one mistake in sections/segments file memory.x found in /opt/mspgccx/msp430/lib/ldscripts/msp430f2617 folder. Just go to the following line

rom (rx) : ORIGIN = 0x3100, LENGTH = 0xcebe /* END=0xffc0, size 52926 */

and replace with

rom (rx) : ORIGIN = 0x3100, LENGTH = 0xcec0 /* END=0xffc0, size 52926 */

Cheers...

@atiselsts
Copy link
Contributor

Interesting catch. But I wonder if there's some specific reason for the length it to be exactly 52926 in the first place? I.e. this "fix" might actually break other things.

Besides, the 0xcebe length value remains even in msp430-4.7.3, and my impression was that this "overflow by 2" bug does not appear in that version.

@rhr407
Copy link

rhr407 commented Jun 1, 2017

For your first question, I would suggest referring to msp430 data sheet memory map section where there is a vectors section in the middle of rom section. The weird thing is that I have found not a single way to to let msp430-gcc automatically allocate the extra .text section to the far_rom which should be the logical choice for memory allocation after the rom section is depleted.
Unfortunately, I am facing this error till now even after doing the above mentioned modification. I am quite sure this is a bug even in 4.7.3 and it is indeterministic too. For example, many a times it runs with no error but sometimes it is hard to believe the same code compilation gives this very error. This bug needs to be removed in msp430-gcc next release.

@knaggita
Copy link

knaggita commented Jun 3, 2017

It has been puzzling me for a while now
Problems with -mcode-region=far on msp430x platform (Z1) https://sourceforge.net/p/contiki/mailman/message/32628670/

@mbaddeley
Copy link

Just to add a little bit to this, I tried the 'fix' @rhr407 suggested (editing memory.x) for the exp5438, however the values are all correct in that, so although that may have been a bug for the msp430f2617, it isn't for the msp430f5438, and the issue persists.

@vishal623
Copy link

Hello,

I followed instruction as per given by this link: https://github.com/pksec/msp430-gcc-4.7.3

After these steps when I checked my msp430-GCC version, it shows me 4.6.3 only.

My msp430 version is not updated. I want to simulate er-rest example on a Z1 platform.

Any solution???

@rhr407
Copy link

rhr407 commented Jul 23, 2018 via email

@rhr407
Copy link

rhr407 commented Jul 23, 2018 via email

@vishal623
Copy link

I already added that path in bashrc. This is the statement that I added.

export PATH=$PATH:/opt/compilers/mspgcc-4.7.3/bin

@vishal623
Copy link

Now, It shows me 4.7.3.

But when I run the simulation and try to burn the code on Z1 mote it shows me

msp430-gcc: Command not found.

@rhr407
Copy link

rhr407 commented Jul 23, 2018 via email

@rhr407
Copy link

rhr407 commented Jul 23, 2018 via email

@vishal623
Copy link

Ok.let me do it

@vishal623
Copy link

Sir, it is giving me the same error.

This is the path for msp430

/opt/compilers/mspgcc-4.7.3

Inside, there are 6 folders and one of them is msp430

I have added this path in /etc/environment

/opt/compilers/mspgcc-4.7.3/msp430/bin

and in bashrc

export PATH=$PATH:/opt/compilers/mspgcc-4.7.3/bin

@rhr407
Copy link

rhr407 commented Jul 23, 2018 via email

@vishal623
Copy link

vishal623 commented Jul 23, 2018 via email

@rhr407
Copy link

rhr407 commented Jul 23, 2018

Please do the same for .profile file and then log out and log in your PC again.

@greg-king5
Copy link

Don't put any PATH lines into ~/.bashrc! That file is for things that aren't exported. Put all PATH lines into ~/.profile (or ~/.bash_profile if it exists).

Also, I think that the names of the MSP430 tools changed. I don't remember the details; but, I think that the new names have the version number in them. You must edit "cpu/msp430/Makefile.msp430". Fix the spellings of the "msp430-*" tool-names.

@rhr407
Copy link

rhr407 commented Jul 24, 2018 via email

@vishal623
Copy link

vishal623 commented Jul 24, 2018 via email

@vishal623
Copy link

vishal623 commented Jul 24, 2018 via email

@vishal623
Copy link

vishal623 commented Jul 31, 2018 via email

@vishal623
Copy link

vishal623 commented Jul 31, 2018 via email

@rhr407
Copy link

rhr407 commented Jul 31, 2018 via email

@vishal623
Copy link

vishal623 commented Jul 31, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 1, 2018 via email

@rhr407
Copy link

rhr407 commented Aug 1, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 1, 2018 via email

@rhr407
Copy link

rhr407 commented Aug 1, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 1, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 1, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 1, 2018 via email

@rhr407
Copy link

rhr407 commented Aug 1, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 1, 2018 via email

@slj2606
Copy link

slj2606 commented Aug 9, 2018

Hi,

I am trying to simulate dtls using Wismote in Cooja, and it was working fine until yesterday. But yesterday I got the same error

"usr/local/bin/../lib/gcc/msp430/4.7.2/../../../../msp430/bin/ld: region `rom' overflowed by 2 bytes" error

Following this, I installed the newer version 4.7.3 following the instructions listed in the conversations above.

Now, when I am try to compile my code using Wismote, and I am getting this error:

make dtls-server.wismote TARGET=wismote
/opt/compilers/mspgcc-4.7.3/bin/msp430-gcc: 1: /opt/compilers/mspgcc-4.7.3/bin/msp430-gcc: Syntax error: word unexpected (expecting ")")
/opt/compilers/mspgcc-4.7.3/bin/msp430-gcc: 1: /opt/compilers/mspgcc-4.7.3/bin/msp430-gcc: Syntax error: word unexpected (expecting ")")
mkdir obj_wismote
CC ../../apps/dtls/dtls.c
/opt/compilers/mspgcc-4.7.3/bin/msp430-gcc: 1: /opt/compilers/mspgcc-4.7.3/bin/msp430-gcc: Syntax error: word unexpected (expecting ")")
../../Makefile.include:240: recipe for target 'obj_wismote/dtls.o' failed
make: *** [obj_wismote/dtls.o] Error 2
Process returned error code 2

I am not sure how to fix this, as the simulation was working fine before and now after installing a newer version, why is it throwing a syntax error.

Please advice.

@rhr407
Copy link

rhr407 commented Aug 9, 2018 via email

@vishal623
Copy link

vishal623 commented Aug 9, 2018 via email

@slj2606
Copy link

slj2606 commented Aug 9, 2018

Thanks a lot for the quick reply Mr. Rizwan.
The file I am trying to compile using Cooja is dtls-server.c and the file mentioned in the error is dtls.c
I have saved the content of both in a text file and attached the same here.
Please have a look.
Untitled Folder.zip

Thanks & Regards,
Lincy

@rhr407
Copy link

rhr407 commented Aug 14, 2018

@slj2606 : Which Contiki app you are using?

@rhr407
Copy link

rhr407 commented Aug 14, 2018

@slj2606 :Kindly send me the whole folder you are using to run the simulation from.

@vishal623
Copy link

vishal623 commented Aug 14, 2018 via email

@rhr407
Copy link

rhr407 commented Aug 14, 2018

@vishal623 Please check your skype

@slj2606
Copy link

slj2606 commented Aug 15, 2018

@rhr407 apologies for the late reply.
I am trying to simulate dtls protocol using wismote / Z1 (I see the same error when I try both)
test-dtls.zip
dtls.zip

Please find attached the folders as requested. The test-dtls is placed in the examples folder and dtls is placed in the app folder.
Also, if you would require more details you can directly send an email to slj1u17@soton.ac.uk as well

@rhr407
Copy link

rhr407 commented Aug 17, 2018

@slj2606 : Kindly send me the link for the whole Contiki folder as some files are missing. If possible push it on some repo so that I can pull it and check the code.

@slj2606
Copy link

slj2606 commented Aug 17, 2018

I have placed the folder in sharepoint and the link for the same is given below.

https://sotonac-my.sharepoint.com/:u:/r/personal/slj1u17_soton_ac_uk/Documents/contiki/contiki.zip?csf=1&e=DIm7RS

@rhr407
Copy link

rhr407 commented Aug 17, 2018 via email

@slj2606
Copy link

slj2606 commented Aug 17, 2018

I have shared it again with you in drive as requested. Please have a look.

@hieuttbk
Copy link

I have shared it again with you in drive as requested. Please have a look.

Did you fix it ?
I tried to repair code in makefile.msp430
ifeq ($(HOST_OS),Windows) to ifeq($(HOST_OS),Windows)
then, having lots of error refer <io.h> and more...

@tommasogiannoni
Copy link

It's problem about compilation.
I solved it like this:
on border-router.c location file from terminal
make clean
make all // this get me some error on linking file but it's ok
now you can recompile and now all going well:
make TARGET=z1

Try ;)

Gunzter pushed a commit to Gunzter/msp430-gcc-4.7.3 that referenced this issue Jun 11, 2020
…used for Z1 motes. Solved by Github user rhr407 in this issue: contiki-os/contiki#1968
alexrayne pushed a commit to alexrayne/contiki that referenced this issue Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests