---
** [tickets:#156] atsam4sa16c - wrong flash definition**
**Status:** new
**Milestone:** 0.9.0
**Created:** Mon Jun 26, 2017 11:18 AM UTC by Robert Schwarzelt
**Last Updated:** Mon Jun 26, 2017 11:18 AM UTC
**Owner:** nobody
Hi,
Flash Definition of `atsam4sa16c` in `src/flash/nor/at91sam4.c` seems to be
wrong.
`atsam4sa16c` does not have 2 Flash Banks with 512kB each. It's just a single
one with 1024kB.
Fix found below worked fine for me (on `atsam4sa16c-au`).
Regards Robert
~~~
---
src/flash/nor/at91sam4.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c
index ff75b41..8dc1df3 100644
--- a/src/flash/nor/at91sam4.c
+++ b/src/flash/nor/at91sam4.c
@@ -1268,7 +1268,7 @@ static const struct sam4_chip_details all_sam4_details[]
= {
.total_flash_size = 1024 * 1024,
.total_sram_size = 160 * 1024,
.n_gpnvms = 3,
- .n_banks = 2,
+ .n_banks = 1,
/* .bank[0] = { */
{
@@ -1281,24 +1281,8 @@ static const struct sam4_chip_details all_sam4_details[]
= {
.controller_address = 0x400e0a00,
.flash_wait_states = 6, /* workaround silicon
bug */
.present = 1,
- .size_bytes = 512 * 1024,
- .nsectors = 64,
- .sector_size = 8192,
- .page_size = 512,
- },
-
-/* .bank[1] = { */
- {
- .probed = 0,
- .pChip = NULL,
- .pBank = NULL,
- .bank_number = 1,
- .base_address = FLASH_BANK1_BASE_1024K_SD,
- .controller_address = 0x400e0c00,
- .flash_wait_states = 6, /* workaround silicon
bug */
- .present = 1,
- .size_bytes = 512 * 1024,
- .nsectors = 64,
+ .size_bytes = 1024 * 1024,
+ .nsectors = 128,
.sector_size = 8192,
.page_size = 512,
},
--
~~~
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/openocd/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/openocd/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel