Hi everyone,
I would like to use the following function to retrieve the current working directory: f_getcwd
TCHAR *filename; //Pointer to the buffer to receive the current directory string
//Get current working directory
fr = f_getcwd (filename,sizeof(filename));
After stepping over this line, the software goes to Default ISR.
I am not sure if I am defining the buffer correctly, there really isn't an example I can follow.
Has someone worked through this issue?
Thanks,
Neil
Ok,
another hint after digging around a bit more:
It seems that it comes from Reset_Handler......
Not sure what or how this is happening???
The Outline only shows you the first match.
I still think you are running into a hard fault. Unless do you have a HardFault_Handler defined in your system (do you?).
Keep in mind that the default handlers are 'weak' (see line 356).
Bottom line: add that hardfault handler as outlined in my article so you know what is happening.
I hope this helps,
Erich
If I am not using PE, how do I go about doing that?
Thanks.
Simply add the 'Extended Handler' from Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse to your application.
Instead of
PE_ISR(Cpu_ivINT_Hard_Fault)
use
void HardFault_Handler(void)
Erich
Hi Erich,
I couldn't figure out how to do what you suggested, but I was to f_getcwd working.
First Declaration:
char filename[256];
Second Function Call:
fr = f_getcwd (filename,sizeof(filename));
Finally, the result:
"1:/", '\0' <repeats 96 times>
LOL....... that's not what I needed. I was looking for the filename: "Log_Data.txt"
Regardless, Thank You for your help.
Hi,
I am also seeing a similar error where the software goes to the HardFault_Handler() on using f_getcwd() function. I have not defined anything in the void HardFault_Handler(void) routine. I am using the LPC1313 microcontroller with LPCOpen library.
Please suggest what may be done.
Thanks and Regards.
keep in mind that FatFS needs more stack than without using FatFS. I suggest you increase the stack size.
Thanks for your suggestion. How do I increase the stack size in LPCxpresso?
Hi,
Could you please suggest to me how to increase the stack size in LPCxpresso?
Thanks.
Hi Neil,
Is that default ISR a hard fault?
I suggest you find out where the it happens, e.g. with Debugging Hard Faults on ARM Cortex-M
I hope this helps,
Erich
Hi Erich,
I don't believe it is, I am pasting what the debugger is showing:
Notice that its not showing the ISR.
I have a picture of the actual spot:
I am not sure if I'm declaring this correct or using it correctly:
//Get current working directory
fr = f_getcwd (filename,sizeof(filename));