You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to play around with littlefs for our project for an XMC4500 board. I connected an external NOR FLASH (S25FL) and wrote the driver to interact with the flash. I also created a wrapper function for the lfs to call the read/prog/erase/sync functions, and I allocated a static buffers for the read/prog/lookahead/file.
And during my setup function, lfs_mount is called:
int err = lfs_mount(&lfs, &cfg);
if (err) {
lfs_format(&lfs, &cfg);
lfs_mount(&lfs, &cfg);
}
When the lfs_mount function is called, I received a BusFault Exception:
A precise data access error has occurred (CFSR.PRECISERR, BFAR)
At data address 0xf0116801.
An imprecise data access error has occurred (CFSR.IMPRECISERR, BFAR)
At data address 0xf0116801.
While debugging the problem, I found out that the exception happens in my driver, when I send the read opcode through the SPI.
BYTE cmd = (BYTE) S25FL_READ;
S25FL_ASSERT(spi_hal_send_data(m_uFlashChannels[idx], &cmd, sizeof(cmd), SPI_ACTION_KEEP_CS_AFTER_TRANSFER));
// m_uFlashChannels is an array of Flash channels; In my current case it has only one element
This only happens if the wrapper my_lfs_read is called from lfs; If I called the function independently without lfs, the exception will not happen and my nor flash is read correctly.
From what I'm reading up until now, this can happen if there's a buffer overflow. Did I configure littlefs incorrectly?
The text was updated successfully, but these errors were encountered:
Mounting is now possible. I changed the CACHE_SIZE and LOOKAHEAD_SIZE to 256, and I increased the stack size of my RTOS task to 8192, and now it is possible to read. However, my program hangs again when it tries to call lfs_file_write:
I noticed now, that my littlefs is not working properly..
I thought that mounting lfs was now working, but in my code it is actually having an unexpected behavior.
s25fl_EraseChip(ch_flash); /* Testing to see if the chip will be formatted or not when trying to mount */
int err = lfs_mount(&lfs, &cfg);
if (err) {
lfs_format(&lfs, &cfg);
lfs_mount(&lfs, &cfg);
}
I erased the chip before mounting LFS. I expected that lfs_mount call will fail because the chip is erased completely, and should return an error, but I noticed that it doesn't even go inside the if block where the chip will be formatted to LFS format. @geky did I create my configuration correctly?
Hi,
I want to play around with littlefs for our project for an XMC4500 board. I connected an external NOR FLASH (S25FL) and wrote the driver to interact with the flash. I also created a wrapper function for the lfs to call the read/prog/erase/sync functions, and I allocated a static buffers for the read/prog/lookahead/file.
And during my setup function,
lfs_mount
is called:When the
lfs_mount
function is called, I received a BusFault Exception:While debugging the problem, I found out that the exception happens in my driver, when I send the read opcode through the SPI.
This only happens if the wrapper
my_lfs_read
is called from lfs; If I called the function independently without lfs, the exception will not happen and my nor flash is read correctly.From what I'm reading up until now, this can happen if there's a buffer overflow. Did I configure littlefs incorrectly?
The text was updated successfully, but these errors were encountered: