SD.begin( ) slow down the program

Post here first, or if you can't find a relevant section!
Post Reply
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

SD.begin( ) slow down the program

Post by Iraton »

I'm using a stm32l432kc and I don't know why if i do the SD.begin() in my program the program slow down (normaly is set to 150ms, but after that command slow down to like 4 second), but if i use only the sd in another program (like the example or anything else) it works fine. This is where i begin the sd (https://github.com/lraton/FlopperZiro/b ... n.ino#L116), after that all my code is slowed down. I already asked in the arduino forum (https://forum.arduino.cc/t/sd-begin-slo ... /1113792/1)
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: SD.begin( ) slow down the program

Post by fpiSTM »

Well if one or more of the libraries you used uses interrupt it could explains this.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

Re: SD.begin( ) slow down the program

Post by Iraton »

I have tried to make a program with all the libraries i use in that program, and the same setup(), and i doen't do the problem
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: SD.begin( ) slow down the program

Post by ag123 »

if you are doing write operations, the timeout can be 100 times longer than the typical program times or 250 ms.
and for read 100 ms
https://www.sdcard.org/downloads/pls/
you may want to check the specs.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

Re: SD.begin( ) slow down the program

Post by Iraton »

Yes i know thatt when i'm writing it slow down, but if i don't do nothing, only the begin, it slow down all up to like 4 seconds
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: SD.begin( ) slow down the program

Post by fpiSTM »

If with SD library only it works but not with all then one of the library slow down the begin. Probably due to interrupt.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

Re: SD.begin( ) slow down the program

Post by Iraton »

I found thatt the problem is the display.display() function of the ssd1306, now i'm testing another library thta use less memory, but it doesn't work
Post Reply

Return to “General discussion”