Page 1 of 1

OSError EINVAL when trying to open a file in pyboard like hw

Posted: Thu Feb 07, 2019 3:02 pm
by lnsri22
Hello Everyone!!

I have done a custom bootloader for stm32f405vg using IAR workbench. Inside the bootloader, I do the following.
1. Mount a SD card
2. Check for a file named "KTT.bin" in that using

Code: Select all

fr = f_open(&SDFile, CONF_FILENAME, FA_READ);
which returns FatFs Error 4 (FR_NO_FILE) in the absence of file.

3. De_Init the sd card peripheral
4. Jump to application address (Micropython firmware)

Now after booting micropython, I Just create the file with the same name "/sd/KTT.bin" with

Code: Select all

f = open('/sd/KTT.bin','w')
What happens is the file is created randomly and at sometime, it results

Code: Select all

EINVAL[Error 22]
What could be the mistake

Please advice!!