C Compiler Error of Demos

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
tohlizzle
Beiträge: 5
Registriert: 13 Mai 2012, 18:20

C Compiler Error of Demos

Beitrag von tohlizzle » 13 Mai 2012, 18:30

Good afternoon.
I am American, so I hope someone here speaks English or uses Chrome so they can understand what I am saying.
I am trying to program the RoboPro Interface in C for an electrical engineering final project. I downloaded the ZIP file and the Renesas compiler and followed all the instructions. I tried to compile the example file Blink1, but I got the following error message:

Code: Alles auswählen

L2330 (E) Relocation size overflow : "C:\WorkSpace\2\2\Debug\ncrt0.obj"-"program"-"0000003e"
I tried Googling this error, but could not find anything. I have never programmed a Renesas in C before, so I have no idea what could be causing this error. I have not modified the example program at all, except for that the Integrated Development Environment (IDE) prompted me to update the workspace to the current version.
Next, I tried to create an empty program

Code: Alles auswählen

#include "TA_Firmware\TAF_00D.h"
#include "TA_Firmware\TAF_00P.h"

UCHAR main(void) {
	
	return 0;
}
but got the same error, so I am assuming something in the header files that communicates with the hardware no longer works in the latest version of Renesas' IDE.
Does anyone know how to fix this? Any help would be greatly appreciated.

vleeuwen
Beiträge: 1609
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: C Compiler Error of Demos

Beitrag von vleeuwen » 13 Mai 2012, 19:09

Hi,
It is not clear for me what you like to program.

Based on you information
-) you are programming for a Robo Interface and not a TX-C.
-) you are programming for the off line use. You try to use the Renesas compiler.
The Renesas compiler is a cross-compiler.


However, RoboPro doedn't have a C interface.

You have installed the FtCComp_V1_66_c_2012_04_25 package for the FIschertechnik Robo Interface.
Which Renesas cross compiler package are you using? (if possible, the download link)

vleeuwen
Beiträge: 1609
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: C Compiler Error of Demos

Beitrag von vleeuwen » 13 Mai 2012, 19:58

I just installed the nc30v600r00_ev.exe (version 6.00 of the Toolchain) and the FtCComp_V1_66_c_2012_04_25.zip.

I tried to compile the blink example and I got the next warnings and error message (from the linker).
It look like that the example has a link error.


Phase M16C Assembler finished

Phase OptLinker starting
License expires in 60 days
L1323 (W) Section attribute mismatch : "program"
L1323 (W) Section attribute mismatch : "TA_COMMUNICATION_NE"
L1120 (W) Section address is not assigned to "bss_SE"
L1120 (W) Section address is not assigned to "data_SO"
L1120 (W) Section address is not assigned to "bss_SO"
L1120 (W) Section address is not assigned to "data_NE"
L1120 (W) Section address is not assigned to "bss_NE"
L1120 (W) Section address is not assigned to "data_NO"
L1120 (W) Section address is not assigned to "bss_NO"
L1120 (W) Section address is not assigned to "interrupt"
L1120 (W) Section address is not assigned to "rom_FE"
L1120 (W) Section address is not assigned to "rom_FO"
L1120 (W) Section address is not assigned to "data_SEI"
L1120 (W) Section address is not assigned to "data_SOI"
L1120 (W) Section address is not assigned to "data_NEI"
L1120 (W) Section address is not assigned to "data_NOI"
L1120 (W) Section address is not assigned to "data_FEI"
L1120 (W) Section address is not assigned to "data_FOI"
L1120 (W) Section address is not assigned to "data_FE"
L1120 (W) Section address is not assigned to "bss_FE"
L1120 (W) Section address is not assigned to "data_FO"
L1120 (W) Section address is not assigned to "bss_FO"
L1120 (W) Section address is not assigned to "switch_table"
L2330 (E) Relocation size overflow : "E:\Fischertechnik\FtLib versions\FtCComp_V1_66_c_2012_04_25\Demo\Blink\blink1\debug\ncrt0.obj"-"program"-"0000003e"
Optimizing Linkage Editor Abort
Phase OptLinker finished

