Recompiling Bitcloud HAL for SPI

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

Hi Guys,

 

Following on from topics such as:

https://www.avrfreaks.net/forum/u...

https://www.avrfreaks.net/forum/...

 

I am trying to recompile HAL to disable the default SPI integration to test my own implementation. Once I get this working I may go back but at this stage I am having quite a few issues with recompiling this module.

 

If I make the change from IAR compilier to Gcc and leave everything else as default. I get the following:

 

C:\BitCloud_MEGARF_3_1_0\BitCloud\Components\HAL>make clean all
Makerules:1333: *** ERROR in file Makerules: You are using incorrect version of
compiler: installed gcc version 4.3.3 (WinAVR 20100110), expected gcc version 4.
8.1 (AVR_8_bit_GNU_Toolchain_3.4.4_1229).  Stop.

It appears to want me to use the later gcc toolchain, could this be because the default chip (256/2564) is newer? Nonetheless if I comment out the check like below:

 

C:\BitCloud_MEGARF_3_1_0\BitCloud\Components\HAL>make.exe clean all
make clean -C ./../HAL/avr
make[1]: Entering directory `C:/BitCloud_MEGARF_3_1_0/BitCloud/Components/HAL/av
r'

----------------------------------------------------
HAL component cleaning.
HAL cleaning done!
----------------------------------------------------
make[1]: Leaving directory `C:/BitCloud_MEGARF_3_1_0/BitCloud/Components/HAL/avr
'
make all -C ./../HAL/avr
make[1]: Entering directory `C:/BitCloud_MEGARF_3_1_0/BitCloud/Components/HAL/av
r'

----------------------------------------------------
HAL library creation.
----------------------------------------------------
avr-gcc ../avr/atmega128rfa1/common/src/halWdtInit.c
unknown MCU 'atmega256rfr2' specified
Known MCU names:
   avr2
   at90s2313
   at90s2323
   at90s2333
   at90s2343
   attiny22
   attiny26
   at90s4414
   at90s4433
   at90s4434
   at90s8515
   at90c8534
   at90s8535
   avr25
   ata6289
   attiny13
   attiny13a
   attiny2313
   attiny2313a
   attiny24
   attiny24a
   attiny4313
   attiny44
   attiny44a
   attiny84
   attiny25
   attiny45
   attiny85
   attiny261
   attiny261a
   attiny461
   attiny461a
   attiny861
   attiny861a
   attiny43u
   attiny87
   attiny48
   attiny88
   at86rf401
   avr3
   at43usb320
   at43usb355
   at76c711
   avr31
   atmega103
   avr35
   at90usb82
   at90usb162
   atmega8u2
   atmega16u2
Known MCU names:   atmega32u2

  avr1   attiny167
 avr2   avr4
   atmega8
 avr25   atmega48
 avr3   atmega48a
 avr31   atmega48p
 avr35   atmega88
 avr4   atmega88a
 avr5   atmega88p
 avr51   atmega88pa
 avr6   atmega8515
 avrxmega1   atmega8535

  avrxmega2   atmega8hva
 avrxmega3   atmega4hvd
 avrxmega4   atmega8hvd
 avrxmega5   at90pwm1
 avrxmega6   at90pwm2
 avrxmega7   at90pwm2b
 at90s1200   at90pwm3
   at90pwm3b

  attiny11   at90pwm81
   avr5
 attiny12   atmega16
 attiny15   atmega16a
 attiny28   atmega161
 at90s2313   atmega162
 at90s2323   atmega163
 at90s2333   atmega164a

  at90s2343   atmega164p
 attiny22   atmega165
 attiny26   atmega165a
 at90s4414   atmega165p
 at90s4433   atmega168
 at90s4434   atmega168a
 at90s8515   atmega168p

  at90c8534   atmega169
   atmega169a
 at90s8535   atmega169p
 ata6289   atmega169pa
 attiny13   atmega16c1
 attiny13a   atmega16hva
 attiny2313   atmega16hva2
 attiny2313a   atmega16hvb

  attiny24   atmega16m1
   atmega16u4
 attiny24a   atmega32
 attiny4313   atmega323
 attiny44   atmega324a
 attiny44a   atmega324p
   atmega324pa
 attiny84   atmega325
 attiny25   atmega325p

  attiny45   atmega3250
 attiny85   atmega3250p
 attiny261   atmega328
 attiny261a   atmega328p
 attiny461   atmega329
 attiny461a   atmega329p
 attiny861   atmega329pa

  attiny861a   atmega3290
 attiny87   atmega3290p
 attiny43u   atmega32c1
 attiny48   atmega32hvb
 attiny88   atmega32m1
 at86rf401   atmega32u4
   atmega32u6
   atmega406
   atmega64
 at43usb355   atmega640

  at76c711   atmega644
 atmega103   atmega644a
 at43usb320   atmega644p
 attiny167   atmega644pa
 at90usb82   atmega645
 at90usb162   atmega645a
 atmega8u2   atmega645p

  atmega16u2   atmega6450
 atmega32u2   atmega6450a
 atmega8   atmega6450p
 atmega48   atmega649
 atmega48a   atmega649a
 atmega48p   atmega649p
 atmega88   atmega6490

  atmega88a   atmega6490a
 atmega88p   atmega6490p
 atmega88pa   atmega64c1
 atmega8515   atmega64m1
 atmega8535   atmega64hve
 atmega8hva   at90can32

  atmega4hvd   at90can64
 atmega8hvd   at90pwm216
 at90pwm1   at90pwm316
 at90pwm2   at90scr100
   at90usb646
 at90pwm2b   at90usb647
 at90pwm3   at94k
 at90pwm3b   avr51

  at90pwm81   atmega128
 atmega16   atmega1280
 atmega16a   atmega1281
 atmega161   atmega1284p
 atmega162   atmega128rfa1
 atmega163   at90can128
 atmega164a   at90usb1286

  atmega164p   at90usb1287
 atmega165   m3000f
 atmega165a   m3000s
 atmega165p   m3001b
 atmega168   avr6
 atmega168a   atmega2560

  atmega168p   atmega2561
 atmega169   avrxmega2
 atmega169a   atxmega16a4
 atmega169p   atxmega16d4
   atxmega32d4
 atmega169pa   avrxmega3
 atmega16hva   atxmega32a4

  atmega16hvb   avrxmega4
 atmega32   atxmega64a3
 atmega323   atxmega64d3
 atmega324a   avrxmega5
 atmega324p   atxmega64a1
 atmega324pa   avrxmega6

  atmega325   atxmega128a3
 atmega325p   atxmega128d3
   atxmega192a3
 atmega3250   atxmega192d3
   atxmega256a3
 atmega3250p   atxmega256a3b
   atxmega256d3
 atmega328   avrxmega7
 atmega328p   atxmega128a1

  atmega329   avr1
 atmega329p   at90s1200
 atmega329pa   attiny11
 atmega3290   attiny12
 atmega3290p   attiny15
 atmega32hvb   attiny28

  atmega406 atmega64 atmega640 atmega644 atmega644a atmega644p atmega644pa
  atmega645 atmega645a atmega645p atmega649 atmega649a atmega649p
  atmega6450 atmega6450a atmega6450p atmega6490 atmega6490a atmega6490p
  atmega64hve atmega16hva atmega16hva2 at90can32 at90can64 at90pwm216
  at90pwm316 atmega16m1 atmega16u4../avr/atmega128rfa1/common/src/halWdtInit.c:1
: error: MCU 'atmega256rfr2' supported for assembler only atmega32c1
 atmega32m1 atmega32u4
  atmega32u6 atmega64c1 atmega64m1 at90usb646 at90usb647 at90scr100 at94k
  atmega128 atmega1280 atmega1281 atmega1284p atmega128rfa1 at90can128
  at90usb1286 at90usb1287 m3000f m3000s m3001b atmega2560 atmega2561
  atxmega16a4 atxmega16d4 atxmega32d4 atxmega32a4 atxmega64a3 atxmega64d3
  atxmega64a1 atxmega128a3 atxmega128d3 atxmega192a3 atxmega192d3
  atxmega256a3 atxmega256a3b atxmega256d3 atxmega128a1
Assembler messages:
Fatal error: unknown MCU: atmega256rfr2

In file included from ../.././SystemEnvironment/include/sysTypes.h:159,
                 from ../avr/atmega128rfa1/common/src/halWdtInit.c:25:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:404:6: warning: #warning "
device type not defined"
In file included from c:/winavr-20100110/lib/gcc/../../avr/include/avr/boot.h:10
4,
                 from ../.././SystemEnvironment/include/sysTypes.h:162,
                 from ../avr/atmega128rfa1/common/src/halWdtInit.c:25:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/eeprom.h:41:3: warning: #warnin
g "Device does not have EEPROM available."
In file included from ../.././SystemEnvironment/include/sysTypes.h:162,
                 from ../avr/atmega128rfa1/common/src/halWdtInit.c:25:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/boot.h:115:4: error: #error AVR
 processor does not provide bootloader support!
c:/winavr-20100110/lib/gcc/../../avr/include/avr/boot.h:125:4: error: #error Can
not find SPM Enable bit definition!
In file included from ../avr/atmega128rfa1/common/src/halWdtInit.c:27:
../avr/atmega128rfa1/common/include/halAppClock.h: In function 'halStartAppClock
':
../avr/atmega128rfa1/common/include/halAppClock.h:88: error: 'TCCR4B' undeclared
 (first use in this function)
../avr/atmega128rfa1/common/include/halAppClock.h:88: error: (Each undeclared id
entifier is reported only once
../avr/atmega128rfa1/common/include/halAppClock.h:88: error: for each function i
t appears in.)
../avr/atmega128rfa1/common/include/halAppClock.h:88: error: 'CS11' undeclared (
first use in this function)
../avr/atmega128rfa1/common/include/halAppClock.h: In function 'halStopAppClock'
:
../avr/atmega128rfa1/common/include/halAppClock.h:96: error: 'TCCR4B' undeclared
 (first use in this function)
../avr/atmega128rfa1/common/include/halAppClock.h:96: error: 'CS11' undeclared (
first use in this function)
../avr/atmega128rfa1/common/src/halWdtInit.c: In function 'halWdtInit':
../avr/atmega128rfa1/common/src/halWdtInit.c:90: error: 'MCUSR' undeclared (firs
t use in this function)
../avr/atmega128rfa1/common/src/halWdtInit.c:100: error: 'WDTCSR' undeclared (fi
rst use in this function)
../avr/atmega128rfa1/common/src/halWdtInit.c:100: error: 'WDCE' undeclared (firs
t use in this function)
../avr/atmega128rfa1/common/src/halWdtInit.c:100: error: 'WDE' undeclared (first
 use in this function)
make[1]: *** [WdtInit] Error 1
make[1]: Leaving directory `C:/BitCloud_MEGARF_3_1_0/BitCloud/Components/HAL/avr
'
make.exe: *** [all] Error 2

