Renesas CCRX Cmake - Unresolved symbol __INITSCT

Hi Everyone.

I am following this guide:   to set up a very basic CCRX executable project in e2 Studio

The make files are built without error, but I face the following error when I type "make all": 

E0562310:Undefined external symbol "__INITSCT" referenced in "CMakeFiles\CCRX_Project.dir\resetprg.c.obj"

Suprisigly, I didn't receive any error while compiling this with IDE, I immediately thought to replicate all the compiler and linker options from IDE into the CmakeLists.txt. None of was much use.

I have spent 2 days on this issue, the file is located in the CCrx\include folder in program files. It is also included in the CmakeLists.txt command. 

The __InitSCT function is declared in _h_c_lib.h. I searched my whole computer but couldnt find the function body / definition. I couldnt find any source file either that uses this function, just the start up.

The function copes data section from ROM to RAM on start up. If any path is hidden in the IDE, please tell me as I am stuck with this for days.

I would also suggest that you update your documentation 

  • From the header file that you mentioned:

    _h_c_lib.h:extern void _INITSCT(void);   /* Clear BSS, and copy DATA from ROM to RAM */

    This seems to be a simple enough function.  I can load a pre-built ELF executable from a sample app-note and see the assembly code for it:

    The ELF file doesn't have much information about this symbol:

    I find the symbol in the RX library (CC-RX\lib\rx600xx.lib), and it is also in the "bin\libsrc_C89.pak" file, which 7zip does not seem able to view (must be a proprietary file format).  I would have to assume that your link command already includes this lib, so I don't know why it would not be found when you try to build.  If you can build and create a detailed map-file you should be able to confirm this symbol is defined in this lib rather than simply referenced.

    Don't you just luv it when the IDE hides details like this?  Just push the build button, you don't need to know anything about how it actually works.

  • Hi JB

    Thanks a lot for such a detailed response. It's so strange a hardware start up function's symbol would reside in C89 std library

    I also have some findings. The CCRX library generator utility is creating a .lib file with the project's name. It was using the C89 file. It's really strange

    I tried to do the same with CMake using -input option with the linker, it gave me this output

    E0562002:Input option cannot be specified on command line

    Here is the library generator command:

    I still cant figure out how to use this in CMake format. But this is causing problems

  • Also, what elf viewer are you using? I have to make do with e2 Studio's map file viewer. But viewing an .elf file would help

    The process of going through an .elf file's format manually is very tedious.

Reply Children
  • I am using the Lauterbach simulator for RX to load and view information about the ELF file.  Lauterbach isn't terribly popular for the RX b/c it isn't promoted heavily by Renesas, but it is probably the best debugger solution on the market.  As such the price is not cheap, it certainly cannot complete with the E2 or E2-Lite in terms of cost, but it is a very powerful tool for those who know about it and know how to use it.  I have been using it for various MCU development projects for over 20years, and I still use it today for just about everything Renesas.

    I was going to say that you can download the free (limited) simulator from the Lauterbach web site, but apparently RX is not available.  I have the simulator as part of the debugger.  A free evaluation version of the simulator is available for several MCU architectures but RX is not listed.

  • The simulator seems very cool. I will try to get it as well. I am about to use J-link. I dont have an idea if it would give me some functionality like this too. 

    it does have a simulator but I dont know if it would help me view .elf files in such an interactive way.