Of course, DMA cannot write in CCM and SPI uses DMA. The main() and exceptions stacks are allocated in CCM using that script, automatic variables of the main thread are in CCM by default.
Giovanni
STM32F4 Discovery MMC over SPI how to accelerate
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F4 Discovery MMC over SPI how to accelerate
Awesome! We've nailed the root cause of the issue.
Obviously an easy fix would be not to use CCM, but I'd rather have the extra memory.
So, why does the default CCM .ld place the main() & exception stacks into the toxic CCM? Would not it be safer to make it... safer in the primary chunk of memory?
For my local fix, would it be enough for me to change
to
?
Obviously an easy fix would be not to use CCM, but I'd rather have the extra memory.
So, why does the default CCM .ld place the main() & exception stacks into the toxic CCM? Would not it be safer to make it... safer in the primary chunk of memory?
For my local fix, would it be enough for me to change
Code: Select all
.stacks :
{
xxx
} > [b]ccmram[/b]
to
Code: Select all
.stacks :
{
xxx
} > [b]ram[/b]
?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F4 Discovery MMC over SPI how to accelerate
Hi,
Stacks in CCM are there for performance reasons, accesses to stack are frequent and by putting them in CCM DMA won't affect them. You may try to move the process stack in normal RAM and keep exceptions stack in CCM (DMA is never used there).
Giovanni
Stacks in CCM are there for performance reasons, accesses to stack are frequent and by putting them in CCM DMA won't affect them. You may try to move the process stack in normal RAM and keep exceptions stack in CCM (DMA is never used there).
Giovanni
Re: STM32F4 Discovery MMC over SPI how to accelerate
Dear Giovanni,
On fact my troubles not cleared, but first at all question:
Are you has planed upgrade FatFs to current FatFs R0.10a with according http://elm-chan.org/fsw/ff/00index_e.html ?
I check: enough in chibios-os-various in fatfs_diskio.c in functions disk_read and disk_write instead "byte count" write "UINT count".
And in end-user programs require change arguments f_mount & type of second argument in f_opendir.
Thank you for you reply.
On fact my troubles not cleared, but first at all question:
Are you has planed upgrade FatFs to current FatFs R0.10a with according http://elm-chan.org/fsw/ff/00index_e.html ?
I check: enough in chibios-os-various in fatfs_diskio.c in functions disk_read and disk_write instead "byte count" write "UINT count".
And in end-user programs require change arguments f_mount & type of second argument in f_opendir.
Thank you for you reply.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F4 Discovery MMC over SPI how to accelerate
There is a patch already: http://sourceforge.net/p/chibios/feature-requests/31/
It will be included at some point.
Giovanni
It will be included at some point.
Giovanni
Re: STM32F4 Discovery MMC over SPI how to accelerate
Actual is
Jan 15,'14 R0.10a Added arbitrary strings as drive number in the path name. (_STR_VOLUME_ID)
Added a configuration option of minimum sector size. (_MIN_SS)
2nd argument of f_rename() can have a drive number and it will be ignored.
Fixed f_mount() with forced mount fails when drive number is >= 1.
Fixed f_close() invalidates the file object without volume lock.
Fixed f_closedir() returns but the volume lock is left acquired.
Fixed creation of an entry with LFN fails on too many SFN collisions.
Jan 15,'14 R0.10a Added arbitrary strings as drive number in the path name. (_STR_VOLUME_ID)
Added a configuration option of minimum sector size. (_MIN_SS)
2nd argument of f_rename() can have a drive number and it will be ignored.
Fixed f_mount() with forced mount fails when drive number is >= 1.
Fixed f_close() invalidates the file object without volume lock.
Fixed f_closedir() returns but the volume lock is left acquired.
Fixed creation of an entry with LFN fails on too many SFN collisions.
Re: STM32F4 Discovery MMC over SPI how to accelerate
Giovanni wrote:In general I agree with not having dead loops, this means that the error should be propagated out of wait(), it should not simply return from there.
Just got into this loop once again, created a ticket https://sourceforge.net/p/chibios/bugs/530/