Armmite F4: programming the firmware


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 2995
Posted: 07:43am 17 May 2019      

  Quote  I lose the console port ... so I suspect this combination is breaking things somehow.


Your issue is nothing to do with RTC, or ON ERROR but with the WATCHDOG command. Any sort of reset will "lose" the console port, exactly like the MM+ when using the USB console. An error doesn't cancel an ongoing watchdog so after 5 seconds a reset occurs and the USB console drops. If you run your code with the serial console enabled you will see the watchdog timeout occurring.

The attached code works perfectly

Do
WatchDog 5000
On error skip 1
RTC GETTIME
Pause 1000
Print i
i=i+1
Loop