Yeah.. it's 32 kHz, I need to check with scope on Monday.
Sent from my ONEPLUS A3000 using Tapatalk
SD card file write
Re: SD card file write
And make sure that it's actually oscillating while you're experiencing the time returning zero. With this type of circuit the act of testing with the scope can make the circuit work.
- SureshVakati
- Posts: 42
- Joined: Fri Feb 24, 2017 3:52 pm
Re: SD card file write
When I run Clock Diagnostics using bootloader, it seems External crystal is running.
Micropython time module returns 0, I reinstalled the firmware, still it does the same thing.
Code: Select all
BL>C
ClockDiagnostic
SYS:168000000 H:168000000, P1:42000000, P2:84000000
LSI:31264, LSE:32772
PLL Source
BL>C
ClockDiagnostic
SYS:168000000 H:168000000, P1:42000000, P2:84000000
LSI:31239, LSE:32769
PLL Source
Code: Select all
>>> import pyb, time, os
>>> rtc = pyb.RTC()
>>> rtc.info()
262147
>>> rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
>>> print(rtc.datetime())
(2000, 1, 1, 1, 0, 0, 0, 0)
>>> time.time()
0
>>>
>>>
- SureshVakati
- Posts: 42
- Joined: Fri Feb 24, 2017 3:52 pm
Re: SD card file write
Changed this in stmhal/main.c (false>true), seems RTC is running okay now.
rtc.c has some timeout values, is anything timing it out before initialization?
Code: Select all
#if MICROPY_HW_ENABLE_RTC
if (first_soft_reset) {
rtc_init_start(true);
}
#endif
Code: Select all
#define PYB_LSE_TIMEOUT_VALUE 1000 // ST docs spec 2000 ms LSE startup, seems to be too pessimistic
#define PYB_LSI_TIMEOUT_VALUE 500 // this is way too pessimistic, typ. < 1ms
Re: SD card file write
Only just seen this. Perhaps it explains why a couple of times I've had the experience of files being transmogrified to contain all 1s?dhylands wrote:If you're writing to the sdcard from pyboard, then you really need to make sure you disable USB Mass Storage, otherwise you will get file corruption from the PC also overwriting the data that the pyboard wrote.
Perhaps bozos like me could be reminded somewhere in capital letters ...
regards
Steve
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SD card file write
I think the official docs should discourage the use of MSC mode and point users to tools such as rshell. If it were up to me I'd disable it by default on new boards. But I guess people expect a USB device to appear as a disk...
It's a source of needless problems.
It's a source of needless problems.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.