Segger "cannot compile this l-value expression yet" on most peripherals

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

Using the latest version of Segger Embedded Studio which supports SAMD21 CMSIS out the box. I can see that samd21.h is importing samd21g18au.h which is correct.

 

EIC->INTFLAG.reg = 0xFFFF;

 

Error

'cannot compile this l-value expression yet'
expanded from macro 'EIC'
#define EIC               ((Eic      *)0x40001800UL) /**< \brief (EIC) APB Base Address */

If I'm typing it finds EIC->INTFLAG but not the .reg part. 

Any ideas where to start?
 

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

Sounds like it's not got the proper/complete definition of the structure.

 

How did you create the Project?

 

Do you have a known-good project to compare against?

 

Is it correctly configured for C or C++ ?

 

Have you asked Segger?

 

https://forum.segger.com/index.p...

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...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like the component header is not being included.  The Atmel headers are in 2 parts,  AS you say in your post, the definition for the address of the peripheral is contained in samd21g18au.h, but you also need to include the header for the peripheral, in this case eic.h, which is found in C:\Program Files (x86)\Atmel\Studio\7.0\packs\atmel\SAMD21_DFP\1.3.331\samd21a\include\component

John Malaugh

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

If I'm typing it finds EIC->INTFLAG but not the .reg part. 

Also, if you have the "new" Microchip Packs (v3.x.y) instead of the old Atmel Packs (v1.x.y), all of the CMSIS stuff has changed, and there are no more ".reg" vs ".bits" stuff.

(although, you would've had to have EIC->EIC_INTFLAG as well.)
(if that's the problem, you should be able to download the old versions...)

 

Last Edited: Thu. Dec 10, 2020 - 11:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it true the new "new" Microchip Packs no longer support ".reg"??  So everyone has to use old libraries or re-write their code?? Way to go Microchip.

John Malaugh

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

It's not, segger is not using gnu c/c++ by default. Switched in the options and sorted it.

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

snoopy33 wrote:
segger is not using gnu c/c++ by default. 

Really? So what does it use?

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...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

'SEGGER' - whatever that is.

The GNU and CLANG options come beneath it.

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

Can you give a link to that?

 

My understanding was that it uses the GCC toolchain - possibly with their own Linker ?

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...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

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

Hmm ... the web page only mentions GCC and LLVM (CLang?): 

 

https://www.segger.com/products/development-tools/embedded-studio/technology/compiler/

 

Anyhow, ASF certainly assumes GCC - as that's what came with Atmel Studio (and hasn't changed with the re-brand).

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: Fri. Dec 11, 2020 - 12:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is also a compilers.h which has tests for __CC_ARM, __ICCARM__, and __GNUC__ - would likely need tweaking for other compilers ...

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...