FAT32 library demo - compile error

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
yellowdog
Posts: 5
Joined: 20 Oct 2023 05:22

FAT32 library demo - compile error

#1 Post by yellowdog » 21 Oct 2023 18:50

Dear,

I downloaded the FAT32 library and installed it using the Package Manager. I opened the SD_FAT32.mbpar file in the STM32 M3, M4, M7/SD_MMC_Demo folder.
Build (CTRL + F9) gives an error message: File "__Lib_Stdint.mbas" not found __Lib_FAT32_Types_STM32_M3_M4_M7.mbas

I looked into the installed files, the contents of __Lib_FAT32_Types_STM32_M3_M4_M7.mbas:

structure FAT32_PART
dim State as uint8_t[1] '' partition state. ACTIVE=0x80, INACTIVE=0x00
dim __1 as uint8_t[3]
dim PType as uint8_t[1] '' partition type. FAT16=0x06, FAT32=0x0B
dim __2 as uint8_t[3]
dim Boot as uint8_t[4] '' boot record sector number of partition
dim Size as uint8_t[4] '' partition size in sectors
end structure

This syntax (for example uint8_t[1]) is not Basic but C !
What needs to be done to compile the example?

Thank you!

AntiMember
Posts: 136
Joined: 02 Jan 2020 19:00

Re: FAT32 library demo - compile error

#2 Post by AntiMember » 24 Oct 2023 18:16

Add to project:

Code: Select all

typedef uint8_t  as byte
typedef int8_t   as short
typedef uint16_t as word
typedef int16_t  as integer
typedef uint32_t as longword
typedef int32_t  as longint
typedef uint64_t as uint64
typedef int64_t  as int64

yellowdog
Posts: 5
Joined: 20 Oct 2023 05:22

Re: FAT32 library demo - compile error

#3 Post by yellowdog » 25 Oct 2023 09:16

Thanks for the idea, I fixed everything. Now i get the following error message: Identifier "FAT32_Dir" was not declared - Unit: main.mbas
fat32.png
fat32.png (27.04 KiB) Viewed 470 times


I then tried to compile the "USB_Device_ARM\Examples\ST\MassStorageDevice" example and it succeeded:
msd.png
msd.png (7.14 KiB) Viewed 470 times


I noticed that the Library selections are different. The FAT32_STM32_M3_M4_M7 is missing, it contains for example FAT32_Dir and all instructions. What do I have to do to make it appear correctly in the FAT32 example as well?

Thank you

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: FAT32 library demo - compile error

#4 Post by IvanJeremic » 26 Oct 2023 07:17

Hi,

When installing the library it is only installed for some MCUs, so if you choose some other MCU the library won't appear.

When installing the Library you can add the MCU for which you want the library to be installed for, can not guarantee that it will work for every MCU you add since the Library was made for specific MCUs.

Regards,

Ivan.

yellowdog
Posts: 5
Joined: 20 Oct 2023 05:22

Re: FAT32 library demo - compile error

#5 Post by yellowdog » 26 Oct 2023 15:00

Hi,

I selected the type I also use (32F407VE) and the desired libraries appeared :)
Thank you for the information!

Regards,
Gabor

Post Reply

Return to “mikroC PRO for ARM General”