flash error 0xfffffc7a with stm32

Hi,

I’m not able to flash the STM32 on my Primer1.

I already was successful with an older SVN version under Ubuntu

but with the actual 0.1 release I get an error.

I tried with the rlink driver under XP.

Communication, halt, resume etc. seem to work fine

> flash probe 0
device id = 0x20016410
flash size = 128kbytes
flash 'stm32x' found at 0x08000000

> flash write_image lcdgui.elf
Padding image section 0 with 0 bytes
flash writing failed with error code: 0xfffffc7a
error writing to flash at address 0x08000000 at offset 0x00000000 (-902)

called at file "command.c", line 456
called at file "embedded:startup.tcl", line 89
called at file "embedded:startup.tcl", line 93
>

Don’t know what I’m doing wrong.

could you enable logging?

eg. openocd -d 3 -l openocd.log

Cheers

Spen

Hi Spen,

I did but the file is quite big and I couldn’t

find an option to append it here.

I copied the part where the error happens but

didn’t find any more hints whats going wrong.

I will send you a zip with the whole logging if

you can tell me your e-mail address.

Debug: 1106 24097 rlink.c:499 dtc_run_download(): : 51/18

Debug: 1107 24113 rlink.c:499 dtc_run_download(): : 25/10

Debug: 1108 24113 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load from core reg 15  value 0x20000026
Debug: 1109 24113 rlink.c:499 dtc_run_download(): : 87/30

Debug: 1110 24128 rlink.c:499 dtc_run_download(): : 25/10

Debug: 1111 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register control with value 0x00000002
Debug: 1112 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register faultmask with value 0x00000000
Debug: 1113 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register basepri with value 0x00000000
Debug: 1114 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register primask with value 0x00000000
Debug: 1115 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register psp with value 0x200010e4
Debug: 1116 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register msp with value 0x20004fe0
Debug: 1117 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register xPSR with value 0x61000000
Debug: 1118 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register pc with value 0x08001016
Debug: 1119 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register lr with value 0x00000000
Debug: 1120 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register sp with value 0x200010e4
Debug: 1121 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r12 with value 0xa5a5a5a5
Debug: 1122 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r11 with value 0xa5a5a5a5
Debug: 1123 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r10 with value 0xa5a5a5a5
Debug: 1124 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r9 with value 0xa5a5a5a5
Debug: 1125 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r8 with value 0xa5a5a5a5
Debug: 1126 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r7 with value 0xa5a5a5a5
Debug: 1127 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r6 with value 0xa5a5a5a5
Debug: 1128 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r5 with value 0x2000011c
Debug: 1129 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r4 with value 0xa5a5a5a5
Debug: 1130 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r3 with value 0x00000001
Debug: 1131 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r2 with value 0xa5a5a5a5
Debug: 1132 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r1 with value 0xa5a5a5a5
Debug: 1133 24128 armv7m.c:452 armv7m_run_algorithm(): restoring register r0 with value 0x00000000
Error: 1134 24128 stm32x.c:630 stm32x_write(): flash writing failed with error code: 0xfffffc7a
Error: 1135 24128 flash.c:113 flash_driver_write(): error writing to flash at address 0x08000000 at offset 0x00000000 (-902)
Debug: 1136 24128 command.c:427 run_command(): Command failed with error code -902
User : 1137 24128 command.c:626 openocd_jim_vfprintf(): 
User : 1139 24128 command.c:626 openocd_jim_vfprintf(): 
User : 1141 24128 command.c:626 openocd_jim_vfprintf(): 
User : 1143 24128 command.c:626 openocd_jim_vfprintf(): 
Debug: 1144 24144 rlink.c:499 dtc_run_download(): : 113/40

Debug: 1145 24144 rlink.c:499 dtc_run_download(): : 25/10

Debug: 1146 24253 rlink.c:499 dtc_run_download(): : 63/24

Debug: 1147 24253 rlink.c:499 dtc_run_download(): : 25/10

Sorry that’s not enough info to work with.

The rlink support is still quite new, so you may be better posting to the dev list - https://lists.berlios.de/mailman/listin … evelopment

Cheers

Spen

Good day,

Please have a look at my post at:

viewtopic.php?t=15170

I’ve received a similar error code when the flash sector was still write protected when I try to write data to it.

Regards,

Frikkie Thirion

Hi frix,

protection seems not to be my problem.

flash info 0 reports all sectors as unprotected

flash protect and flash erase_sector commands don’t work anyway.

flash probe shows:

device id = 0x20016410

SWJ-DP STICKY ERROR

dcb_dhcsr 0x30003, nvic_shcsr 0x20000, nvic_cfsr 0x1001, nvic_bfar 0xe000edf8

STM32 flash size failed, probe inaccurate - assuming 128k flash

flash size = 128kbytes

flash ‘stm32x’ found at 0x08000000

or:

device id = 0x20016410

SWJ-DP STICKY ERROR

dcb_dhcsr 0x30003, nvic_shcsr 0x20000, nvic_cfsr 0x1001, nvic_bfar 0xe000edf8

STM32 flash size failed, probe inaccurate - assuming 128k flash

flash size = 128kbytes

flash ‘stm32x’ found at 0x08000000

So what is the SWJ-DP STICKY ERROR all about?

Thanks anyway.

Hello,

I have recently started using OpenOCD ver. 0.1.0

And i am also getting “SIMILAR” error as you did.

It produces following dump in the console of the ECLIPSE.

Open On-Chip Debugger 0.1.0 (2009-01-21-21:15) Release

BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS

$URL: https://kc8apf@svn.berlios.de/svnroot/r … /openocd.c $

500 kHz

500 kHz

Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info : JTAG Tap/device matched

Info : JTAG tap: stm32.bs tap/device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Error: JTAG tap: stm32.bs got: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)

Error: JTAG tap: stm32.bs expected 1 of 1: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)

Error: trying to validate configured JTAG chain anyway…

Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info : JTAG Tap/device matched

Info : JTAG tap: stm32.bs tap/device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Error: JTAG tap: stm32.bs got: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)

Error: JTAG tap: stm32.bs expected 1 of 1: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)

Error: trying to validate configured JTAG chain anyway…

target state: halted

target halted due to debug-request, current mode: Handler HardFault

xPSR: 0x41000003 pc: 0x20000014

verify Capture-IR is disabled

target state: halted

target halted due to debug-request, current mode: Handler HardFault

xPSR: 0x41000003 pc: 0x20000014

Info : device id = 0x10016414

Error: SWJ-DP STICKY ERROR

Error: dcb_dhcsr 0x30003, nvic_shcsr 0x20000, nvic_cfsr 0x1, nvic_bfar 0xe000edf8

Warn : STM32 flash size failed, probe inaccurate - assuming 512k flash

Info : flash size = 512kbytes

Error: stm32x device protected

stm32x mass erase complete

Error: timed out while waiting for target halted

Error: error executing stm32x flash write algorithm

Error: flash writing failed with error code: 0xfffffc7a

Error: error writing to flash at address 0x08000000 at offset 0x00000000 (-902)

By the way, before i got this message, i downloaded program to READ PROTECT the Flash,

using the following code

if(FLASH_GetReadOutProtectionStatus() != SET)

{

FLASH_Unlock();//This MUST done first

FLASH_ReadOutProtection(ENABLE);

NVIC_GenerateSystemReset();

}

Did you get your problem solved?

if so, can you help me in getting this working again?

STICKY ERRORS are almost always bus access errors. That is trying to access nonexistent or otherwise unreadble memory locations.

And trying to read from read protected memory will give you this error.