-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Extraneous FF_PRINTF #55
Comments
How were the SD cards formatted? Judging by the sector count, they should be FAT32, but the start-of-partition magic indicates FAT12. The other branches inside |
They were formatted using this routine:
It produces this output:
and a subsequent FF_SDDiskMount produces:
|
Hi @carlk3,
Is that all you're expecting? The first word of the first cluster contains one of the following values:
These values should be set as in this list, but they're not used to determine the FAT type. The FAT type is determined only by the cluster count:
The
The The question is why
The above code is clear: |
Getting deeper into the code, I see a conflicting assignment: - ulFirstWord = ( uint32_t ) FF_getShort( pxBuffer->pucBuffer, 0x0000 );
+ ulFirstWord = ( uint32_t ) FF_getLong( pxBuffer->pucBuffer, 0x0000 ); That could very well be the cause of the warning that you see? |
Only the first two bytes were considered when reading the end-of-chain value from the FAT table. Extend to 4 bytes and relax requirement for first 3 bits. Make requirement for FAT12 more strict because all valid, non-reserved cluster bits must be set.
Ah ha! Yes, I do believe you've found it. By the way, this question has made me take a closer look at the format routine I'm using (#55 (comment), also at https://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/blob/a4d25f75c41d71cecae8245c5a6ce0e6cb450517/src/FreeRTOS%2BFAT%2BCLI/src/ff_utils.c#L27). It has been years since I looked at it, and now I'm questioning some things. Is it OK to leave Also, re:
Using the SD Memory Card Formatter, I see that it puts:
I would like my routine to do something similar. The |
Researching this, I find that in the BIOS parameter block, number of "hidden" sectors is "the number of sectors between the actual start of the physical disc and the start of the volume". I think that means I wouldn't need to subtract anything; I would just use 8192 to get Partition Starting Offset 4,194,304 bytes. Is that what FF_Partition means by
? |
Answering some of my own questions:
I was going by the suggestion at FF_Partition: "A single partition that fills all available space on the media can be created by simply leaving the structure's xSizes and xPrimaryCount members at zero." However, this gives me an extended partition, which I don't think is what I want since I just want one partition. Comments?
With one primary partition, this seems to be the case: So, this is my revised routine:
|
* Fix FAT32 format check #55 Only the first two bytes were considered when reading the end-of-chain value from the FAT table. Extend to 4 bytes and relax requirement for first 3 bits. Make requirement for FAT12 more strict because all valid, non-reserved cluster bits must be set. * Fix inverted FAT12 logic * Add default heap selection to CMakeListst.txt --------- Co-authored-by: Hein Tibosch <[email protected]> Co-authored-by: Soren Ptak <[email protected]>
Marking this issue as closed as #56 has been merged |
Describe the bug
A concise description of what the bug is. If possible, that is the code is not proprietary, please upload the code in a GitHub fork such that we can reproduce the bug.
Every time I mount a "disk", I get a message:
This comes from:
in
Lab-Project-FreeRTOS-FAT\ff_ioman.c
.I don't know what it means.
I have four SD cards from three different vendors, and they all behave this way:
SandDisk Ultra:
PNY Elite:
SP 3D Nano:
Target
Raspberry Pi Pico
Lab-Project-FreeRTOS-FAT @ 25129e5
Host
FreeRTOS-Kernel @ 1b2b090
To Reproduce
Simply FF_Mount one of these kinds of cards.
Expected behavior
A concise description of what you expected to happen.
I expected no FF_PRINT unless some kind of debug flag was set.
Screenshots
If applicable, add screenshots to help explain your problem.
Wireshark logs
To help us identify the issue and/or reproduce it, please attach Wireshark logs if applicable.
Additional context
Add any other context about the problem here.
e.g. code snippet to reproduce the issue.
e.g. stack trace, memory dump, debugger log, and many etc.
The text was updated successfully, but these errors were encountered: