From: "simon.kallweit@intefo.ch" <simon.kallweit@intefo.ch>
To: ecos-patches@ecos.sourceware.org
Subject: STM32 internal flash fix
Date: Tue, 04 Nov 2008 08:29:00 -0000 [thread overview]
Message-ID: <491007B6.50204@intefo.ch> (raw)
[-- 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;
next reply other threads:[~2008-11-04 8:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 8:29 simon.kallweit [this message]
2008-11-04 10:08 ` Nick Garnett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=491007B6.50204@intefo.ch \
--to=simon.kallweit@intefo.ch \
--cc=ecos-patches@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).