Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


STM32L073Z-EVAL no flash bank found for address 8018000

imported the demo project from STM32Cube_FW_L0_V1.7.0/Projects/STM32L073Z_EVAL/Demonstrations/SW4STM32/STM32L073Z_EVAL_Demo/ into the ecplise IDE.
build all - everything looks great.
now I try to Debug.

ecplise runs:
/home/me/project/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.9.0.201605241152/tools/openocd/bin/openocd -f stm32l073z_eval.cfg -s /home/me/project/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.9.0.201605241146/resources/openocd/scripts/st_board -s /home/me/project/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.9.0.201605241146/resources/openocd/scripts -c gdb_port 3333
then:
/home/me/project/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.9.0.201605241152/tools/openocd/bin/openocd -f stm32l073z_eval.cfg -s /home/me/project/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.9.0.201605241146/resources/openocd/scripts/st_board -s /home/me/project/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.9.0.201605241146/resources/openocd/scripts -c program Debug/STM32L073Z_EVAL_Demo.elf verify reset exit

and got this output:

Open On-Chip Debugger 0.10.0-dev-00270-g7ec9836 (2016-05-18-11:24)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 300 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.279474
Info : stm32l0.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
adapter speed: 240 kHz
stm32l0.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x080030fc msp: 0x20005000
STM32L0: Enabling HSI16
Info : Unable to match requested speed 2500 kHz, using 1800 kHz
Info : Unable to match requested speed 2500 kHz, using 1800 kHz
adapter speed: 1800 kHz
** Programming Started **
auto erase enabled
Info : Device: STM32L0xx (Cat.5)
Info : STM32L flash has dual banks. Bank (0) size is 96kb, base address is 0x8000000
Warn : couldn't use loader, falling back to page memory writes
Warn : no flash bank found for address 8018000
Warn : no flash bank found for address 8019e14
wrote 98304 bytes from file STM32Cube_FW_L0_V1.7.0/Projects/STM32L073Z_EVAL/Demonstrations/SW4STM32/STM32L073Z_EVAL_Demo/Debug/STM32L073Z_EVAL_Demo.elf in 12.685055s (7.568 KiB/s)
** Programming Finished **
** Verify Started **
Error: JTAG failure
Error: Error setting register
stm32l0.cpu: target state: halted
target halted due to breakpoint, current mode: Handler HardFault
xPSR: 0x61000003 pc: 0x2000002e msp: 0x20005000
Error: checksum mismatch - attempting binary compare
diff 0 address 0x08018000. Was 0x64 instead of 0xc4
diff 1 address 0x08018001. Was 0x69 instead of 0xc5
diff 2 address 0x08018002. Was 0x73 instead of 0xc6
diff 3 address 0x08018003. Was 0x74 instead of 0xc7
diff 4 address 0x08018004. Was 0x72 instead of 0xc8
diff 5 address 0x08018005. Was 0x69 instead of 0xc9
diff 6 address 0x08018006. Was 0x62 instead of 0xca
diff 7 address 0x08018007. Was 0x75 instead of 0xcb
diff 8 address 0x08018008. Was 0x74 instead of 0xcc
diff 9 address 0x08018009. Was 0x69 instead of 0xcd
diff 10 address 0x0801800a. Was 0x6f instead of 0xce
diff 11 address 0x0801800b. Was 0x6e instead of 0xcf
diff 12 address 0x0801800c. Was 0x20 instead of 0xd0
diff 13 address 0x0801800d. Was 0x77 instead of 0xd1
diff 14 address 0x0801800e. Was 0x69 instead of 0xd2
diff 15 address 0x0801800f. Was 0x74 instead of 0xd3
diff 16 address 0x08018010. Was 0x68 instead of 0xd4
diff 17 address 0x08018011. Was 0x6f instead of 0xd5
diff 18 address 0x08018012. Was 0x75 instead of 0xd6
diff 19 address 0x08018013. Was 0x74 instead of 0xd7
diff 20 address 0x08018014. Was 0x20 instead of 0xd8
diff 21 address 0x08018015. Was 0x6f instead of 0xd9
diff 22 address 0x08018016. Was 0x76 instead of 0xda
diff 23 address 0x08018017. Was 0x65 instead of 0xdb
diff 24 address 0x08018018. Was 0x72 instead of 0xdc
diff 25 address 0x08018019. Was 0x73 instead of 0xdd
diff 26 address 0x0801801a. Was 0x61 instead of 0xde
diff 27 address 0x0801801b. Was 0x6d instead of 0xdf
diff 28 address 0x0801801c. Was 0x70 instead of 0xc0
diff 29 address 0x0801801d. Was 0x6c instead of 0xc1
diff 30 address 0x0801801e. Was 0x69 instead of 0xc2
diff 31 address 0x0801801f. Was 0x6e instead of 0xc3
diff 32 address 0x08018020. Was 0x67 instead of 0xc4
diff 33 address 0x08018021. Was 0x00 instead of 0xc5
diff 34 address 0x08018022. Was 0x00 instead of 0xc6
diff 35 address 0x08018023. Was 0x00 instead of 0xc7
diff 36 address 0x08018024. Was 0x20 instead of 0xc8
diff 37 address 0x08018025. Was 0x53 instead of 0xc9
diff 38 address 0x08018026. Was 0x74 instead of 0xca
diff 39 address 0x08018027. Was 0x61 instead of 0xcb
diff 40 address 0x08018028. Was 0x74 instead of 0xcc
diff 41 address 0x08018029. Was 0x69 instead of 0xcd
diff 42 address 0x0801802a. Was 0x73 instead of 0xce
diff 43 address 0x0801802b. Was 0x74 instead of 0xcf
diff 44 address 0x0801802c. Was 0x69 instead of 0xd0
diff 45 address 0x0801802d. Was 0x63 instead of 0xd1
diff 46 address 0x0801802e. Was 0x61 instead of 0xd2
diff 47 address 0x0801802f. Was 0x6c instead of 0xd3
diff 48 address 0x08018030. Was 0x20 instead of 0xd4
diff 49 address 0x08018031. Was 0x64 instead of 0xd5
diff 50 address 0x08018032. Was 0x69 instead of 0xd6
diff 51 address 0x08018033. Was 0x73 instead of 0xf7
diff 52 address 0x08018034. Was 0x74 instead of 0xd8
diff 53 address 0x08018035. Was 0x72 instead of 0xd9
diff 54 address 0x08018036. Was 0x69 instead of 0xda
diff 55 address 0x08018037. Was 0x62 instead of 0xdb
diff 56 address 0x08018038. Was 0x75 instead of 0xdc
diff 57 address 0x08018039. Was 0x74 instead of 0xdd
diff 58 address 0x0801803a. Was 0x69 instead of 0xde
diff 59 address 0x0801803b. Was 0x6f instead of 0x9f
diff 60 address 0x0801803c. Was 0x6e instead of 0x00
diff 61 address 0x0801803d. Was 0x20 instead of 0x04
diff 62 address 0x0801803e. Was 0x77 instead of 0x00
diff 63 address 0x0801803f. Was 0x69 instead of 0x02
diff 64 address 0x08018040. Was 0x74 instead of 0x00
diff 65 address 0x08018041. Was 0x68 instead of 0x01
diff 66 address 0x08018042. Was 0x20 instead of 0x80
diff 67 address 0x08018043. Was 0x6f instead of 0x00
diff 68 address 0x08018044. Was 0x76 instead of 0x40
diff 69 address 0x08018045. Was 0x65 instead of 0x00
diff 70 address 0x08018046. Was 0x72 instead of 0x20
diff 71 address 0x08018047. Was 0x73 instead of 0x00
diff 72 address 0x08018048. Was 0x61 instead of 0x10
diff 73 address 0x08018049. Was 0x6d instead of 0x00
diff 74 address 0x0801804a. Was 0x70 instead of 0x08
diff 75 address 0x0801804b. Was 0x6c instead of 0x00
diff 76 address 0x0801804c. Was 0x69 instead of 0x04
diff 77 address 0x0801804d. Was 0x6e instead of 0x00
diff 78 address 0x0801804e. Was 0x67 instead of 0x02
diff 79 address 0x0801804f. Was 0x20 instead of 0x00
diff 80 address 0x08018050. Was 0x20 instead of 0x00
diff 81 address 0x08018053. Was 0x00 instead of 0x80
diff 82 address 0x08018054. Was 0x20 instead of 0x00
diff 83 address 0x08018055. Was 0x4d instead of 0x40
diff 84 address 0x08018056. Was 0x6f instead of 0x00
diff 85 address 0x08018057. Was 0x76 instead of 0x20
diff 86 address 0x08018058. Was 0x65 instead of 0x00
diff 87 address 0x08018059. Was 0x20 instead of 0x10
diff 88 address 0x0801805a. Was 0x75 instead of 0x00
diff 89 address 0x0801805b. Was 0x70 instead of 0x08
diff 90 address 0x0801805c. Was 0x20 instead of 0x00
diff 91 address 0x0801805d. Was 0x74 instead of 0x40
diff 92 address 0x0801805e. Was 0x68 instead of 0x00
diff 93 address 0x0801805f. Was 0x65 instead of 0x20
diff 94 address 0x08018060. Was 0x20 instead of 0x00
diff 95 address 0x08018061. Was 0x62 instead of 0x10
diff 96 address 0x08018062. Was 0x6f instead of 0x00
diff 97 address 0x08018063. Was 0x61 instead of 0x08
diff 98 address 0x08018064. Was 0x72 instead of 0x00
diff 99 address 0x08018065. Was 0x64 instead of 0x04
diff 100 address 0x08018066. Was 0x20 instead of 0x00
diff 101 address 0x08018067. Was 0x6d instead of 0x02
diff 102 address 0x08018068. Was 0x6f instead of 0xed
diff 103 address 0x08018069. Was 0x72 instead of 0x14
diff 104 address 0x0801806a. Was 0x65 instead of 0x01
diff 105 address 0x0801806b. Was 0x20 instead of 0x08
diff 106 address 0x0801806c. Was 0x74 instead of 0x11
diff 107 address 0x0801806d. Was 0x68 instead of 0x15
diff 108 address 0x0801806e. Was 0x61 instead of 0x01
diff 109 address 0x0801806f. Was 0x6e instead of 0x08
diff 110 address 0x08018070. Was 0x20 instead of 0x35
diff 111 address 0x08018071. Was 0x31 instead of 0x15
diff 112 address 0x08018072. Was 0x2c instead of 0x01
diff 113 address 0x08018073. Was 0x35 instead of 0x08
diff 114 address 0x08018074. Was 0x20 instead of 0x4b
diff 115 address 0x08018075. Was 0x6d instead of 0x15
diff 116 address 0x08018076. Was 0x65 instead of 0x01
diff 117 address 0x08018077. Was 0x74 instead of 0x08
diff 118 address 0x08018078. Was 0x65 instead of 0x61
diff 119 address 0x08018079. Was 0x72 instead of 0x15
diff 120 address 0x0801807a. Was 0x73 instead of 0x01
diff 121 address 0x0801807b. Was 0x20 instead of 0x08
diff 122 address 0x0801807c. Was 0x20 instead of 0x12
diff 123 address 0x0801807d. Was 0x20 instead of 0x0a
diff 124 address 0x0801807e. Was 0x20 instead of 0x00
diff 125 address 0x0801807f. Was 0x20 instead of 0x08
diff 126 address 0x08018080. Was 0x20 instead of 0x36
diff 127 address 0x08018081. Was 0x00 instead of 0x09
More than 128 errors, the rest are not printed.
** Verify Failed **
shutdown command invoked
======



indeed, when running the demo, things that are below 0x8018000 seem to be in place, but code that happened to be on the 2nd bank (above the mentioned address) is corrupted or zeroes (and program crashes of course).

what do I do wrong?

solved:

added a second flash bank to stm32l073z_eval.cfg, right after sourcing stm32l0.cfg:

here is the full fixed file:

# STM32L073Z-EVAL: This is an STM32L0 eval board with a single STM32L073VZT6 
# (192KB) chip.
# ### To be updated ### http://www.st.com/internet/evalboard/product/.jsp

# This is for using the onboard STLINK/V2-1
source [find interface/stlink-v2-1.cfg]

transport select hla_swd

# increase working area to 20KB
set WORKAREASIZE 0x5000

source [find target/stm32l0.cfg]
# NOTE: the following is the added line
flash bank $_FLASHNAME.1 stm32lx 0x08018000 0 0 0 $_TARGETNAME

# use hardware reset, connect under reset
reset_config srst_only srst_nogate


find the file (on my installation, it’s in SystemWorkbench/plugins/fr.ac6.mcu.debug_1.9.0.201605241146/resources/openocd/scripts/st_board/stm32l073z_eval.cfg) and fix it.


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs