-->
Page 1 of 2

Write to SD card data dropped on core 3.0.0

PostPosted: Mon Jul 19, 2021 4:39 pm
by Daledj
I have a complex sketch that complies and works fine under core 2.7.4. It uses an RTC1307 clock, WiFi, two sensors (MS5803 or BME280 (onewire at 0x76 and 0x77)), and, obviously, an SD Card (WeMos Micro Shield v1.0.0 at D8). The sketch runs on a LOLIN D1 mini PRO 2.0.0.

When complied under core 3.0.1 it complies and runs but significant numbers of characters are dropped from attempt to write the logfile on the SD Card, resulting in a garbled logfile. As I mentioned, it works fine when complied with core 2.7.4. I'm using the standard SD library: SD.h, SD.open, etc.

The is plenty of memory remaining on both the SD Card and in memory for buffers.

If I write a simple program to write data to the SD Card, I have no issues. So the problem appears to be some interaction between devices or interrupts and the hardware that is cause by 3.0.1 and not caused by 2.7.4.

I would appreciate any suggestions about how to fix or debug the problem.

Re: Write to SD card data dropped on core 3.0.0

PostPosted: Wed Jul 21, 2021 1:34 pm
by pipi61
attach the very minimal program where the error is visible

Re: Write to SD card data dropped on core 3.0.0

PostPosted: Wed Jul 21, 2021 5:19 pm
by AcmeUK
works fine under core 2.7.4

If it isn't broke, why fix it?
We are starting to see numerous posts about problems with V3!
The old maxim regarding a new version of software was don't use it until the dot 3 release.

Re: Write to SD card data dropped on core 3.0.0

PostPosted: Thu Jul 22, 2021 11:02 am
by Daledj
I was able to determine the source of the problem but turning on core debugging. I noticed that in some cases my sketch called fs.begin() multiple times. In 2.7.4 this did not cause a problem, but in 3.0.1 it evidently does. The problem went away when I eliminated the redundant calls to fs.begin().