SD Card support for bluepill


#1

hi david
nice to meet you

thanks for your wonderful work

i m trying to use sdcard support for bluepill but i cant find the line in the source where SDCARD_SS_PIN is defined and however when i try to compile with sdcard support i got lot of errors.
Arduino:1.8.9 (Linux), Scheda:“Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), Serial, 72Mhz (Normal), Smallest (default)”

/home/sdbi/Arduino/sketch_may28a/sketch_may28a.ino: In function ‘char* MakeFilename(object*)’:
sketch_may28a:363:29: error: ‘maxbuffer’ was not declared in this scope
int max = maxbuffer(buffer);
^
sketch_may28a:366:28: error: ‘nthchar’ was not declared in this scope
char c = nthchar(arg, i);
^
/home/sdbi/Arduino/sketch_may28a/sketch_may28a.ino: In function ‘int saveimage(object*)’:
sketch_may28a:406:12: error: ‘SDCARD_SS_PIN’ was not declared in this scope
SD.begin(SDCARD_SS_PIN);
^
sketch_may28a:411:38: error: ‘listp’ was not declared in this scope
} else if (arg == NULL || listp(arg)) file = SD.open(“ULISP.IMG”, O_RDWR | O_CREAT | O_TRUNC);
^
sketch_may28a:458:27: error: a function-definition is not allowed here before ‘{’ token
int SDReadInt (File file) {
^
sketch_may28a:477:29: error: a function-definition is not allowed here before ‘{’ token
int loadimage (object *arg) {
^
sketch_may28a:4041:1: error: expected ‘}’ at end of input
}
^

Have you tried sdcard for bluepill board ?
Can you help me ?
Thanks for your time


#2

Hi sdb,

Unfortunately I don’t think the STM32 core includes any SD Card support. I left the code for SD Card support in uLisp in case someone was able to find an external Arduino-compatible library, in which case it should just work.

If you want to try and get it working I’m happy to help.

Regards,
David


#3

Hi davies

searching for sdcard library i found this https://github.com/greiman/SdFat-beta
and looking support for stm32 found this https://platformio.org/lib/show/322/SdFat/examples?file=STM32Test.ino
Maybe am wrong but this seems a good starting point .
Unfortunately knew only a basic c/cc+ and cant find a way.
love common lisp and your work is fantastic and dreams of avr/arm bare lisp machine

ciao from italy


#4

Hi again

and because im using rogerclark core for bluepill
i also discovered this https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Libraries
where sdfat seems to be working

best regards