Imagecraft ICC plug-in for Studio

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This news looks interesting:

https://www.avrfreaks.net/modules...

So I installed it and now have:

but when I try to build:

#include 

void main(void) {
	PORTA=0xFF;
	printf("hello world");
}

I get:

Build started 6.9.2007 at 14:13:40
    iccavr -c -e -D__ICC_VERSION="7.13" -DATMEGA -D_EE_EXTIO -DATMega168  -l -g -Mavr_enhanced  
    iccavr -o icctest -g -e:0x4000 -ucrtatmega.o -bfunc_lit:0x68.0x1000 -dram_end:0x4ff -bdata:0x100.0x4ff -dhwstk_size:16 -beeprom:0.512 -fihx_coff -S2  @icctest.lk -lcatmega 
Usage: [options] file [file ...] [-l]
  -btext: expression
  -bdata: expression
  -b: expression
  -d   global symbol = expression
  -F: (AVR|M8C) fill unused memory with 
  -f: -fmots19 | -fintelhex | -fcoff | -fihx_coff
  -L library search path
  -l Search library archive lib.a
  -m   Generate map file as .mp
  -o Name output file
  -R   do not link in startup or library file
  @ Obtain options from file
  -Sx  Atmel Studio COFF version
   S0: Studio 3.x; S1: Stduio 4.0 - 4.05; S2: Studio 4.06+

So what's up with that then? Clearly one of those options being passed to the compiler is something it doesn't like the look of - but which one?

Where's Bob when you need him?

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After a bit of experimentation (and based on that help output) I think it maybe the -e:0x4000 it doesn't like?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Uh-huh?!? So someone outside Atmel finally have been given some info on the plugin interface to Studio. You know, the one that a few years ago was announced to become more or less public. Then the lid went on...

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
#include
Perhaps it does't like this???

This is the ICC "hello world " bit

#include 
#include 

char buffer[20];
unsigned int i = 22;
main()
	{
    extern int _textmode;
	_textmode = 1;
	init_devices();
	sprintf(buffer, "hello world %d", i);
    puts(buffer);
	}

And I had to change this #include to #include when I messed around with Microcarl's lcd back pack and different compilers.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah, you must have an older version of the compiler. Install the latest demo from our website to upgrade and you should be OK. I should make a note of the requirements in the final readme.

Thank you for trying this out.

// richard

Richard Man http://imagecraft.com

Beyond Arduino - When you're ready to get serious...
JumpStart C Tools, The Better Alternative.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Install the latest demo from our website
PHEW!! I thought I was going to get a free ICC package for having posted on this thread, then I would have to learn C....just as well you are not going to give another one away :lol: :lol:

I have 7.12A demo is this the latest? Just in case I get another C attack.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never mind, I see there is V7.14 out.

By the way there is a spelling mistake in the help/about links to SALVO it is spelled SAVLO.
(was present in 7.12) May want to fix this as it would detract from the Image of Image Craft :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The lid to the AVR Studio4 SDK was taken off long ago. The kit can be downloaded from the Atmel site. To get it you have to sign an agreement and fax us.

Lars Kvenild
Atmel Norway

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Being a rainy Friday afternoon I thought I would install SP1 and the ICC plugin and have a quick run at a simple, already working GCC C program. It all looks very nice except that nothing works...as I expected. Now that we are starting to have a real integrated IDE can we please have integrated FLAMING SYNTAX for all C compilers? :? Why can't evrybody get together and say "This is the standard way of doing things in C with the AVRs". Sure keep their own specialties and nic nacs and better ways of doing things, BUT SURELY there should be a consensus among all 4 compilers so something written in Studio for any of the possible 4 compilers would work REGARDLESS of which brand one has purchased and wishes to use. :( oh well another very short lived attempt at C for me.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

The lid to the AVR Studio4 SDK was taken off long ago.

OK and sorry, Lars. I have completely missed this.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js,

