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

Error: invalid register 'atomctl' for 'wsr' instruction in reset-vector.S #69

Open
sunilbage opened this issue Aug 8, 2020 · 10 comments

Comments

@sunilbage
Copy link

Getting an error while cross compling xtensa source xtos with crosstool-NG
reset-vector.S: Assembler messages:
reset-vector.S:291: Error: unknown opcode or format name 'wsr.atomctl'
Makefile.src:281: recipe for target 'reset-vector-unpack.o' failed
make: *** [reset-vector-unpack.o] Error 1
Host : 32 bit ubuntu 16.04 LTS
crosstool-NG : crosstool-NG 1.24.0

@jcmvbkbc
Copy link
Owner

jcmvbkbc commented Aug 8, 2020

Getting an error while cross compling xtensa source xtos with crosstool-NG

I don't think you can compile xtos with the crosstool-NG. Perhaps you're compiling xtos with the compiler that you've built with the crosstool-NG.

Error: unknown opcode or format name 'wsr.atomctl'

That means that xtensa configuration that you used to generate your compiler does not have atomctl register.
Either this is a wrong xtensa configuration, or xtos does not properly check for the presence of atomctl.

In any case I don't see how this may be a crosstool-NG issue.

@sunilbage
Copy link
Author

Yes you are right. I am compiling xtos with the compiler that you've built with the crosstool-NG. Xtensa overlay file which I am using for custom xtensa configuration is having atomctrl register.
I would like to know that if I have missed any configuration parameters while cross compiling the compiler to o support atomctrl register?.
Or how to enable atomctrl register support for the compiler while cross compiling it?
Please help me with this.

@jcmvbkbc
Copy link
Owner

jcmvbkbc commented Aug 9, 2020

Please help me with this.

Ok, please share your crosstool-NG .config that you used to build the compiler and your xtensa configuration overlay.

Or how to enable atomctrl register support for the compiler while cross compiling it?

You need to build binutils with the correct configuration overlay.

@sunilbage
Copy link
Author

I am attaching the crosstool-NG .config that you used to build the compiler for your reference. Pls let me me know what changes i have to do to build binutils with the correct configuration overlay.
crosstool-NG.config.zip

@jcmvbkbc
Copy link
Owner

jcmvbkbc commented Aug 9, 2020

Ok, please share your crosstool-NG .config that you used to build the compiler and your xtensa configuration overlay.

I am attaching the crosstool-NG .config that you used to build the compiler for your reference.

Please also share the configuration overlay, the file ${CT_TOP_DIR}/overlay/xtensa_lg_108_lx7_x.tar*

@sunilbage
Copy link
Author

Sir the overlay size is huge. around 1.9 GB. It is difficult for me to upload the huge file. Even after zipping the overlay file.
Can u suggest if any error exists with the crosstool-NG .config file which i uploaded earlier.

@jcmvbkbc
Copy link
Owner

jcmvbkbc commented Aug 9, 2020

the overlay size is huge. around 1.9 GB

This is hardly possible. Here's an example collection of overlay files, the biggest one is smaller than 1MB. The overlay file used by the ct-ng can be generated from the original overlay, normally installed into XtDevTools/install/builds/<xtensa-tools-release>/<core-name>/src/xtensa-config-overlay.tar.gz by this script.

And using wrong file for the overlay might explain the error that you see: if the correct files are not inside the overlay archive then overlay application step in the ct-ng would succeed, but the toolchain components would not be configured correctly.

@sunilbage
Copy link
Author

Ahhha. I got my mistake. I was giving the wrong overlay file. I missed the step you mentioned. I will try again by giving the correct overlay file and cross compile the compiler and binutils again and check.
If i still face the issue. I will attach the overlay file.
Thanks for the suggestion.

@sunilbage
Copy link
Author

sunilbage commented Aug 9, 2020

Still after using the correct overlay file i am getting the same above error.
xtensa-lg_108_lx7_x-elf-gcc -c -O2 -g -mlongcalls -Wall -Werror -I/home/sunil/XtDevTools/install/tools/RG-2019.12-win32/XtensaTools/xtensa-lg_108_lx7_x-elf/include -I/home/sunil/XtDevTools/install/builds/RG-2019.12-win32/lg_108_lx7_x/xtensa-lg_108_lx7_x-elf/arch/include -I/home/sunil/XtDevTools/install/builds/RG-2019.12-win32/lg_108_lx7_x/xtensa-lg_108_lx7_x-elf/include -mtext-section-literals -DXTOS_UNPACK -o reset-vector-unpack.o reset-vector.S
reset-vector.S: Assembler messages:
reset-vector.S:291: Error: unknown opcode or format name 'wsr.atomctl'
Makefile.src:281: recipe for target 'reset-vector-unpack.o' failed
make: *** [reset-vector-unpack.o] Error 1

I have attached the crosstool-ng config file as you have asked for. Please find rosstool-ng config
crosstool-NG.config.zip
attached.

@jcmvbkbc
Copy link
Owner

jcmvbkbc commented Aug 9, 2020

I've put your overlay into ${CT_TOP_DIR}/overlay/ and built the toolchain with ct-ng 1.24.0 using your original config file. It works for me:

$ cat <<EOF > test.S
>         .text
>         wsr     a2, atomctl
> EOF
$ /home/jcmvbkbc/x-tools/xtensa-lg_108_lx7_x-elf/bin/xtensa-lg_108_lx7_x-elf-gcc -c test.S 
$ /home/jcmvbkbc/x-tools/xtensa-lg_108_lx7_x-elf/bin/xtensa-lg_108_lx7_x-elf-objdump -d test.o 

test.o:     file format elf32-xtensa-le


Disassembly of section .text:

00000000 <.text>:
   0:   136320          wsr.atomctl     a2

Please make sure that you use the correct toolchain when building xtos?

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

2 participants