SAM BA monitor build falied

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

Hi,

I'm trying to build the SAMD21_sam_ba project in AT07175.zip with IAR EWARM 7.5 without any modification and I got the following errors:

 

cdc_enumerate.c  
Error[Pe020]: identifier "USB_DEVICE_CTRLB_SPDCONF_0_Val" is undefined \drivers\cdc_enumerate.c 279 
Error[Pe137]: expression must be a modifiable lvalue \drivers\cdc_enumerate.c 315 
Error[Pe137]: expression must be a modifiable lvalue \sambamonitor\drivers\cdc_enumerate.c 376 
Error[Pe137]: expression must be a modifiable lvalue \sambamonitor\drivers\cdc_enumerate.c 406 
Error[Pe137]: expression must be a modifiable lvalue \drivers\cdc_enumerate.c 442 
Error[Pe137]: expression must be a modifiable lvalue \drivers\cdc_enumerate.c 471 
Error[Pe137]: expression must be a modifiable lvalue \drivers\cdc_enumerate.c 505 
Error while running C/C++ Compiler 

How can I resolve those errors? I found a topic with the same problem https://www.avrfreaks.net/forum/how-compile-sam-ba-bootloader-sam-d21-iar-workbench

 

Thank for your reading.

Regards,

Hoang

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

First error, use USB_DEVICE_CTRLB_SPDCONF_FS_Val, seems it has been renamed.

The rest of the errors: looks like the compiler can't tolerate "volatile" in the bit field definitions, you can try to fix this by finding the struct definition and removing  __I  etc macros used. To find the place use "Go to Definition" after selecting the field (e.g., for the error on line 315, select EORST, click the right mouse button and select "Go to Definition).

The fix using a cast in the other topic is not correct btw.

/Lars

 

Last Edited: Mon. Mar 28, 2016 - 08:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Before getting to the error above I have an issue with IAR (7.60 for arm, 7.4.1 shared) and a missing file. The file is system_samd21.h. I have located the file inside of directories for Atmel Studio and for SAM-BA but nowhere that IAR sees by default. Do I need to install something additional such as ASF into IAR to get past this?

 

Thanks,

 

Dan

 

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

With the 7.50 installation I have that file is in C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\inc\Atmel\samd21

/Lars