Skip to content
Snippets Groups Projects
Commit 753cf127 authored by Juha Niskanen's avatar Juha Niskanen Committed by Freddie Chopin
Browse files

stm32l4: support flashing L45x/46x devices


Also fixes incorrect comment about MSI range.

Change-Id: If1339a00e50db44195dfcd5c767ba3f5d9035451
Signed-off-by: default avatarJuha Niskanen <juha.niskanen@haltian.com>
Reviewed-on: http://openocd.zylin.com/4122


Tested-by: jenkins
Reviewed-by: default avatarFreddie Chopin <freddie.chopin@gmail.com>
parent f22b89d9
No related branches found
No related tags found
No related merge requests found
...@@ -27,18 +27,22 @@ ...@@ -27,18 +27,22 @@
/* STM32L4xxx series for reference. /* STM32L4xxx series for reference.
* *
* RM0351 * RM0351 (STM32L4x5/STM32L4x6)
* http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/DM00083560.pdf * http://www.st.com/resource/en/reference_manual/dm00083560.pdf
* *
* STM32L476RG Datasheet (for erase timing) * RM0394 (STM32L43x/44x/45x/46x)
* http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00108832.pdf * http://www.st.com/resource/en/reference_manual/dm00151940.pdf
* *
* STM32L476RG Datasheet (for erase timing)
* http://www.st.com/resource/en/datasheet/stm32l476rg.pdf
* *
* The device has normally two banks, but on 512 and 256 kiB devices an * The RM0351 devices have normally two banks, but on 512 and 256 kiB devices
* option byte is available to map all sectors to the first bank. * an option byte is available to map all sectors to the first bank.
* Both STM32 banks are treated as one OpenOCD bank, as other STM32 devices * Both STM32 banks are treated as one OpenOCD bank, as other STM32 devices
* handlers do! * handlers do!
* *
* RM0394 devices have a single bank only.
*
*/ */
/* Erase time can be as high as 25ms, 10x this and assume it's toast... */ /* Erase time can be as high as 25ms, 10x this and assume it's toast... */
...@@ -618,6 +622,9 @@ static int stm32l4_probe(struct flash_bank *bank) ...@@ -618,6 +622,9 @@ static int stm32l4_probe(struct flash_bank *bank)
case 0x415: case 0x415:
max_flash_size_in_kb = 1024; max_flash_size_in_kb = 1024;
break; break;
case 0x462:
max_flash_size_in_kb = 512;
break;
case 0x435: case 0x435:
max_flash_size_in_kb = 256; max_flash_size_in_kb = 256;
break; break;
...@@ -725,8 +732,12 @@ static int get_stm32l4_info(struct flash_bank *bank, char *buf, int buf_size) ...@@ -725,8 +732,12 @@ static int get_stm32l4_info(struct flash_bank *bank, char *buf, int buf_size)
device_str = "STM32L475/476/486"; device_str = "STM32L475/476/486";
break; break;
case 0x462:
device_str = "STM32L45x/46x";
break;
case 0x435: case 0x435:
device_str = "STM32L43x"; device_str = "STM32L43x/44x";
break; break;
default: default:
......
...@@ -75,7 +75,7 @@ $_TARGETNAME configure -event reset-init { ...@@ -75,7 +75,7 @@ $_TARGETNAME configure -event reset-init {
# Use MSI 24 MHz clock, compliant even with VOS == 2. # Use MSI 24 MHz clock, compliant even with VOS == 2.
# 3 WS compliant with VOS == 2 and 24 MHz. # 3 WS compliant with VOS == 2 and 24 MHz.
mww 0x40022000 0x00000103 ;# FLASH_ACR = PRFTBE | 3(Latency) mww 0x40022000 0x00000103 ;# FLASH_ACR = PRFTBE | 3(Latency)
mww 0x40021000 0x00000099 ;# RCC_CR = MSI_ON | MSIRGSEL| MSI Range 10 mww 0x40021000 0x00000099 ;# RCC_CR = MSI_ON | MSIRGSEL | MSI Range 9
# Boost JTAG frequency # Boost JTAG frequency
adapter_khz 4000 adapter_khz 4000
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment