STM32SD on WeAct H563 return Begin not ready

Post here first, or if you can't find a relevant section!
imk
Posts: 40
Joined: Fri Sep 24, 2021 9:26 pm

STM32SD on WeAct H563 return Begin not ready

Post by imk »

Hello,
Am big novice at SD only used it once years ago on PIC and now trying to get SD working on WeAct STM32H563 board Arduino.
I have read much on subject but either missed something on done something dumb.
problem is SD.begin() must be returning false as stays in SD.begin wait for true loop forever, code snippet below also STM32 card and other details.
I get the "Initializing SD card..." msg but then loops awaiting good status.
Card info here https://github.com/WeActStudio/WeActStu ... SchDoc.pdf
WeAct Board I have is version 1.1. Have fitted Micro SD card type HC 64gb this card is working in Windows PC ok.
Help much applicated IMK

Code: Select all

#include <STM32SD.h>

#define SD_DETECT_PIN PA8

void setup() 
{// Open serial communications and wait for port to open:
Serial.begin( 115200 );
while( !Serial ); // wait for serial port to connect. 

Serial.print("Initializing SD card..."); // see if the card is present and can be initialized:
  
SD.setDx( PC8 , PC9 , PC10 , PC11 );
SD.setCMD( PD2 ); 
SD.setCK( PC12 );

while( !SD.begin( SD_DETECT_PIN ) )
 {
 delay(10);
 }
delay(100);
Serial.println("card initialized.");

}
1201 Alarm
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: STM32SD on WeAct H563 return Begin not ready

Post by fpiSTM »

You don't need to set pins they are defined by the variant. I will test next week.
imk
Posts: 40
Joined: Fri Sep 24, 2021 9:26 pm

Re: STM32SD on WeAct H563 return Begin not ready

Post by imk »

fpiSTM wrote: Fri Feb 07, 2025 5:43 pm You don't need to set pins they are defined by the variant. I will test next week.
Hello fpiSTM and many thanks for the reply.
I have Arduino STM32SD 1.4.0 installed and building with Generic H563RGTx
Also I tried both with and without the pins defined and results same.
I look forward to you reply.
Many thanks and good weekend IMK
1201 Alarm
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: STM32SD on WeAct H563 return Begin not ready

Post by fpiSTM »

Why used the generic ? There is a dedicated variant.
https://github.com/stm32duino/Arduino_C ... T_H562RG.h

It us 562 not 563.
imk
Posts: 40
Joined: Fri Sep 24, 2021 9:26 pm

Re: STM32SD on WeAct H563 return Begin not ready

Post by imk »

fpiSTM wrote: Fri Feb 07, 2025 6:36 pm Why used the generic ? There is a dedicated variant.
https://github.com/stm32duino/Arduino_C ... T_H562RG.h

It us 562 not 563.
Hello fpiSTM
I have STM32 board library 2.9.0 installed.
In the menu list, I only have Generic's for STM32H5, below
H503KBUx
H503RBTx
H56311KxQ
H563RGTx
H563R1Tx
H563ZGTx
H563Z1Tx
H57311KxQ
H573R1Tx
H573Z1Tx

Hope that helps imk

PS I just looked in 2.9.0 boards.txt and can see GenH5.menu.pnum.WEACT_H562RG=WeAct H562RGT
But no WeAct H562RGT in menu

Wondering if I should uninstall then reinstall 2.9.0?
1201 Alarm
imk
Posts: 40
Joined: Fri Sep 24, 2021 9:26 pm

Re: STM32SD on WeAct H563 return Begin not ready

Post by imk »

fpiSTM

Interesting update:
I am using IDE 2.3.4 for this and other STM32 G and H mcu's
and have H5 menu items as in previous post!

However I just started up IDE 1.8.19 set STM32H5 and can see the WeAct H562RGT

So it seems some of the STM32 2.9.0 board are not being shown in the IDE 2 board menu list.

Is this something to report here or is arduino IDE forum please?

many thanks imk
1201 Alarm
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: STM32SD on WeAct H563 return Begin not ready

Post by fpiSTM »

I have all boards available. Do don't know why you don't have this one.
imk
Posts: 40
Joined: Fri Sep 24, 2021 9:26 pm

Re: STM32SD on WeAct H563 return Begin not ready

Post by imk »

fpiSTM,

Another update on this SD.begin() returning false.
As mention above WeAct H562RGT was not in IDE 2 menu, but was in IDE 1 menu.
I have deinstalled via IDE the STM32 library, then reinstalled STM32 library from IDE 2 and now WeAct H562RGT is in the IDE2 menu.
Not sure why maybe my 2.9.0 library was old and I have picked up a nightly build 2.9.0 with WeAct H562RGT.

That's the good news :-)
Not so good news is SD.begin() is still returning false, even if I add in the SD.setDx pin defs etc.
I'll get scope out and have a look at pins to see if I can find more info for you.

In mean time have good weekend and I'll look forward to your wisdom when you have to to look.

All best imk
1201 Alarm
imk
Posts: 40
Joined: Fri Sep 24, 2021 9:26 pm

Re: STM32SD on WeAct H563 return Begin not ready

Post by imk »

Hello fpiSTM,
Well I got the scope out and can see signal activity on the default SD pins, including on PC12 8mHz clock.
So I decided to replace the 64Gb micro card with a 4Gb card the result is sd.begin returns true.
And the datalogger example app is successfully writing to the SD card,
I then replaced the 4Gb SD card with a 32Gb SD card this also worked.

So I put the 64Gb SD card in the board again and sd.begin returns false.
Hence it seems that the STM32SD library does not support 64Gb cards .
Thanks for all your help IMK.
1201 Alarm
ag123
Posts: 1898
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: STM32SD on WeAct H563 return Begin not ready

Post by ag123 »

imk wrote: Fri Feb 07, 2025 8:46 pm fpiSTM

Interesting update:
I am using IDE 2.3.4 for this and other STM32 G and H mcu's
and have H5 menu items as in previous post!

However I just started up IDE 1.8.19 set STM32H5 and can see the WeAct H562RGT

So it seems some of the STM32 2.9.0 board are not being shown in the IDE 2 board menu list.

Is this something to report here or is arduino IDE forum please?

many thanks imk
try clearing the cache in IDE 2.0
https://github.com/arduino/arduino-ide/ ... 1152005617
Post Reply

Return to “General discussion”