Illegal storage class __flash in Jumpstart ImageCraft IDE

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

I'm trying to build a project that was originally built in Atmel Studio which compiled fine without any errors or warnings, but if I try to build the project in the ImageCraft IDE it says there are no errors but it will fail to build.

 

Source code snippet of what I'm trying to build in ImageCraft:

static inline void PORTA_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode)
{

    if (pull_mode == PORT_PULL_UP)
    {

        DDRA &= ~(1 << pin);

        PORTA |= 1 << pin;
    }
    else if (pull_mode == PORT_PULL_OFF)
    {
        PORTA &= ~(1 << pin);
    }
}

This is the outcome of the build log:  

iccavr.exe: 'C:\iccv8avr\bin\iccomavr.exe' returns error code -1073741819 Process terminated with status -1073741819 (0 minute(s), 2 second(s)) Build Failed: 0 error(s), 158 warning(s) (0 minute(s), 2 second(s))

The warnings that are showing when trying to build the project

!W C:\Sahil\Basic WifiBuild\WifiBoard\include\port.h(63):[warning] Illegal storage class __flash for parameter 'pin'. Storage class removed.

!W C:\Sahil\Basic WifiBuild\WifiBoard\include\port.h(63):[warning] Illegal storage class __flash for parameter 'pull_mode'. Storage class removed.

!W C:\Sahil\Basic WifiBuild\WifiBoard\include\port.h(92):[warning] Illegal storage class __flash for parameter 'mask'. Storage class removed.

!W C:\Sahil\Basic WifiBuild\WifiBoard\include\port.h(92):[warning] Illegal storage class __flash for parameter 'direction'. Storage class removed.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The code is using non-standard compiler features. Seems the problem is in port.h

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

__flash is specific to gcc, I believe.

 

If you're using a different compiler, you'll need to find out the syntax for accessing variables in program memory.

 

This https://gcc.gnu.org/onlinedocs/g... suggests it's some kind of ISO/IEC standard but clearly your compiler doesn't like it.

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

Program Data and Constant Memory | JumpStart C for AVR

though from the words there __flash may be conditional (ie not for auto)

 

"Dare to be naïve." - Buckminster Fuller

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

Remove the leading “_” underscores and try again!

 

jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

My (old) version of ICC has a compiler option that says use const as flash. You probably want that unticked.

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

Seems the identical question was posted on stack overflow today. What a coincidence.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Porting from one compiler (and IDE) to another requires some familiarity of both entities, assuming both are ansi C compilers, most of the code will be the same, difference will be in how things like interrupts and inline assembly are handled.  Spend some time in each systems documentation to understand how it's done in that compiler.   I have converted several projects from gcc to ICC, it's not hard to do in most cases.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

I'm guessing there's a file called "port.h" (and "port.c" perhaps?) because all the "compiler specific" stuff is gathered together into one place to be adjusted to the target compiling environment?

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

Thanks for your response guys. It turns out that in ImageCraft under the compiler options I had to untick "Treat 'Const' as __Flash (See Note 1). 

 

I'm still having to port the remainder of the driver as the tedious build error of " C:\iccv8avr\bin\iccomavr.exe' returns error code -1073741819 " keeps showing up but I'm working on overcoming that. 

 

 

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

I'm puzzled as to why you would want to port to Imagecraft ICCAVR? gcc is a far better compiler methinks (Sorry Richard!). 

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

Unfortunately the project I am working on is huge and it''s gonna take too long to port along with the debugging to go with it. 

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

Kartman wrote:

I'm puzzled as to why you would want to port to Imagecraft ICCAVR? gcc is a far better compiler methinks (Sorry Richard!). 

 

Plus Richard has moved on to other things, doubt there will be anymore updates to the compiler.

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

 

Kartman wrote:
I'm puzzled as to why you would want to port to Imagecraft ICCAVR?

Indeed!

 

Grannus wrote:
Richard has moved on to other things, doubt there will be anymore updates to the compiler

It's stated on the website:

 

 

On the linked page, Imagecraft wrote:
Unfortunately, given the changing market environment, it is no longer viable at this time for us to continue to actively develop and support the ICC/JumpStart series of products. While we believe that our AVR and Cortex tools are significantly better than other products in terms of price/performance ratio, features, pricing, and technical support, we are finding it necessary for us to move on.

 

https://www.imagecraft.com/company/a-note-to-our-customers

 

There was a thread here about that recently.

 

EDIT - here:  https://www.avrfreaks.net/forum/imagecraft-compilers?skey=imagecraft

 

EDIT final quote should have been:

 

sahil885 wrote:
the project I am working on is huge and it''s gonna take too long to port

Given that Imagecraft is no longer being supported or developed, you're going to have to do it sometime ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Aug 5, 2020 - 07:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sahil885 wrote:
I'm still having to port the remainder of the driver as the tedious build error of " C:\iccv8avr\bin\iccomavr.exe' returns error code -1073741819 " keeps showing up
But that is NOt the important bit of the error? It's what lead to this being shown is the issuse(s) you need to concentrate on surely? 

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

I am puzzled:

 

In #1, sahil885 wrote:
I'm trying to build a project that was originally built in Atmel Studio which compiled fine without any errors or warnings

In #11, Kartman wrote:
I'm puzzled as to why you would want to port to Imagecraft ICCAVR?

Especially puzzling considering, as already noted, that ICCAVR is no longer maintained or supported

 

Now the confusing part:

In #12, sahil885 wrote:
the project I am working on is huge and it''s gonna take too long to port 

But you said it was already working fine in Atmel Studio - so why are you porting it at all ??

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...