|
From: Uwe B. <bo...@el...> - 2016-05-22 18:05:18
|
>>>>> "Uwe" == Uwe Bonnes <bo...@el...> writes:
Uwe> Hello, starting openocd after a hardware reset for the first time,
Uwe> the sequence
Uwe> retval = target_read_u32(target, DBGMCU_IDCODE, &device_id); retval
Uwe> = target_read_u16(target, FLASH_SIZE_REG, &flash_size_in_kb);
Uwe> only succeeds for DBGMCU_IDCODE (0xE0042000), while the read for
Uwe> FLASH_SIZE_REG (0x1FFF75E0) fails. This happens with STLINK and
Uwe> Segger STLINK:
Uwe> jaylink: Failed to retrieve serial number: LIBUSB_ERROR_IO. Info :
Uwe> No device selected, using first device. Info : J-Link STLink V21
Uwe> compiled Apr 15 2016 10:47:22 Info : Hardware version: 1.00 Info :
Uwe> VTarget = 3.300 V Info : clock speed 2000 kHz Info : SWD DPIDR
Uwe> 0x2ba01477 Info : stm32f4x.cpu: hardware has 6 breakpoints, 4
Uwe> watchpoints Info : accepting 'gdb' connection on tcp/3333 Info :
Uwe> device id = 0x10006421 Info : flash size = 8192kbytes
Uwe> Now some action that halts the cpu like "halt" is executed and
Uwe> openocd is user terminated.
Uwe> On the next start, flash size register is read right:
Uwe> Info : SWD DPIDR 0x2ba01477 Info : stm32f4x.cpu: hardware has 6
Uwe> breakpoints, 4 watchpoints Info : accepting 'gdb' connection on
Uwe> tcp/3333 Info : device id = 0x10006421 Info : flash size =
Uwe> 512kbytes
More facts: If I remove the WFI() (Wait for interrupt) call in the idle
thread, reading the Flash Size register works as expected.
--
Uwe Bonnes bo...@el...
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
|