C:\BitCloud_MEGARF_3_1_0\BitCloud\Components\HAL>pause
Press any key to continue . . .

 

I manually downloaded gcc 4.8.1 and tried to use it's make file. I have also tried to use the makefile inside Atmel Studio 6.(1/2) in case it used the compilier that was installed in their own folders, but nothing changed.

 

Any pointers would be greatly appreciated!

 

Cheers,

Ryan.

Last Edited: Fri. Oct 16, 2015 - 12:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

When WinAVR 20100110 was released this chip did not exists.

 

I would suggest using compiler that comes with Atmel Studio. Don't use the AS itself, but add the compiler into PATH and try again using "make clean all".

 

Also, what do you mean by "its makefile"? You normally use the same Makefile with the new compiler.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

I meant the make.exe located in the Atmel studio installation folder(s). However, silly me thought that the make.exe was linked by default to the compilier.

 

I looked at the makefile auto-generated from a my new avr project and copied (what I thought was the) avr-8 bit gcc compilier location: "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin" placed this into my System PATH. I also removed winavr because it still seemed to trigger when it was in there. Restarted the PC and ran "make clean all" again. This time I got:

 


C:\BitCloud_MEGARF_3_1_0\BitCloud\Components\HAL>"C:\Program Files (x86)\Atmel\A
tmel Studio 6.2\shellUtils\make.exe" clean all
'grep' is not recognized as an internal or external command,
operable program or batch file.
'grep' is not recognized as an internal or external command,
operable program or batch file.
Makerules:1333: *** ERROR in file Makerules: You are using incorrect version of
compiler: installed , expected gcc version 4.8.1 (AVR_8_bit_GNU_Toolchain_3.4.4_
1229).  Stop.

 

