Hi,
my compiler is mikroPascal PRO for dsPIC v.7.10.
In my project I am using a MicroSD card which I have FAT formatted under Windows 10.
All Mmc functions are working as expected, I can read, write, create directories,
except Mmc_Fat_RenameDir:
Mmc_Fat_RenameDir (filename1, filename2)
At first it seems to work: it renames filename1 to filename2, result is 0 (renaming was successful),
Windows Explorer also shows the renamed directory.
But when trying to open the renamed directory, Windows shows the error:
"The Path is not available..."
Are there known problems with the RenameDir function with Windows 10 formatted MicroSD cards?
Do you have a working example using the RenameDir function?
Regards, Karl
Mmc_Fat_RenameDir
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Mmc_Fat_RenameDir
Hi Karl,
Could you tell me if this happens on other SD cards also?
Could you post the code for review?
Kind regards,
Petar
Could you tell me if this happens on other SD cards also?
Could you post the code for review?
Kind regards,
Petar
Re: Mmc_Fat_RenameDir
Hi Petar,
yes it happens with several MicroSD cards. Equal if formatted with Windows 10 (FAT) or formatted with function Mmc_Fat_QuickFormat.
Here a test code:
The renamed Directory ('DIRy') is shown in Explorer but when trying to open, Windows says:
"The Path is not available...". Attached a Screencopy showing the error.
Best regards,
Karl
yes it happens with several MicroSD cards. Equal if formatted with Windows 10 (FAT) or formatted with function Mmc_Fat_QuickFormat.
Here a test code:
Code: Select all
program MicroSD_Test;
var
Mmc_Chip_Select : sbit at LATG.B9;
Mmc_Chip_Select_Direction : sbit at TRISG.B9;
begin
GIE_bit:=0; // Disable Interrupts globally
SWDTEN_bit:=0; // Disable Watchdog Timer
ANSELA := 0;
ANSELB := 0;
ANSELC := 0;
ANSELD := 0;
ANSELG := 0;
PLLFBD := 68; // MCU 140MHz
CLKDIV := 0x0000;
ACLKCON3 := 0xb4c1; // USB 48 MHz
ACLKDIV3 := 7;
Delay_ms(300);
SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, _SPI_PRESCALE_SEC_1, _SPI_PRESCALE_PRI_64,
_SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
Delay_ms(100);
if Mmc_Fat_Init() = 0 then // reinitialize spi at higher speed
SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, _SPI_PRESCALE_SEC_1, _SPI_PRESCALE_PRI_4,
_SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
Delay_ms(100);
Mmc_Fat_QuickFormat('TEST');
Mmc_Fat_MakeDir('DIRx', 0x10);
Mmc_Fat_RenameDir('DIRx','DIRy');
while (TRUE) do
begin
end;
end.
"The Path is not available...". Attached a Screencopy showing the error.
Best regards,
Karl
- Attachments
-
- Screencopy.JPG (200.31 KiB) Viewed 3263 times
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Mmc_Fat_RenameDir
Hi Karl,
One more thing, could you tell us what MCU/dev board are you using?
Kind regards,
Petar
One more thing, could you tell us what MCU/dev board are you using?
Kind regards,
Petar
Re: Mmc_Fat_RenameDir
Hi Petar,
dspic33ep512mu810
Frequency: 140 MHz
The board is an own development.
Regards,
Karl
dspic33ep512mu810
Frequency: 140 MHz
The board is an own development.
Regards,
Karl
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Mmc_Fat_RenameDir
Hi Karl,
Could you try to reformat the SD card on the windows 7 as fat16?
Kind regards,
Petar
Could you try to reformat the SD card on the windows 7 as fat16?
Kind regards,
Petar
Re: Mmc_Fat_RenameDir
Hi Petar,
I have no Windows 7. But I tried with Windows 8.1 and Windows 10.
Best Regards,
Karl
I have no Windows 7. But I tried with Windows 8.1 and Windows 10.
Best Regards,
Karl
Re: Mmc_Fat_RenameDir
Hi Petar,
could you reproduce in the meanwhile the RenameDir error?
Is there a chance to get a solution?
Best regards,
Karl
could you reproduce in the meanwhile the RenameDir error?
Is there a chance to get a solution?
Best regards,
Karl
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Mmc_Fat_RenameDir
Hi Karl,
I've manage to reproduce the same behavior,
I've reported this bug to our developers, and it will be fixed.
Kind regards,
Petar
I've manage to reproduce the same behavior,
I've reported this bug to our developers, and it will be fixed.
Kind regards,
Petar