Build Finished
1 Error, 23 Warnings

vleeuwen
Beiträge: 1609
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: C Compiler Error of Demos

Beitrag von vleeuwen » 13 Mai 2012, 22:19

I switched back to the older 5.45 compiler and toolchain (nc30v545r01_ev.exe Renesas website) .
Now i didn't meet this problem.
So probably the 6.00 compiler and toolchain need some changes in the linker directives.

Maybe Knobloch can give a more detailed solution.

tohlizzle
Beiträge: 5
Registriert: 13 Mai 2012, 18:20

Re: C Compiler Error of Demos

Beitrag von tohlizzle » 15 Mai 2012, 13:31

Thank you so much! Switching to 5.45 worked. :D
I have another question: Where can I find an "API" guide for programming the RoboInterface in C, a list of all the functions and services available to control the device? I think I would like to use a photoresistor in my final project, but none of the example programs show how to use the ADC inputs.
I would also like to send data back to my computer, as can be done in the original graphical software. Do you know how to do this?

thkais
Beiträge: 384
Registriert: 31 Okt 2010, 21:45

Re: C Compiler Error of Demos

Beitrag von thkais » 15 Mai 2012, 16:41

Hi,
you will find it in the "DOC" folder, but in german only. Most of the technical terms are in english, so there is a good chance that you will understand it - otherwise, feel free to ask us.
All the communication between your application and the system (i.e. the use of motors, inputs etc.) is done with the "transfer area". You will find the structure for example in the folder \Demo\Blink\Blink1\TA_Firmware\TAF_00D.h.
In this header-file the comments are in english, so I think it will be helpful ;-)
Gruß
Thomas

tohlizzle
Beiträge: 5
Registriert: 13 Mai 2012, 18:20

Re: C Compiler Error of Demos

Beitrag von tohlizzle » 17 Mai 2012, 17:23

The end of the German document is the same as the English one, but I was hoping there would be more detail somewhere else, like in Oracle's Javadocs.
I looked at the header file TAF_00D.h, but I am a little confused.
What does the following mean for accessing different Motor ports:

Code: Alles auswählen

Base+0x40: |M4B |M4A |M3B |M3A |M2B |M2A |M1B |M1A |
My main question is how to set the speed and output port of a motor. I am trying to access Motor 1 and set it to the value of the int variable CcVn with the following code

Code: Alles auswählen

sTrans.MPWM_Main[0] = CcVn;
but it does not seem to work.
I also tried to turn on a light connected to Port 2 with the following

Code: Alles auswählen

sTrans.MPWM_Main[1] = 8;
but that does not seem to work either.

thkais
Beiträge: 384
Registriert: 31 Okt 2010, 21:45

Re: C Compiler Error of Demos

Beitrag von thkais » 18 Mai 2012, 06:39

Hi,

Code: Alles auswählen

        // Outputs of the main module ( polarity )
        // Base+0x40: |M4B |M4A |M3B |M3A |M2B |M2A |M1B |M1A |
        unsigned char M_Main;
With M_Main you control the outputs bit-wise. You must initialize M_Main to use the outputs, i.e. if you want to use O1 you must write a 0x01 (= binary 00000001) to it.
Every bit in M_Main corresponds to an output, i.e. O6 is switched on writing a 0x20(= binary 00100000), or 0xAA (= binary 10101010) switches on O8, O6, O4, O2. On the second step you initialize the speed with sTrans.MPWM_Main[].
What is about the "blink1" project in the demo-folder? It should switch on/off output O1 every half second. Does this demo-program work?
If it does, use this project as a template for your own code, this will be the easiest way.
In the "old" forum (unfortunately not available) I showed some functions for easy use of the outputs - I will try to find them.
Another question: Are you bound to the use of C or is it possible to use an other language? Some time ago I made a BASIC-Compiler for the robo-interface. The programs were cross-compiled on the PC and then downloaded to the Robo-Interface - there is easy use of in- and outputs, Multi-Tasking, re-entrant functions, etc.... Let me know if you're interested, it's freeware.
---------------------------------
edit:
I had a look at the example and found an additional statement which should be used:

