9542 views|6 replies

87

Posts

0

Resources
The OP
 

The return value of f_read function in FATfs system is FR_INVALID_OBJECT [Copy link]

This post was last edited by fdsf on 2019-1-24 09:43 The function of the code in the red box in the figure is to store the data of the mp3 audio file in databuf so that it can be sent later. Through the single-step test, the res return value is 0x09, and the error is FR_INVALID_OBJECT. The test enters the f_read() function and checks that the value of fil->fs->fs_type is 0, so FR_INVALID_OBJECT is returned. However, fs_type is 0, which means that it is not mounted. I have already mounted the SD card in the main function. What is going on? I also attached the complete code. Please help me take a look when you have time. Thank you.

基于是stm32的MP3播放器code.rar

6.24 MB, downloads: 8

This post is from stm32/stm8

Latest reply

Has the landlord solved this problem?   Details Published on 2023-12-8 17:41
 

244

Posts

0

Resources
2
 
You can try changing the third parameter of mount to 0.
This post is from stm32/stm8

Comments

No, the return value is still FR_INVALID_OBJECT  Details Published on 2019-1-24 09:37
 
 

87

Posts

0

Resources
3
 
muxb posted on 2019-1-24 08:57 You can try to change the third parameter of mount to 0.
No, it still returns the error value FR_INVALID_OBJECT
This post is from stm32/stm8
 
 

87

Posts

0

Resources
4
 
I found that fil->fs->id and fil->id are both 1. Logically, the one I mounted is 0, so it should be 0, right?
This post is from stm32/stm8
 
 
 

87

Posts

0

Resources
5
 
There’s no one here.
This post is from stm32/stm8
 
 
 

413

Posts

7

Resources
6
 

A similar situation occurred with the landlord

Basically it has nothing to do with FF_MAX_SS, since it is already set to 4096.

In my case, if FF_MAX_SS is set to 512 by default and is not changed, a hardware fault will occur.

It may be related to Stack. After increasing 4096, that is, FF_MAX_SS length, it is normal to change from the original 0x200 to the following value

Stack_Size EQU 0x00001200

The reason may be that the data was flushed by the stack operation and rewritten

This post is from stm32/stm8
 
 
 

1

Posts

0

Resources
7
 

Has the landlord solved this problem?

This post is from stm32/stm8
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list