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

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
lnsri22
Posts: 67
Joined: Fri Aug 17, 2018 12:16 pm
Location: India

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

Post by lnsri22 » Thu Feb 07, 2019 3:02 pm

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!!
lnsri22 :)

Post Reply