''Warning[Pe609]: this kind of pragma may not be used here''
So you need to consult your IAR manuals to see what other kinds of pragmas exist that can be used there... Have you asked IAR about this?
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
You can use first syntax with #pragma if you declare first the struct and after you reserve it. struct s_tempor { int x ; int y ; } ; #pragma location=0x0801FFFE __no_init struct s_tempor tempor ; Be carrefull in your example, the size of struct is 8 bytes. With a 128 k device, I think the correct address is 0x801FFF8 for the end of Flash. If you don't want to have address in source, you can declare a new section and edit your ICF file to place this section at the correct address in Flash. #pragma location=''.param'' __no_init struct s_tempor tempor ; With this method, you can have several parameters in your project even in different files, and the linker group together all parameters in the same sector of the Flash. Best regards Eric
Like any language extensions they aren't very portable, casts work practically everywhere. The IAR extensions aren't going to work on RealView, Keil, GHS, Rowley, Atollic, GCC, etc. The same reason I'd avoid nameless unions/structures, and incrementing void * pointers. The code will be difficult to work with, and maintain, 5,10,15 or 20 years from now.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..