| GNURX Toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General Advanced Getting Started Building Toolchains Help Topics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. What is GNURX and what does it consist of? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. What platforms does GNURX work on? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. Which language standards are supported by gcc? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Advanced | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. What is the precaution that needs to be taken while using the C or Assembly routines with C++? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. How can I create a section which the linker will exclude in the output file? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. I have observed that the attribute 'interrupt' is treated as fast interrupt by default i.e., generates the instruction RTFI (Return From Fast Interrupt). How can I modify my code to generate the standard 'RTE' instruction (Return From Exception) for interrupt/exception? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q4. How do I use the built-in functions '__builtin_rx_mvfc' and '__builtin_rx_mvtc' to read and write values from different control registers? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q5. What are the known limitations and issues in the 'Library Generator' tool? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Getting Started | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. Are you providing any sample tutorials with the GNURX toolchain? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. What are the RX related switches of gcc in GNURX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. What libraries are provided with GNURX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q4. How do I link a library to my program? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Building Toolchains | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. How do I build a GNURX toolchain from the given source code? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. How do I install the GNURX toolchain on a GNU/Linux machine? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. How do I build GMP and MPFR libraries? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Help Topics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. Useful related Links | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. How do I get support for GNURX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. What is Activation Code and how do I get it? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. What is GNURX and what does it consist of? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The GNURX toolchain comprises of the following:
Binary Utilities:
Where * stands for elf. General Utilities:
For more information on Renesas RX micro-controllers, please visit http://www.renesas.com/fmwk.jsp?cnt=rx_family_landing.jsp&fp=/products/mpumcu/rx_family | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. What platforms does GNURX work on? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A2. Windows NT Windows 2000 Windows XP Windows Vista Red Hat GNU/Linux v8.0 or later (or compatible distribution) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. Which language standards are supported by gcc? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A3. You can refer http://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards for language standards supported by gcc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Advanced | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. What is the precaution that needs to be taken while using the C or Assembly routines with C++? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A1.The g++ compiler mangles the names of the routines. This may cause 'undefined reference' error for the C or assembly routines. To avoid this error the C or assembly routines should be wrapped in- extern "C" { ....... ...... } construct. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. How can I create a section which the linker will exclude in the output file? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A2. This can be achieved using the NOLOAD directive. The NOLOAD directive will mark the section as not loadable. Please refer http://sources.redhat.com/binutils/docs-2.12/ld.info/Output-Section-Type.html#Output http://sourceware.org/binutils/docs/ld/Output-Section-Type.html#index-NOLOAD-401 for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. I have observed that the attribute 'interrupt' is treated as fast interrupt by default i.e., generates the instruction RTFI (Return From Fast Interrupt). How can I modify my code to generate the standard 'RTE' instruction (Return From Exception) for interrupt/exception? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A3. Yes, that is right. Until Version 0901 the compiler was treating the interrupt as fast interrupt by default. However, fast interrupt processing of RX CPU can be set only for a single interrupt source. All interrupts cannot be fast interrupts. This means that at the moment multiple interrupts cannot be used with the 'interrupt' attribute. Standard interrupt processing should terminate using the standard 'RTE' instruction, Return From Exception. The attribute 'exception' can be used to generate the 'RTE' instruction for interrupts/exceptions. For the v0901 GNURX toolchain, the 'RTE' instruction can be generated by using the attribute 'exception' in the following manner, void foo(void) __attribute__((exception)); From Version 10.01 the attribute 'interrupt' is treated as a normal interrupt by compiler. The attribute 'fast_interrupt' is treated as a fast interrupt by the compiler. The fast interrupt processing of RX CPU can be set only for a single interrupt source. This means that at the moment multiple interrupts cannot be used with the 'fast_interrupt' attribute. Standard interrupt processing terminates using the standard 'RTE' instruction, Return From Exception. Fast interrupt processing terminates using the 'RTFI' instruction, Return From Fast Interrupt. The attribute 'interrupt' can be used to generate the 'RTE' instruction for interrupts/exceptions. The 'RTE' instruction can be generated by using the attribute 'interrupt' in the following manner, void foo(void) __attribute__((interrupt)); The attribute 'fast_interrupt' can be used to generate the 'RTFI' instruction for interrupts/exceptions. The 'RTFI' instruction can be generated by using the attribute 'fast_interrupt' in the following manner, void foo(void)__attribute__((fast_interrupt)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q4. How do I use the built-in functions '__builtin_rx_mvfc' and '__builtin_rx_mvtc' to read and write values from different control registers? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A4. The GNURX toolchain provides a built-in function 'int __builtin_rx_mvfc (int)' to read the value from different control registers. The prototype of this function is as below: int __builtin_rx_mvfc (int); Return value: integer : Control register value Argument: integer : Index of the control register to be read The GNURX toolchain provides a built-in function '__builtin_rx_mvtc (int reg, int val)' to write the value to different control registers. The prototype of this function is as below: void __builtin_rx_mvtc (int reg, int val); Return value: void Argument 1: int reg, Index to the control register to be written Argument 2: int val, value to be written to control register Mapping for index to control register is as follows: 0x0: "psw" 0x2: "usp" 0x3: "fpsw" 0x4: "cpen" 0x8: "bpsw" 0x9: "bpc" 0xA: "isp" 0xB: "fintv" 0xC: "intb" Example usage: 1. To read the value of "fpsw" register, use the function as below; int a = __builtin_rx_mvfc (3); 2. To read the value of "intb" register, use the function as below; int a = __builtin_rx_mvfc (12); 3. To write the value '5' to "fpsw" register, use the function below; __builtin_rx_mvtc (3, 5); 4. To write the value to '6' "intb" register, use the function as below; void __builtin_rx_mvtc (12, 6); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q5. What are the known limitations and issues in the 'Library Generator' tool? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A5. The known limitations and issues in the library generator tool are, 1. While building the Newlib library, many compiler warnings are generated by the 'libgen' tool. These warnings are displayed on 'stdout' while building the runtime libraries. These warnings are observed while building the pre-built libraries as well. 2. The Newlib libraries may not work or compile properly for all combinations of the compiler options. The pre-built Newlib libraries for GNUSH, GNUH8 and GNURX toolchains are compiled with '-Os', for GNUM16CM32C with '-O2' options. Passing any other optimization specific options may result in compiler errors or erroneous output. The user is advised to check the library for proper output values after rebuilding with other options. 3. Optimized Math library may give incorrect results if compiled with '-O1' or higher level of optimization option. The pre-built optimized C library is compiled with '-fno-builtin -c -Os -fomit-frame-pointer' compiler options. The pre-built optimized Math library is compiled with '-fno-builtin -c -fomit-frame-pointer' options. For the known issues and limitations in the 'Library Generator' phase in HEW, please refer to the following link, http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=003001&id=411&lang=en | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Getting Started | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. Are you providing any sample tutorials with the GNURX toolchain? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A1. Command line and HEW samples have been provided for the RX610 target. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. What are the RX related switches of gcc in GNURX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. What libraries are provided with GNURX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q4. How do I link a library to my program? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A4. 1. Set the LIB variable to the path where the library is present. 2. The first option to linker should be "-L" indicating path of the library. 3. Ensure that the end of linker options is -lgcc (for libgcc.a) -lc (for libc.a), -lgcc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Building Toolchains | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. How do I build a GNURX toolchain from the given source code? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A1. 1. To build GNURX toolchain from the given source code, download and save the BuildGNURX.tar.gz 2. Extract the files from BuildGNURX.tar.gz. 3. Follow the steps given in the Readme.txt 4. For v0901: The GMP and MPFR libraries are required while building the toolchains and building target applications for gcc-4.3.0 and above. The GNURX v0901 toolchain is built by statically linking the GMP and MPFR libraries. Please refer to FAQ3 to build GMP and MPFR. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. How do I install the GNURX toolchain on a GNU/Linux machine? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A2.There is an RPM provided for installing the GNURX toolchain on a Linux machine. An RPM is a specially formatted file which contains all binary files, documentation and configuration files. For each object file format one binary rpm or package file is provided. The binary rpm filename is prefixed with i386.rpm and is used to install the package on the GNU/ Linux machine. (NOTE: To install the rpm on your machine you should have root access to the rpm database.) To install the GNURX toolchain on a GNU/Linux using RPM type the following on terminal window: rpm -ivh e.g. rpm -ivh GNURX_v0901_ELF-1-1.i386.rpm This will install GNURX_v0901 ELF package if one is installing it for the first time. By default it installs it in /usr directory. To change the default directory use --prefix install mode option. To upgrade the package use the following command:+ The upgrade command can also be used even for the first install. To uninstall the package rpm -ev e.g. rpm -ev GNURX_v0901_ELF Where GNURX_v0901_ELF is the name of the package. To install or uninstall from X-Windows open the package from RPM-Manager and click on install or uninstall tab or click the rpm file in the file manager. For non-privileged users (i.e. other than root), you should have rights on the rpm database to install this rpm. The install and upgrade options to use are same as mentioned for privileged users. For more information refer man page of rpm or visit http://www.rpm.org/max-rpm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. How do I build GMP and MPFR libraries? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A3. The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers. The GMP (version 4.1 or later) and MPFR (version 2.3.0 or later) libraries are required while building the toolchains and building target applications for GCC (version 4.3.0 or later). Execute the following steps to build GMP for Linux toolchain: 1. Create three directories, gmp_source, gmp_linux_build and gmp_linux_prefix in the home directory. 2. Copy the GMP source in the 'gmp_source' directory. You can download the GMP source from the following link, http://gmplib.org/#DOWNLOAD 3. Change the current directory to 'gmp_linux_build' directory. 4. Execute the following commands, i. /home/gmp_source/configure --disable-shared --prefix=/home/gmp_linux_prefix ii. make iii. make check iv. make install This will install GMP libraries in '/home/gmp_linux_prefix' directory. Execute the following steps to build GMP for MinGW toolchain: 1. Create three directories, gmp_source, gmp_mingw_build and gmp_mingw_prefix in the home directory. 2. Copy the GMP source in the 'gmp_source' directory. You can download the GMP source from the following link, http://gmplib.org/#DOWNLOAD 3. Change the current directory to 'gmp_mingw_build' directory. 4. Execute the following commands, i. Export the path of the native MinGW toolchain. export PATH=/home/kpit/mingw_3.4.5/prefix/bin:$PATH where mingw_3.4.5 is the native MinGW toolchain. Therefore the native MinGW toolchain need to be built prior to building the GMP and MPFR libraries for MinGW toolchain. You may refer to the following FAQ link for building the native MinGW toolchain, FAQ1 This link provides the build script for building Linux and MinGW toolchains. Please refer to the section with the comment "Mingw Native compiler build" in the build script for building the native MinGW toolchain. ii./home/gmp_source/configure --disable-shared --host=i386-pc-mingw32msvc --prefix=/home/gmp_mingw_prefix iii. make iv. make check v. make install This will install GMP libraries in '/home/gmp_mingw_prefix' directory. Execute the following steps to build MPFR for Linux toolchain: 1. Create three directories, mpfr_source, mpfr_linux_build and mpfr_linux_prefix in the home directory. 2. Copy the MPFR source in the 'mpfr_source' directory. You can download the MPFR source from the following link, http://www.mpfr.org/mpfr-current/#download 3. Change the current directory to 'mpfr_linux_build' directory. 4. Execute the following commands, i. /home/mpfr_source/configure --disable-shared --with-gmp=/home/gmp_linux_prefix --prefix=/home/mpfr_linux_prefix ii. make iii. make check iv. make install This will install MPFR libraries in '/home/mpfr_linux_prefix' directory. Execute the following steps to build MPFR for MinGW toolchain: 1. Create three directories, mpfr_source, mpfr_mingw_build and mpfr_mingw_prefix in the home directory. 2. Copy the MPFR source in the 'mpfr_source' directory. You can download the MPFR source from the following link, http://www.mpfr.org/mpfr-current/#download 3. Change the current directory to 'mpfr_mingw_build' directory. 4. Execute the following commands, i. Export the path of the native MinGW toolchain. export PATH=/home/kpit/mingw_3.4.5/prefix/bin:$PATH where mingw_3.4.5 is the native MinGW toolchain. Therefore the native MinGW toolchain need to be built prior to building the GMP and MPFR libraries for MinGW toolchain. You may refer to the following FAQ link for building the native MinGW toolchain, FAQ1 This link provides the build script for building Linux and MinGW toolchains. Please refer to the section with the comment "Mingw Native compiler build" in the build script for building the native MinGW toolchain. ii. /home/mpfr_source/configure --disable-shared --with-gmp=/home/gmp_mingw_prefix --host=i386-pc-mingw32msvc --prefix=/home/mpfr_mingw_prefix iii. make iv. make check v. make install This will install MPFR libraries in '/home/mpfr_mingw_prefix' directory. Note: a. To build Linux toolchain, you need to build the MPFR/GMP libraries only for Linux toolchain. b. To build MinGW toolchain, you need to build MPFR/GMP libraries for both Linux and MinGW toolchains. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Help Topics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q1. Useful related Links | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A1. http://www.eu.renesas.com/ http://www.renesas.com/ http://www.renesas.com/fmwk.jsp?cnt=rx_family_landing.jsp&fp=/products/mpumcu/rx_family http://docs.freebsd.org/info/gcc/gcc.info.Environment_Variables.html - environments variables used by GCC. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q2. How do I get support for GNURX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A2.For any problem during installation or usage of toolchain please register and logon at http://www.kpitgnutools.com | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q3. What is Activation Code and how do I get it? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A3. KPIT GNU tools are free to download and use, with worldwide technical support provided free of charge. In order to allow unrestricted distribution of these tools, the windows installers require that the user enter a unique code to proceed with the installation. This is the Activation Code which is provided only to the registered users. An already registered user, can find this activation code on our website www.kpitgnutools.com at "Manage Account -> My Account -> Profile", from the main menu. (http://www.kpitgnutools.com/updateCustomers.php ) If not registered, the user can register online at www.kpitgnutools.com. (http://www.kpitgnutools.com/signUp.php ) Registration is free, quick and easy and is only required once. Your details are securely stored by us and will never be sold or given away. |