* STM32 internal flash fix
@ 2008-11-04 8:29 simon.kallweit
2008-11-04 10:08 ` Nick Garnett
0 siblings, 1 reply; 2+ messages in thread
From: simon.kallweit @ 2008-11-04 8:29 UTC (permalink / raw)
To: ecos-patches
[-- Attachment #1: Type: text/plain, Size: 69 bytes --]
This patch fixes flash size detection on early STM32 silicon.
Simon
[-- Attachment #2: stm32_flash_fix_early_silicon.patch --]
[-- Type: text/x-diff, Size: 1578 bytes --]
diff -r 2ce894389251 packages/devs/flash/cortexm/stm32/current/ChangeLog
--- a/packages/devs/flash/cortexm/stm32/current/ChangeLog Mon Nov 03 17:47:29 2008 +0100
+++ b/packages/devs/flash/cortexm/stm32/current/ChangeLog Tue Nov 04 09:23:48 2008 +0100
@@ -1,3 +1,8 @@
+2008-11-04 Simon Kallweit <simon.kallweit@intefo.ch>
+
+ * src/stm32_flash.c:
+ Fixed detection on early silicon.
+
2008-10-07 Nick Garnett <nickg@ecoscentric.com>
* cdl/flash_stm32.cdl:
diff -r 2ce894389251 packages/devs/flash/cortexm/stm32/current/src/stm32_flash.c
--- a/packages/devs/flash/cortexm/stm32/current/src/stm32_flash.c Mon Nov 03 17:47:29 2008 +0100
+++ b/packages/devs/flash/cortexm/stm32/current/src/stm32_flash.c Tue Nov 04 09:23:48 2008 +0100
@@ -118,18 +118,20 @@
stf_diag("sig %08x id %08x\n", sig, id );
- flash_size = 1024*CYGHWR_HAL_STM32_DEV_SIG_FSIZE(sig);
+ flash_size = CYGHWR_HAL_STM32_DEV_SIG_FSIZE(sig);
if( CYGHWR_HAL_STM32_MCU_ID_DEV(id) == CYGHWR_HAL_STM32_MCU_ID_DEV_MEDIUM )
{
block_size = 1024;
- if( flash_size == 0xFFFF ) flash_size = 128*1024;
+ if( flash_size == 0xFFFF ) flash_size = 128;
}
else if( CYGHWR_HAL_STM32_MCU_ID_DEV(id) == CYGHWR_HAL_STM32_MCU_ID_DEV_HIGH )
{
block_size = 2048;
- if( flash_size == 0xFFFF ) flash_size = 512*1024;
+ if( flash_size == 0xFFFF ) flash_size = 512;
}
+
+ flash_size *= 1024;
stm32_dev->block_info[0].blocks = flash_size/block_size;
stm32_dev->block_info[0].block_size = block_size;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: STM32 internal flash fix
2008-11-04 8:29 STM32 internal flash fix simon.kallweit
@ 2008-11-04 10:08 ` Nick Garnett
0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2008-11-04 10:08 UTC (permalink / raw)
To: simon.kallweit; +Cc: ecos-patches
"simon.kallweit@intefo.ch" <simon.kallweit@intefo.ch> writes:
> This patch fixes flash size detection on early STM32 silicon.
Oops, yes. I don't have early silicon so I had no way to test
this.
Checked in.
--
Nick Garnett eCos Kernel Architect
eCosCentric Limited http://www.eCosCentric.com The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No: 4422071
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-04 10:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-04 8:29 STM32 internal flash fix simon.kallweit
2008-11-04 10:08 ` Nick Garnett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).