Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only do bank calculation on STM32L4 devices with dual banked flash / Added chip ID 0x464 for STM32L41xxx/L42xxx devices #751

Merged
merged 2 commits into from
Dec 14, 2018

Conversation

dhylands
Copy link
Contributor

RM0394 covers the STM32L41xx, 42xx, 43xx, 44xx, 45xx, and 46xx. These
devices are all employ single banked flash and have chip id's
of 0x464 for the 41xx/42xx, 0x435 for 43xx/44xx, and 0x462 for 45xx/46xx
It's also worth noting that bit 21 of the FLASH_OPTR register is marked
as resevred for these chips, and isn't an indicator of dual banked
flash.

RM0392 covers the STM32L4x1, cpu_id 0x415 and can be dual banked.

RM0351 covers the STM32L4x5/4x6, cpu_ids 0x415 & 0x461 and can be dual
banked

RM0432 covers the STM32L4Rx/4Sx, cpu_id 0x470 and can be dual banked.

This PR modifies the calculate_L4_page functio to only factor bank
calculations for the devices above which can support dual banked flash.

I also checked the STM32L4 HAL code and it uses the following preprocessor #if statment

#if defined (STM32L471xx) || defined (STM32L475xx) || defined (STM32L476xx) || defined (STM32L485xx) || defined (STM32L486xx) || \
    defined (STM32L496xx) || defined (STM32L4A6xx)

to identify dual-banked devices,

RM0394 covers the STM32L41xx, 42xx, 43xx, 44xx, 45xx, and 46xx. These
devices are all employ single banked flash and have chip id's
of 0x464 for the 41xx/42xx, 0x435 for 43xx/44xx, and 0x462 for 45xx/46xx
It's also worth noting that bit 21 of the FLASH_OPTR register is marked
as resevred for these chips, and isn't an indicator of dual banked
flash.

RM0392 covers the STM32L4x1, cpu_id 0x415 and can be dual banked.

RM0351 covers the STM32L4x5/4x6, cpu_ids 0x415 & 0x461 and can be dual
banked

RM0432 covers the STM32L4Rx/4Sx, cpu_id 0x470 and can be dual banked.

This PR modifies the calculate_L4_page functio to only factor bank
calculations for the devices above which can support dual banked flash.
@dhylands dhylands changed the title Only do bank calculatio on SRM32L4 devices with dual banked flash Only do bank calculation on SRM32L4 devices with dual banked flash Dec 13, 2018
@dhylands dhylands changed the title Only do bank calculation on SRM32L4 devices with dual banked flash Only do bank calculation on STM32L4 devices with dual banked flash Dec 13, 2018
@dhylands
Copy link
Contributor Author

I tested this on a NUCLEO-L432KC (single banked device) and NUCLEO-L476RG (dual banked device).

@dhylands
Copy link
Contributor Author

This fixes #750

@xor-gate xor-gate added this to the Next milestone Dec 14, 2018
include/stlink/chipid.h Outdated Show resolved Hide resolved
@dhylands
Copy link
Contributor Author

Whoops - thanks for noticing that. My editor inserted tabs instead of spaces. Fixed.

@xor-gate xor-gate merged commit 0a2b7a4 into stlink-org:master Dec 14, 2018
@xor-gate
Copy link
Member

Thanks!

@Nightwalker-87 Nightwalker-87 removed this from the General milestone Feb 21, 2020
@Nightwalker-87 Nightwalker-87 added this to the v1.6.0 milestone Feb 21, 2020
@Nightwalker-87 Nightwalker-87 self-assigned this Feb 21, 2020
@Nightwalker-87 Nightwalker-87 changed the title Only do bank calculation on STM32L4 devices with dual banked flash Only do bank calculation on STM32L4 devices with dual banked flash / Added chip ID 0x464 for STM32L41xxx/L42xxx devices Mar 20, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flash verification error at 128K mark on STM32L432C6 (NUCLEO-L432KC)
3 participants