just bought STM32F103C8 and ST-link v2. want to build another author made CW radio beacon on si4432.
he have it working and sketch for arduino IDE. but i getting error:
Arduino: 1.8.5 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink, 72Mhz (Normal), Smallest (default)"
In file included from C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:828:0,
from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:8:
C:\Program Files (x86)\Arduino\libraries\RF22/HardwareSPI.h:19:0: warning: "SPI_MODE0" redefined [enabled by default]
#define SPI_MODE0 0x00
^
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:7:0:
C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:94:0: note: this is the location of the previous definition
#define SPI_MODE0 SPI_MODE_0
^
In file included from C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:828:0,
from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:8:
C:\Program Files (x86)\Arduino\libraries\RF22/HardwareSPI.h:20:0: warning: "SPI_MODE1" redefined [enabled by default]
#define SPI_MODE1 0x04
^
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:7:0:
C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:95:0: note: this is the location of the previous definition
#define SPI_MODE1 SPI_MODE_1[/url]
^
In file included from C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:828:0,
from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:8:
C:\Program Files (x86)\Arduino\libraries\RF22/HardwareSPI.h:21:0: warning: "SPI_MODE2" redefined [enabled by default]
#define SPI_MODE2 0x08
^
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:7:0:
C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:96:0: note: this is the location of the previous definition
#define SPI_MODE2 SPI_MODE_2
^
In file included from C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:828:0,
from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:8:
C:\Program Files (x86)\Arduino\libraries\RF22/HardwareSPI.h:22:0: warning: "SPI_MODE3" redefined [enabled by default]
#define SPI_MODE3 0x0C
^
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:7:0:
C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:97:0: note: this is the location of the previous definition
#define SPI_MODE3 SPI_MODE_3
^
In file included from C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:828:0,
from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:8:
C:\Program Files (x86)\Arduino\libraries\RF22/HardwareSPI.h:35:20: error: conflicting declaration 'HardwareSPI SPI'
extern HardwareSPI SPI;
^
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:7:0:
C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:429:17: error: 'SPI' has a previous declaration as 'SPIClass SPI'
extern SPIClass SPI;//(1);// dummy params
^
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:8:0:
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:941:86: error: 'Hardware_spi' was not declared in this scope
RF22(uint8_t slaveSelectPin = SS, uint8_t interrupt = 0, GenericSPIClass *spi = &Hardware_spi);
^
RF22_CW_beacon:22: error: 'Hardware_spi' was not declared in this scope
RF22 rf22(PA4, PA2, &Hardware_spi);
^
C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino: In function 'void loop()':
C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:166:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("Auto test beacon",16);
^
C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:193:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("OK 73",5);
^
Multiple libraries were found for "RTClock.h"
Used: C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\MapleRTC
Multiple libraries were found for "RadioHead.h"
Used: C:\Users\PC\Documents\Arduino\libraries\RadioHead
Not used: C:\Program Files (x86)\Arduino\libraries\RadioHead
exit status 1
'Hardware_spi' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
\Arduino\libraries\RF22/
directory.
[stevestrong – Sun Apr 01, 2018 1:22 pm] –
You should remove all HardwareSPI related files from the
\Arduino\libraries\RF22/
directory.
then i got –
Arduino: 1.8.5 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink, 72Mhz (Normal), Smallest (default)"
In file included from C:\Users\PC\Desktop\RF22_CW_beacon\RF22_CW_beacon.ino:2:0:
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:828:25: fatal error: HardwareSPI.h: No such file or directory
#include <HardwareSPI.h>
^
compilation terminated.
exit status 1
Error compiling for board Generic STM32F103C series.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
#include <SPI.h>[stevestrong – Sun Apr 01, 2018 4:14 pm] –
You should include:
#include <SPI.h>
<SPI.h> is enough to include.
#include <SPI.h>
#include <RF22.h>
#include <RTClock.h>
#include "tone.h"
#include <libmaple.h> #include <HardwareSPI.h>[stevestrong – Sun Apr 01, 2018 5:26 pm] –
Just replace RF22.h:828 the line
#include <HardwareSPI.h>
[messiah – Sun Apr 01, 2018 5:40 pm] –
GenericSPIClass *spi = &spi ??
In uppercase, &SPI
[stevestrong – Sun Apr 01, 2018 6:32 pm] –[messiah – Sun Apr 01, 2018 5:40 pm] –
GenericSPIClass *spi = &spi ??In uppercase, &SPI
I changed in sketch as well – to &SPI.
getting new error –
Arduino: 1.8.5 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink, 72Mhz (Normal), Smallest (default)"
In file included from C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:2:0:
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:941:86: error: could not convert '& SPI' from 'SPIClass*' to 'GenericSPIClass*'
RF22(uint8_t slaveSelectPin = SS, uint8_t interrupt = 0, GenericSPIClass *spi = &SPI);
^
RF22_CW_beacon:16: error: no matching function for call to 'RF22::RF22(<anonymous enum>, <anonymous enum>, SPIClass*)'
RF22 rf22(PA4, PA2, &SPI);
^
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:16:25: note: candidates are:
In file included from C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:2:0:
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:941:5: note: RF22::RF22(uint8_t, uint8_t, GenericSPIClass*)
RF22(uint8_t slaveSelectPin = SS, uint8_t interrupt = 0, GenericSPIClass *spi = &SPI);
^
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:941:5: note: no known conversion for argument 3 from 'SPIClass*' to 'GenericSPIClass*'
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:848:7: note: constexpr RF22::RF22(const RF22&)
class RF22
^
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:848:7: note: candidate expects 1 argument, 3 provided
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:848:7: note: constexpr RF22::RF22(RF22&&)
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:848:7: note: candidate expects 1 argument, 3 provided
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino: In function 'void loop()':
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:160:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("Auto test beacon",16);
^
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:187:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("OK 73",5);
^
Multiple libraries were found for "RTClock.h"
Used: C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\MapleRTC
Multiple libraries were found for "RadioHead.h"
Used: C:\Users\PC\Documents\Arduino\libraries\RadioHead
Not used: C:\Program Files (x86)\Arduino\libraries\RadioHead
exit status 1
no matching function for call to 'RF22::RF22(<anonymous enum>, <anonymous enum>, SPIClass*)'
[stevestrong – Sun Apr 01, 2018 6:38 pm] –
Use SPIClass instead GenericSpiClass.
Arduino: 1.8.5 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink, 72Mhz (Normal), Smallest (default)"
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino: In function 'void loop()':
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:160:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("Auto test beacon",16);
^
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:187:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("OK 73",5);
^
C:\Program Files (x86)\Arduino\libraries\RF22\RF22.cpp:71:1: error: prototype for 'RF22::RF22(uint8_t, uint8_t, GenericSPIClass*)' does not match any in class 'RF22'
RF22::RF22(uint8_t slaveSelectPin, uint8_t interrupt, GenericSPIClass *spi)
^
In file included from C:\Program Files (x86)\Arduino\libraries\RF22\RF22.cpp:6:0:
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:848:7: error: candidates are: constexpr RF22::RF22(RF22&&)
class RF22
^
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:848:7: error: constexpr RF22::RF22(const RF22&)
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:941:5: error: RF22::RF22(uint8_t, uint8_t, SPIClass*)
RF22(uint8_t slaveSelectPin = SS, uint8_t interrupt = 0, SPIClass *spi = &SPI);
^
Multiple libraries were found for "RTClock.h"
Used: C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\MapleRTC
Multiple libraries were found for "RadioHead.h"
Used: C:\Users\PC\Documents\Arduino\libraries\RadioHead
Not used: C:\Program Files (x86)\Arduino\libraries\RadioHead
exit status 1
Error compiling for board Generic STM32F103C series.
Check the error messages and then you will figure out what to do.
[stevestrong – Sun Apr 01, 2018 9:31 pm] –
Not complicated, you just have to be consequent, and replace all occurrences of the same term.
Check the error messages and then you will figure out what to do.
changed some –
Arduino: 1.8.5 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink, 72Mhz (Normal), Smallest (default)"
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino: In function 'void loop()':
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:160:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("Auto test beacon",16);
^
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:187:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("OK 73",5);
^
C:\Program Files (x86)\Arduino\libraries\RF22\RF22.cpp: In constructor 'RF22::RF22(uint8_t, uint8_t, SPIClass*)':
C:\Program Files (x86)\Arduino\libraries\RF22\RF22.cpp:80:10: error: cannot convert 'SPIClass*' to 'GenericSPIClass*' in assignment
_spi = spi;
^
Multiple libraries were found for "RTClock.h"
Used: C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\MapleRTC
Multiple libraries were found for "RadioHead.h"
Used: C:\Users\PC\Documents\Arduino\libraries\RadioHead
Not used: C:\Program Files (x86)\Arduino\libraries\RadioHead
exit status 1
Error compiling for board Generic STM32F103C series.
[messiah – Mon Apr 02, 2018 3:28 pm] –
changed some –
but not all.
You can eventually get rid of the error messages if you insert at the beginning of the RF22.h file:
#define GenericSPIClass SPIClass
[stevestrong – Mon Apr 02, 2018 4:43 pm] –[messiah – Mon Apr 02, 2018 3:28 pm] –
changed some –but not all.
You can eventually get rid of the error messages if you insert at the beginning of the RF22.h file:
#define GenericSPIClass SPIClass
Otherwise it is cumbersome to indicate what to do to get rid of errors.
The link you inserted in a previous post does not contain RF22.h.
[stevestrong – Mon Apr 02, 2018 7:22 pm] –
You should better post/attach all the source code you are currently using.
Otherwise it is cumbersome to indicate what to do to get rid of errors.
The link you inserted in a previous post does not contain RF22.h.
there only *.cpp file and sketch
right how author put it on his page (its on ukraninan lang all).
here full error log –
Arduino: 1.8.5 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink, 72Mhz (Normal), Smallest (default)"
In file included from C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:2:0:
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:443:25: error: redefinition of 'class SPIClass'
#define GenericSPIClass SPIClass
^
C:\Program Files (x86)\Arduino\libraries\RF22/GenericSPI.h:28:7: note: in expansion of macro 'GenericSPIClass'
class GenericSPIClass
^
In file included from C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:1:0:
C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:176:7: error: previous definition of 'class SPIClass'
class SPIClass {
^
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino: In function 'void loop()':
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:160:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("Auto test beacon",16);
^
C:\Users\PC\Documents\Arduino\sketch's\RF22_CW_beacon\RF22_CW_beacon.ino:187:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
morse_str("OK 73",5);
^
Multiple libraries were found for "RTClock.h"
Used: C:\Users\PC\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\RTClock
Not used: C:\Program Files (x86)\Arduino\libraries\MapleRTC
Multiple libraries were found for "RadioHead.h"
Used: C:\Users\PC\Documents\Arduino\libraries\RadioHead
Not used: C:\Program Files (x86)\Arduino\libraries\RadioHead
exit status 1
Error compiling for board Generic STM32F103C series.
[messiah – Mon Apr 02, 2018 8:20 pm] –
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:443:25: error: redefinition of ‘class SPIClass’
Once again, I cannot find this file: RF22.h.
Where is it?
[stevestrong – Mon Apr 02, 2018 9:19 pm] –[messiah – Mon Apr 02, 2018 8:20 pm] –
C:\Program Files (x86)\Arduino\libraries\RF22/RF22.h:443:25: error: redefinition of ‘class SPIClass’Once again, I cannot find this file: RF22.h.
Where is it?
here – http://www.airspayce.com/mikem/arduino/ … 2-1.40.zip
and here home page of RF22 http://www.airspayce.com/mikem/arduino/RF22/
now all compiling!
here link http://www.diygoodies.org.ua/wp-content … 1/RF22.zip
author page – http://www.diygoodies.org.ua/?lang=en
thanks for help!
i got some issues again…
i forgot that i cleared in my sketch next part –
void AlarmFunction ()
{
//if you want an interrupt every minute...
time_t now = rt.getTime();
rt.setAlarmTime(now + 599);
tm_ptr = rt.getTime(tm_ptr);
Serial.print ("time: ");
Serial.print (tm_ptr->tm_hour);
Serial.print (":");
Serial.print (tm_ptr->tm_min);
Serial.print (":");
Serial.println (tm_ptr->tm_sec);
Serial.print ("date: ");
Serial.print (tm_ptr->tm_mday);
Serial.print ("/");
Serial.print (tm_ptr->tm_mon);
Serial.print ("/");
Serial.println ((1900 + tm_ptr->tm_year));
timeflag=1;
}
srp
[zmemw16 – Wed Apr 04, 2018 8:11 pm] –
i’d look in the .h file and see what calls are actually defined
srp
im quite still new to C++
its quite understandable though
there something more hard than just #define, i think
maybe in whatsit.h
sum(byte i, byte j);
sum(word i, word j);
sum( int i, int j);
the file you will need to look in iis RTClock.h, see what calls are available, is it a typo in your source file
RF22_CW_beacon:35: error: no matching function for call to 'RTClock::getTime(tm*&)'
tm_ptr = rt.getTime(tm_ptr);



