Mar 16, 2021
08:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 16, 2021
08:22 AM
Hello ))
I have prepared a code to work with SD card on XMC4800.
in the application I call f_mount/f_open/f_read/f_write and so on.
SD card works fine, all my operations finish successfully (files are read/write) and I call f_close.
As soon as I finish SD read-write, the board does not see buttons pressed anymore.
Means, the PORT15->IN = all time 0 even if button is pressed.
What FATFS has to do with buttons on infineon XMC4800?
What can be a reason?
I have prepared a code to work with SD card on XMC4800.
in the application I call f_mount/f_open/f_read/f_write and so on.
SD card works fine, all my operations finish successfully (files are read/write) and I call f_close.
As soon as I finish SD read-write, the board does not see buttons pressed anymore.
if ( !(PORT15->IN & PORT15_OUT_P13_Msk) // Button1
|| !(PORT15->IN & PORT15_OUT_P12_Msk) // Button2
)
{
PORT5->OMR = 0x00000200; // LED1 ON
}
else
PORT5->OMR = 0x02000000; // LED1 OFF
Means, the PORT15->IN = all time 0 even if button is pressed.
What FATFS has to do with buttons on infineon XMC4800?
What can be a reason?
Solved! Go to Solution.
- Tags:
- IFX
1 Solution
Mar 16, 2021
09:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 16, 2021
09:54 AM
Solution!
My failure was to call
f_mount(&FATFS_0, "0", 1);
where FATFS_0 is a default generated controller.
When I switched to
f_mount(&fs, "0", 1); where "fs" is just my own global application vairable (not local in a function!), everything works fine.
So, I think there was an issue with memory access due to usage of wrong pointer.
My failure was to call
f_mount(&FATFS_0, "0", 1);
where FATFS_0 is a default generated controller.
When I switched to
f_mount(&fs, "0", 1); where "fs" is just my own global application vairable (not local in a function!), everything works fine.
So, I think there was an issue with memory access due to usage of wrong pointer.
1 Reply
Mar 16, 2021
09:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 16, 2021
09:54 AM
Solution!
My failure was to call
f_mount(&FATFS_0, "0", 1);
where FATFS_0 is a default generated controller.
When I switched to
f_mount(&fs, "0", 1); where "fs" is just my own global application vairable (not local in a function!), everything works fine.
So, I think there was an issue with memory access due to usage of wrong pointer.
My failure was to call
f_mount(&FATFS_0, "0", 1);
where FATFS_0 is a default generated controller.
When I switched to
f_mount(&fs, "0", 1); where "fs" is just my own global application vairable (not local in a function!), everything works fine.
So, I think there was an issue with memory access due to usage of wrong pointer.