Code: Alles auswählen

sTrans.MPWM_Update = 0x01;  // Update PWM values every 10ms
--------------------------------

Ford: Danke für deinen hilfreichen und qualifizierten Kommentar. Als Admin eines "großen Forums" sollte man.... ach, lassen wir das.
Gruß
Thomas

tohlizzle
Beiträge: 5
Registriert: 13 Mai 2012, 18:20

Re: C Compiler Error of Demos

Beitrag von tohlizzle » 20 Mai 2012, 03:47

Thank you very much!
I hope I am not bothering you, but I have just one more question.
The following code activates all four outputs in the order 1, pause, 2, pause, 3, pause, 4, long pause, 1, pause, 2, pause, 3, pause, 4:

Code: Alles auswählen

	sTrans.M_Main = 0b00000010;
	FtDelay(500);
	sTrans.M_Main = 0b00001000;
	FtDelay(500);
	sTrans.M_Main = 0b00100000;
	FtDelay(500);
	sTrans.M_Main = 0b10000000;
	FtDelay(1000);
	sTrans.M_Main = 0b00000001;
	FtDelay(500);
	sTrans.M_Main = 0b00000100;
	FtDelay(500);
	sTrans.M_Main = 0b00010000;
	FtDelay(500);
	sTrans.M_Main = 0b01000000;
	FtDelay(500);
Why is it that bits 1 & 2, are mapped to output 1, 3 & 4 to output 2, etc? Am I doing something wrong? Is it safer/recommended to use the odd bit as opposed to the even one?

thkais
Beiträge: 384
Registriert: 31 Okt 2010, 21:45

Re: C Compiler Error of Demos

Beitrag von thkais » 20 Mai 2012, 19:15

Hi,

there is a difference between "outputs" and "motors".
Motor 1 is connected to output 1 & 2. Motor 2 to output 3 & 4 etc.. You may use the outputs for driving motors (so you can choose the direction of the motors) and as single outputs (i.e. for lamps or motors which needs only one direction).
Hope this helps... if you have any further questions, feel free to ask.
Gruß
Thomas

vleeuwen
Beiträge: 1609
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: C Compiler Error of Demos

Beitrag von vleeuwen » 20 Mai 2012, 21:59

O1 and O2 are half bridges, M1 is using both half bridges and combines these two into 1 full bridge.

See chapter 6: http://homepages.which.net/~paul.hills/ ... sBody.html

tohlizzle
Beiträge: 5
Registriert: 13 Mai 2012, 18:20

Re: C Compiler Error of Demos

Beitrag von tohlizzle » 24 Mai 2012, 00:25

thkais, thank you very much for the offer, but I am more comfortable with C and this project is due tomorrow, so I don't think I'll have time to learn how to work it. Thank you very much, though!
How do you download programs to the Flash memory?
When I select a file in the Ftloader, it says "Program for RAM Memory" and I do not see where to change this to Flash memory. I have also tried selecting "Autostart only Flash 1", but it still just goes to RAM.

thkais
Beiträge: 384
Registriert: 31 Okt 2010, 21:45

Re: C Compiler Error of Demos

Beitrag von thkais » 24 Mai 2012, 08:53

Hi,

in the project-tree under "dependencies" you will find the file "ProgNr.inc". There you may choose the location of the program (you must compile it with the appropriate option again). The "FTLoader" is not able to relocate the code.
I hope your project will be successful!
Gruß
Thomas

Antworten