OK, what errors did the GCC program give when you tried to compile it in ICC? On the whole the main sticking point is going to the be interrupt handler. This is there is a "standard syntax" drawn up for programming ni C (by Ansi) but the one thing that was never standardised was the handling of interrupts (partly because it's architecture specific). Other than that most C code should port between compilers fairly well.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

imagecraft wrote:
Ah, you must have an older version of the compiler. Install the latest demo from our website to upgrade and you should be OK. I should make a note of the requirements in the final readme.

Thank you for trying this out.

// richard


Richard,

OK, so I downloaded 7.14 and my program is now:

#include 
#include 

void main(void) {
	PORTB=0xFF;
	printf("hello world");
}

But when I build this the compiler output is:

Build started 7.9.2007 at 09:58:05
    iccavr -c -e -D__ICC_VERSION="7.13" -DATMEGA -DATMega16  -l -g -Mavr_enhanced  
    iccavr -o icctest -g -e:0x4000 -ucrtatmega.o -bfunc_lit:0x54.0x1000 -dram_end:0x45f -bdata:0x60.0x45f -dhwstk_size:16 -beeprom:0.512 -fihx_coff -S2  @icctest.lk -lcatmega 
!ERROR can't open file 'icctest.o'
c:\Program Files\ImageCraft\iccv7avr\bin\imakew.exe: Error code 1
Build failed with 1 errors and 0 warnings...

The previous error has disappeared and there's no (apparent) compile time errors but there's no icctest.o being generated in the ../default directory. All that is there are:

 Directory of N:\icctest\default

07/09/2007  09:57                 .
07/09/2007  09:57                 ..
07/09/2007  09:57                  249 build.bat
07/09/2007  09:57                   10 icctest.lk
07/09/2007  09:57                  491 Makefile

Any clues?

Cliff

PS I notice that the 7.14 install wanted to put ICC in c:\iccv7avr but as I already had a copy installed in c:\Program Files\Imagecraft\iccv7avr I changed it to install there instead. Could it be that spaces in pathnames is my problem here?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
handling of interrupts
No interrupst being used, it does not understand even the definition of the cpu (switch between M88 and M32) and it stops there. There is also something that the demo version cannot be run in command mode or something which I'm not. I'll post the project (runs in c:\ )perhaps someone can make some sense and enlighten me (going to vegetate in front of the telly now). js_delay.S is just to replace GCC's delay routine and to play around with asm files. There are also USART.C and USART.H for putchar and getchar but these should be available in ICC. The program just flashes a led at the speed entered by the keyborad (0 - 9 in 100ms) and adjusts the brightness with pwm with the value on any other key.

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John,

Well in the absence of the two header files to go with it I had to malke a few small changes but the following compiles OK in ICC:

/*Led flashing program, uses PD5 as led output on Mega32 or M164*/
/* or PB1 on Mega88*/
#include 
#include 
#include 
#include 
//#include "USART.h"
//#include "super_flasher.h"

#define led_port 	PORTD
#define led_bit		PD5

// Declare variables
int		time;
int		flash_rate=2;
int		brightness=128;
int		pwm_flag=0;

unsigned char KB_INPUT;

// Declare functions

// for ICC to use printf a "putchar" routine must be defined
int putchar(char c) {
	// though this does nothing in fact
	return c;
}

// I think your _delay_ms must have been in the .h files? 
void _delay_ms(int i) {
	 int j;
	 for (j=0; j<(i * 1000); j++);
}

void	set_flash_rate (int flash_rate)
		{
		time=flash_rate*100;
		printf("\rFlash Rate is %d ms, Brightness %d  ", time, brightness); 
		}

void	set_brightness (int brightness)
		{
		OCR1AH=0;					//OCR1A for pb3,;OCR1B for pb4
		OCR1AL=brightness;			//Start PWM duty cycle
		}

void	pwm_on ()
	{
	TCCR1A=(1<<COM1A1|1<<WGM10);	//Timer 1 PWM mode, inverted (LED is active high)
	TCCR1B=(1<<CS10);				//enable Timer 1 with no prescaler
	pwm_flag=1;
	}

void	pwm_off ()
	{
	TCCR1A=0;
	TCCR1B=0;
	pwm_flag=0;
	}

void	get_flash_rate (void)
		{
		if (UCSRA & (1<<RXC)) 
			{
			KB_INPUT=UDR;
			if	(isdigit (KB_INPUT))
				{
				flash_rate=(KB_INPUT-48);
				if	(flash_rate==0)
					{
					led_port &= ~(1<<led_bit);
					printf("\rLED Off                             ");
					time=10;			//Set fast timeout for delay at 10ms 
					}
					else	set_flash_rate (flash_rate);
				}
					if	(!isdigit (KB_INPUT))
					{
					brightness=(KB_INPUT*2);
					set_brightness (brightness);
					printf("\rFlash Rate is %d ms, Brightness %d  ", time, brightness); 
					}
			}
		}

int	main (void)
{
	DDRB=0xff;					//Initialise ports
	DDRC=0xff;
	DDRD=0xff;
  
    //UART_first_init ();			// First init UART
	printf("\n\n\r* S U P E R  F L A S H E R *\n\r ");
	set_flash_rate (flash_rate);


	set_brightness (brightness);

	for (;;)
	{
		get_flash_rate();
			if	(flash_rate > 0)
				{
					if	(pwm_flag==0)
						{
						pwm_on();
						}
					led_port=(1<<led_bit);
					_delay_ms(time);
				}

		get_flash_rate();
				if	(pwm_flag==1)
					{
					pwm_off();
					}
		led_port &= ~(1<<led_bit);
		_delay_ms(time);
	}

}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Well in the absence of the two header files
The posted code is the FULL gcc project, all files are there and it should compile correctly, it does on my computer.
Quote:
I think your _delay_ms must have been in the .h files?
this is the js_delay.S, it's my "standard" self ajdusting routine adapted to work with GCC as an included .S file.
Quote:
//#include "super_flasher.h"
This file has the project definition for both chips that can be used.With gcc it takes the info from the Studio generated makefile ie it will switch port and pin according to the chip used. I couldn't figure out how to get the cpu type to modify the definition file. (I did try and look at the docs :? )
Quote:
// for ICC to use printf a "putchar" routine must be defined
This is nice, so the USART.C and USART.h used with gcc are not required, I guess putchar will also need to be declared in a similar fashion to use getc or scanf??? In this program a char is obtained by reading the USART directly.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Cliff

PS I notice that the 7.14 install wanted to put ICC in c:\iccv7avr but as I already had a copy installed in c:\Program Files\Imagecraft\iccv7avr I changed it to install there instead. Could it be that spaces in pathnames is my problem here?

Cliff, it should work. Can you contact me richard @imagecraft.com and we can resolve the problems? I don't check this forum enough. Sorry.
// richard

Richard Man http://imagecraft.com

Beyond Arduino - When you're ready to get serious...
JumpStart C Tools, The Better Alternative.