I am getting errors that I dont really understand. This level of coding is well above my head and it seems to be having issues with the RTC.
Arduino: 1.8.4 (Windows 10), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), Serial, 72Mhz (Normal), Smallest (default)"
C:\Users\Dave Morland\Downloads\STM32-O-Scope-master\STM32-O-Scope-master\STM32-O-Scope\STM32-O-Scope.ino: In function 'void showTime()':
STM32-O-Scope:598: error: 'hour' was not declared in this scope
if (hour(tt) < 10) {
^
STM32-O-Scope:601: error: 'hour' was not declared in this scope
TFT.print(hour(tt));
^
STM32-O-Scope:603: error: 'minute' was not declared in this scope
if (minute(tt) < 10) {
^
STM32-O-Scope:606: error: 'minute' was not declared in this scope
TFT.print(minute(tt));
^
STM32-O-Scope:608: error: 'second' was not declared in this scope
if (second(tt) < 10) {
^
STM32-O-Scope:611: error: 'second' was not declared in this scope
TFT.print(second(tt));
^
STM32-O-Scope:613: error: 'day' was not declared in this scope
TFT.print(day(tt));
^
STM32-O-Scope:615: error: 'month' was not declared in this scope
TFT.print(month(tt));
^
STM32-O-Scope:617: error: 'year' was not declared in this scope
TFT.print(year(tt));
^
C:\Users\Dave Morland\Downloads\STM32-O-Scope-master\STM32-O-Scope-master\STM32-O-Scope\STM32-O-Scope.ino: In function 'void setCurrentTime()':
STM32-O-Scope:867: error: 'setTime' was not declared in this scope
setTime(thisArg.toInt());
^
STM32-O-Scope:868: error: 'now' was not declared in this scope
time_t tt = now();
^
C:\Users\Dave Morland\Downloads\STM32-O-Scope-master\STM32-O-Scope-master\STM32-O-Scope\STM32-O-Scope.ino: In function 'void serialCurrentTime()':
STM32-O-Scope:875: error: 'hour' was not declared in this scope
if (hour(tt) < 10) {
^
STM32-O-Scope:878: error: 'hour' was not declared in this scope
serial_debug.print(hour(tt));
^
STM32-O-Scope:880: error: 'minute' was not declared in this scope
if (minute(tt) < 10) {
^
STM32-O-Scope:883: error: 'minute' was not declared in this scope
serial_debug.print(minute(tt));
^
STM32-O-Scope:885: error: 'second' was not declared in this scope
if (second(tt) < 10) {
^
STM32-O-Scope:888: error: 'second' was not declared in this scope
serial_debug.print(second(tt));
^
STM32-O-Scope:890: error: 'day' was not declared in this scope
serial_debug.print(day(tt));
^
STM32-O-Scope:892: error: 'month' was not declared in this scope
serial_debug.print(month(tt));
^
STM32-O-Scope:894: error: 'year' was not declared in this scope
serial_debug.print(year(tt));
^
exit status 1
'hour' was not declared in this scope
the Time.h library should have been named as TimeLib.h
I am now having issues with the RTC that where not there a few months ago.
I have put the latest Roger collection from here viewtopic.php?f=13&t=274 into home or docs/arduino/hardware as per what I understand of the (Roger’s) instructions, and moved other copies into a quarantine folder.
So, I think (do not know) the compiler will be using this latest version.
1. the RTClock.h file includes time.h
2. creating an instance of RTClock stops code from executing.
In this below example, there will be no serial output. I am thinking the code stops at line 7. RTClock rtclock (RTCSEL_LSE);
If this is commented out, then the program will run.
#include <math.h>
#include <RTClock.h>
#define LED_PIN PC13
RTClock rtclock (RTCSEL_LSE); // initialise
void setup() {
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Serial Active...");
}
void loop() {
if(Serial)
Serial.println("Temp mon startup");
delay(1000);
}
I have searched, and can find no other (RTClock.h) files the compiler could use.
These are the includes in RTClock.h:
#include <utility/rtc_util.h>
#include <libmaple/rcc.h>
#include <libmaple/bitband.h>
//#include <time.h>
tim
I tried running the blue pill RTClock test with include timer.h commented out and the compiler returns these errors:
C:\Users\Tim\Documents\CloudStation\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\RTClock\examples\BluePill-RTClock-test/BluePill-RTClock-test.ino:132: warning: undefined reference to `RTClock::setTime(long)’
C:\Users\Tim\Documents\CloudStation\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\RTClock\examples\BluePill-RTClock-test/BluePill-RTClock-test.ino:138: warning: undefined reference to `RTClock::createAlarm(void (*)(), long)’
C:\Users\Tim\Documents\CloudStation\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\RTClock\examples\BluePill-RTClock-test/BluePill-RTClock-test.ino:153: warning: undefined reference to `RTClock::breakTime(long, tm_t&)’
C:\Users\Tim\Documents\CloudStation\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\RTClock\examples\BluePill-RTClock-test/BluePill-RTClock-test.ino:149: warning: undefined reference to `RTClock::setAlarmTime(long)’
C:\Users\Tim\Documents\CloudStation\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\RTClock\examples\BluePill-RTClock-test/BluePill-RTClock-test.ino:164: warning: undefined reference to `RTClock::breakTime(long, tm_t&)’
I did find a time.h file, but the procedures referred to in the above are not in it. They are in the (RTClock) .cpp file.
Also the blue pill will not accept a program (that uses RTClock.h) if the serial monitor is running. This is not usually a problem. It locks with the PC13 led fast flashing until it is reset.
I should be able to get an older version out of github. When I figure out how to do that, I’ll try it and post the results…..
1) Today, I do not get an error with the #include time.h commented out in the RTClock.h file
2) Today, having the serial monitor open does not affect the program upload
grrrrr
For my stupidity part, – Sometime in the past I had turned on verbose output and I assumed that was what I was getting. But it was off, and it was not.
For your request I checked, and turned it on. Now I can see that the compiler is using the files I am expecting it to use.
For the program above that does nothing but tell me if it runs past the line “RTClock rtclock (RTCSEL_LSE); ” which is still does not, and using RC’s latest April 17 build, here is the build output – not verbose as forum limitations will not allow;
Sketch uses 14588 bytes (22%) of program storage space. Maximum is 65536 bytes.
Global variables use 3120 bytes (15%) of dynamic memory, leaving 17360 bytes for local variables. Maximum is 20480 bytes.
maple_loader v0.1
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]…
Found it!
Opening USB Device 0x1eaf:0x0003…
Found Runtime: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=2, name=”STM32duino bootloader v1.0 Upload to Flash 0x8002000″
Setting Configuration 1…
Claiming USB DFU Interface…
Setting Alternate Setting …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=291
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
error resetting after download: usb_reset: could not reset device, win error: The system cannot find the file specified.
thanks, tim
Apologies, thanks etc for time spent on this.
tim