It seems that it can't find the compilier at all, perhaps I have the wrong directory.

 

Also obviously since I removed winavr/utils from the System path, just calling "make clean all" didn't work so I used the exact make.exe location in atmel studio folder.

 

Any idea what I am doing wrong? Or am I still trying to link the wrong folder?

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

You also need to add shell utilities to your PATH. The grep command is used to extract compiler version. In my case shell utilities are located at "C:\Program Files (x86)\Atmel\Atmel Studio 6.2\shellUtils"

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Sadly, grep.exe is currently missing in my installation. From what I can find looking around on the forums it no longer exists in atmel studio installations. I am current in the process of trying to copy grep from other sources to the directory to try it in there.

 

If you have any suggestions on how to go about it, I am all ears! Perhaps install Studio 6.0 or older? I currently only have 6.1/6.2 installations.

 

EDIT:

 

ALRIGHTY THEN!

 

Using the path variables:

C:\WinAVR-20100110\utils\bin;C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin

seems to compile. So obviously I had to leave winavr included and use grep from it. Grep chose the correct version of the gcc compilier from the two locations now in the path I guess. Thanks for the help :)

Last Edited: Tue. Feb 10, 2015 - 01:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like my grep comes from some place else. The easiest way to deal with this is to remove call to grep in version check. The version will not match anyway. Just remove the entire block:

ifneq ($(EXP_VERSION), $(COMPILER_VERSION))
  $(error ERROR in file Makerules: You are using incorrect version of compiler: \
    installed $(COMPILER_VERSION), expected $(EXP_VERSION))
endif

 

I've created a request to remove this check from future releases, it worked well when there was WinAVR with releases once or twice a year, but adds nothing with AS and often releases of the compiler.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.