OpenOCD communication failure with STM32f0 discovery

When running openocd 0.6.1 for the STMf0 by using the ST-link next error appears:

Error: 1132 2735 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

This only happens when the eeprom emulation is used (application note ST → AN4061), when EE_init() is included in the binary.

The problem looks temporary resolved by changing the return value of the function to ‘return ERROR_OK’

Evert Huijben

Axon Digital Design

Debug logging (with the ERROR_OK change but with fault error):

Debug: 640 1093 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 641 1097 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 642 1097 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 643 1098 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 644 1102 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 645 1102 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 646 1103 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 647 1107 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 648 1107 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 649 1108 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 650 1112 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 651 1112 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 652 1113 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 653 1117 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000020

Debug: 654 1117 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x20

Debug: 655 1117 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000002

Debug: 656 1117 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 657 1121 target.c:1983 target_write_u32(): address: 0x40022014, value: 0x08003800

Debug: 658 1121 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022014 4 1

Debug: 659 1125 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000042

Debug: 660 1125 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 661 1129 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 662 1133 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 663 1133 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 664 1134 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 665 1138 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 666 1138 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 667 1139 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 668 1143 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 669 1143 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 670 1144 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 671 1148 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 672 1148 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 673 1149 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 674 1153 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000020

Debug: 675 1153 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x20

Debug: 676 1153 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000002

Debug: 677 1153 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 678 1157 target.c:1983 target_write_u32(): address: 0x40022014, value: 0x08003c00

Debug: 679 1157 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022014 4 1

Debug: 680 1161 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000042

Debug: 681 1161 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 682 1165 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 683 1169 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 684 1169 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 685 1170 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 686 1174 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 687 1174 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 688 1175 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

make: `program’ is up to date.

Debug: 689 1179 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 690 1179 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 691 1180 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 692 1184 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 693 1184 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 694 1185 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 695 1189 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000020

Debug: 696 1189 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x20

Debug: 697 1189 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000002

Debug: 698 1189 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 699 1193 target.c:1983 target_write_u32(): address: 0x40022014, value: 0x08004000

Debug: 700 1193 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022014 4 1

Debug: 701 1197 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000042

Debug: 702 1197 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 703 1201 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 704 1204 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 705 1204 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 706 1205 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 707 1209 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 708 1209 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 709 1210 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 710 1214 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 711 1214 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 712 1215 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 713 1219 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 714 1219 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 715 1220 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 716 1224 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000020

Debug: 717 1224 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x20

Debug: 718 1224 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000002

Debug: 719 1224 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 720 1228 target.c:1983 target_write_u32(): address: 0x40022014, value: 0x08004400

Debug: 721 1228 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022014 4 1

Debug: 722 1232 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000042

Debug: 723 1232 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 724 1236 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 725 1240 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 726 1240 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 727 1241 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 728 1245 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 729 1245 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 730 1246 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 731 1250 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 732 1250 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 733 1251 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 734 1255 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000023

Debug: 735 1255 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x23

Debug: 736 1256 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x4002200c 4 1

Debug: 737 1260 target.c:1917 target_read_u32(): address: 0x4002200c, value: 0x00000020

Debug: 738 1260 stm32f1x.c:168 stm32x_wait_status_busy(): status: 0x20

Debug: 739 1260 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000080

Debug: 740 1260 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 741 1264 target.c:1983 target_write_u32(): address: 0x40022004, value: 0x45670123

Debug: 742 1264 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022004 4 1

Debug: 743 1268 target.c:1983 target_write_u32(): address: 0x40022004, value: 0xcdef89ab

Debug: 744 1268 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022004 4 1

Debug: 745 1272 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000001

Debug: 746 1272 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

Debug: 747 1276 target.c:1470 target_alloc_working_area_try(): MMU disabled, using physical address for working memory 0x20000000

Debug: 748 1276 target.c:1523 target_alloc_working_area_try(): allocated new working area of 60 bytes at address 0x20000000

Debug: 749 1276 target.c:1386 print_wa_layout(): * 0x20000000-0x2000003b (60 bytes)

Debug: 750 1276 target.c:1386 print_wa_layout(): 0x2000003c-0x20001fff (8132 bytes)

Debug: 751 1276 target.c:1688 target_write_buffer(): writing buffer of 60 byte at 0x20000000

Debug: 752 1276 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000000 4 15

Debug: 753 1280 target.c:1523 target_alloc_working_area_try(): allocated new working area of 4096 bytes at address 0x2000003c

Debug: 754 1280 target.c:1386 print_wa_layout(): * 0x20000000-0x2000003b (60 bytes)

Debug: 755 1280 target.c:1386 print_wa_layout(): * 0x2000003c-0x2000103b (4096 bytes)

Debug: 756 1280 target.c:1386 print_wa_layout(): 0x2000103c-0x20001fff (4036 bytes)

Debug: 757 1280 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000044

Debug: 758 1280 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 759 1284 target.c:1983 target_write_u32(): address: 0x20000040, value: 0x20000044

Debug: 760 1284 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000040 4 1

Debug: 761 1288 target.c:1299 target_call_event_callbacks(): target event 3 (resume-start)

Debug: 762 1288 stm32_stlink.c:539 stm32_stlink_resume(): stm32_stlink_resume 0 0x20000000 1 1

Debug: 763 1288 armv7m.c:144 armv7m_restore_context():

Debug: 764 1288 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 765 1290 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 15 value 0x20000000

Debug: 766 1290 armv7m.c:252 armv7m_write_core_reg(): write core reg 15 value 0x20000000

Debug: 767 1290 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 768 1292 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 4 value 0x8000000

Debug: 769 1292 armv7m.c:252 armv7m_write_core_reg(): write core reg 4 value 0x8000000

Debug: 770 1292 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 771 1294 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 3 value 0x2000103c

Debug: 772 1294 armv7m.c:252 armv7m_write_core_reg(): write core reg 3 value 0x2000103c

Debug: 773 1294 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 774 1296 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 2 value 0x2000003c

Debug: 775 1296 armv7m.c:252 armv7m_write_core_reg(): write core reg 2 value 0x2000003c

Debug: 776 1296 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 777 1298 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 1 value 0x2400

Debug: 778 1298 armv7m.c:252 armv7m_write_core_reg(): write core reg 1 value 0x2400

Debug: 779 1298 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 780 1300 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 0 value 0x40022000

Debug: 781 1300 armv7m.c:252 armv7m_write_core_reg(): write core reg 0 value 0x40022000

Debug: 782 1302 target.c:1299 target_call_event_callbacks(): target event 2 (resumed)

Debug: 783 1302 target.c:1299 target_call_event_callbacks(): target event 4 (resume-end)

Debug: 784 1302 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 785 1306 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x20000044

Debug: 786 1306 target.c:866 target_run_flash_async_algorithm(): count 0x2400 wp 0x20000044 rp 0x20000044

Debug: 787 1306 target.c:1688 target_write_buffer(): writing buffer of 4086 byte at 0x20000044

Debug: 788 1306 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000044 4 1021

Debug: 789 1410 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20001038 1 2

Debug: 790 1414 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x2000103a

Debug: 791 1414 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 792 1418 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 793 1422 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x200000ac

Debug: 794 1422 target.c:866 target_run_flash_async_algorithm(): count 0x1c05 wp 0x2000103a rp 0x200000ac

Debug: 795 1422 target.c:1688 target_write_buffer(): writing buffer of 2 byte at 0x2000103a

Debug: 796 1422 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000103a 2 1

Debug: 797 1426 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000044

Debug: 798 1426 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 799 1430 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 800 1475 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x20000250

Debug: 801 1475 target.c:866 target_run_flash_async_algorithm(): count 0x1c04 wp 0x20000044 rp 0x20000250

Debug: 802 1475 target.c:1688 target_write_buffer(): writing buffer of 522 byte at 0x20000044

Debug: 803 1475 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000044 4 130

Debug: 804 1492 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000024c 1 2

Debug: 805 1496 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x2000024e

Debug: 806 1496 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 807 1500 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 808 1504 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x20000bd6

Debug: 809 1504 target.c:866 target_run_flash_async_algorithm(): count 0x1aff wp 0x2000024e rp 0x20000bd6

Debug: 810 1504 target.c:1688 target_write_buffer(): writing buffer of 2438 byte at 0x2000024e

Debug: 811 1504 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000024e 1 2

Debug: 812 1508 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000250 4 609

Debug: 813 1567 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000bd4

Debug: 814 1567 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 815 1571 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 816 1575 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x200002b6

Debug: 817 1575 target.c:866 target_run_flash_async_algorithm(): count 0x163c wp 0x20000bd4 rp 0x200002b6

Debug: 818 1575 target.c:1688 target_write_buffer(): writing buffer of 1128 byte at 0x20000bd4

Debug: 819 1575 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000bd4 4 282

Debug: 820 1606 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000044

Debug: 821 1606 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 822 1610 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 823 1614 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x20000806

Debug: 824 1614 target.c:866 target_run_flash_async_algorithm(): count 0x1408 wp 0x20000044 rp 0x20000806

Debug: 825 1614 target.c:1688 target_write_buffer(): writing buffer of 1984 byte at 0x20000044

Debug: 826 1614 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000044 4 496

Debug: 827 1665 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000804

Debug: 828 1665 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 829 1669 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 830 1673 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x2000100e

Debug: 831 1673 target.c:866 target_run_flash_async_algorithm(): count 0x1028 wp 0x20000804 rp 0x2000100e

Debug: 832 1673 target.c:1688 target_write_buffer(): writing buffer of 2056 byte at 0x20000804

Debug: 833 1673 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000804 4 514

Debug: 834 1762 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x2000100c

Debug: 835 1762 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 836 1766 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 837 1770 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x2000086e

Debug: 838 1770 target.c:866 target_run_flash_async_algorithm(): count 0xc24 wp 0x2000100c rp 0x2000086e

Debug: 839 1770 target.c:1688 target_write_buffer(): writing buffer of 48 byte at 0x2000100c

Debug: 840 1770 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000100c 4 12

Debug: 841 1774 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000044

Debug: 842 1774 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 843 1778 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 844 1782 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x20000a10

Debug: 845 1782 target.c:866 target_run_flash_async_algorithm(): count 0xc0c wp 0x20000044 rp 0x20000a10

Debug: 846 1782 target.c:1688 target_write_buffer(): writing buffer of 2506 byte at 0x20000044

Debug: 847 1782 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000044 4 626

Debug: 848 1878 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000a0c 1 2

Debug: 849 1882 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000a0e

Debug: 850 1882 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 851 1886 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 852 1890 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x200000ac

Debug: 853 1890 target.c:866 target_run_flash_async_algorithm(): count 0x727 wp 0x20000a0e rp 0x200000ac

Debug: 854 1890 target.c:1688 target_write_buffer(): writing buffer of 1582 byte at 0x20000a0e

Debug: 855 1890 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000a0e 1 2

Debug: 856 1894 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000a10 4 395

Debug: 857 1934 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000044

Debug: 858 1934 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 859 1938 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 860 1942 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x200007c0

Debug: 861 1942 target.c:866 target_run_flash_async_algorithm(): count 0x410 wp 0x20000044 rp 0x200007c0

Debug: 862 1942 target.c:1688 target_write_buffer(): writing buffer of 1914 byte at 0x20000044

Debug: 863 1942 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000044 4 478

Debug: 864 2024 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x200007bc 1 2

Debug: 865 2028 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x200007be

Debug: 866 2028 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 867 2032 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x20000040 4 1

Debug: 868 2036 target.c:1917 target_read_u32(): address: 0x20000040, value: 0x200000ac

Debug: 869 2036 target.c:866 target_run_flash_async_algorithm(): count 0x53 wp 0x200007be rp 0x200000ac

Debug: 870 2036 target.c:1688 target_write_buffer(): writing buffer of 166 byte at 0x200007be

Debug: 871 2036 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x200007be 1 2

Debug: 872 2040 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x200007c0 4 41

Debug: 873 2046 target.c:1983 target_write_u32(): address: 0x2000003c, value: 0x20000864

Debug: 874 2046 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x2000003c 4 1

Debug: 875 2052 target.c:2449 target_wait_state(): waiting for target halted…

Debug: 876 2092 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 877 2094 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 0 value 0x20

Debug: 878 2094 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 879 2096 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 1 value 0x0

Debug: 880 2096 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 881 2098 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 2 value 0x2000003c

Debug: 882 2098 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 883 2100 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 3 value 0x2000103c

Debug: 884 2100 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 885 2102 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 4 value 0x8004800

Debug: 886 2102 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 887 2104 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 5 value 0x20000864

Debug: 888 2104 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 889 2106 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 6 value 0x20

Debug: 890 2106 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 891 2108 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 7 value 0x14

Debug: 892 2108 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 893 2110 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 8 value 0xffffffff

Debug: 894 2110 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 895 2112 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 9 value 0xffffffff

Debug: 896 2112 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 897 2114 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 10 value 0xffffffff

Debug: 898 2114 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 899 2116 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 11 value 0xffffffff

Debug: 900 2116 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 901 2118 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 12 value 0xffffffff

Debug: 902 2118 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 903 2120 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 13 value 0x20002000

Debug: 904 2120 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 905 2122 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 14 value 0xffffffff

Debug: 906 2122 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 907 2124 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 15 value 0x2000003a

Debug: 908 2124 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 909 2126 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 16 value 0x61000000

Debug: 910 2126 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 911 2128 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 17 value 0x20002000

Debug: 912 2128 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 913 2130 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 18 value 0xfffffffc

Debug: 914 2130 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 915 2132 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 19 value 0x0

Debug: 916 2132 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 917 2134 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 20 value 0x0

Debug: 918 2134 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 919 2136 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 21 value 0x0

Debug: 920 2136 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 921 2138 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 22 value 0x0

Debug: 922 2138 stm32_stlink.c:372 stlink_debug_entry(): entered debug state in core mode: Thread at PC 0x2000003a, target->state: halted

Debug: 923 2138 target.c:1299 target_call_event_callbacks(): target event 0 (gdb-halt)

Debug: 924 2138 target.c:1299 target_call_event_callbacks(): target event 1 (halted)

User : 925 2138 target.c:1672 target_arch_state(): target state: halted

User : 926 2138 armv7m.c:517 armv7m_arch_state(): target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000003a msp: 0x20002000

Debug: 927 2138 stm32_stlink.c:405 stm32_stlink_poll(): halted: PC: 0x2000003a

Debug: 928 2138 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 929 2140 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 15 value 0x2000003a

Debug: 930 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register xPSR with value 0xc1000000

Debug: 931 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register pc with value 0x08004470

Debug: 932 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r7 with value 0xffffffff

Debug: 933 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r6 with value 0xffffffff

Debug: 934 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r5 with value 0xffffffff

Debug: 935 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r4 with value 0xffffffff

Debug: 936 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r3 with value 0xffffffff

Debug: 937 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r2 with value 0xffffffff

Debug: 938 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r1 with value 0xffffffff

Debug: 939 2140 armv7m.c:485 armv7m_wait_algorithm(): restoring register r0 with value 0xffffffff

Debug: 940 2140 target.c:1592 target_free_working_area_restore(): freed 4096 bytes of working area at address 0x2000003c

Debug: 941 2140 target.c:1386 print_wa_layout(): * 0x20000000-0x2000003b (60 bytes)

Debug: 942 2140 target.c:1386 print_wa_layout(): 0x2000003c-0x20001fff (8132 bytes)

Debug: 943 2140 target.c:1592 target_free_working_area_restore(): freed 60 bytes of working area at address 0x20000000

Debug: 944 2140 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

Debug: 945 2140 target.c:1983 target_write_u32(): address: 0x40022010, value: 0x00000080

Debug: 946 2140 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x40022010 4 1

User : 947 2144 command.c:549 command_print(): wrote 18432 bytes from file /home/evert/sandbox/STM32f0xxBootloader/main.bin in 1.649204s (10.914 KiB/s)

Debug: 948 2144 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_sleep 100

Debug: 949 2144 command.c:145 script_debug(): command - sleep ocd_sleep 100

Debug: 950 2144 log.c:422 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1102). This may cause trouble with GDB connections.

Debug: 953 2290 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_verify_image /home/evert/sandbox/STM32f0xxBootloader/main.bin 0x08000000

Debug: 954 2291 command.c:145 script_debug(): command - verify_image ocd_verify_image /home/evert/sandbox/STM32f0xxBootloader/main.bin 0x08000000

Debug: 956 2293 configuration.c:86 find_file(): found /home/evert/sandbox/STM32f0xxBootloader/main.bin

Debug: 957 2293 configuration.c:86 find_file(): found /home/evert/sandbox/STM32f0xxBootloader/main.bin

Debug: 958 2293 image.c:1007 image_calculate_checksum(): Calculating checksum

Debug: 959 2293 image.c:1038 image_calculate_checksum(): Calculating checksum done

Debug: 960 2293 target.c:1523 target_alloc_working_area_try(): allocated new working area of 52 bytes at address 0x20000000

Debug: 961 2293 target.c:1386 print_wa_layout(): * 0x20000000-0x20000033 (52 bytes)

Debug: 962 2293 target.c:1386 print_wa_layout(): 0x20000034-0x20001fff (8140 bytes)

Debug: 963 2293 target.c:1688 target_write_buffer(): writing buffer of 52 byte at 0x20000000

Debug: 964 2293 stm32_stlink.c:717 stm32_stlink_write_memory(): stm32_stlink_write_memory 0x20000000 4 13

Debug: 965 2297 target.c:1299 target_call_event_callbacks(): target event 3 (resume-start)

Debug: 966 2297 stm32_stlink.c:539 stm32_stlink_resume(): stm32_stlink_resume 0 0x20000000 1 1

Debug: 967 2297 armv7m.c:144 armv7m_restore_context():

Debug: 968 2297 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 969 2299 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 16 value 0xc1000000

Debug: 970 2299 armv7m.c:252 armv7m_write_core_reg(): write core reg 16 value 0xc1000000

Debug: 971 2299 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 972 2301 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 15 value 0x20000000

Debug: 973 2301 armv7m.c:252 armv7m_write_core_reg(): write core reg 15 value 0x20000000

Debug: 974 2301 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 975 2303 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 7 value 0xffffffff

Debug: 976 2303 armv7m.c:252 armv7m_write_core_reg(): write core reg 7 value 0xffffffff

Debug: 977 2303 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 978 2305 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 6 value 0xffffffff

Debug: 979 2305 armv7m.c:252 armv7m_write_core_reg(): write core reg 6 value 0xffffffff

Debug: 980 2305 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 981 2307 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 5 value 0xffffffff

Debug: 982 2307 armv7m.c:252 armv7m_write_core_reg(): write core reg 5 value 0xffffffff

Debug: 983 2307 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 984 2309 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 4 value 0xffffffff

Debug: 985 2309 armv7m.c:252 armv7m_write_core_reg(): write core reg 4 value 0xffffffff

Debug: 986 2309 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 987 2311 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 3 value 0xffffffff

Debug: 988 2311 armv7m.c:252 armv7m_write_core_reg(): write core reg 3 value 0xffffffff

Debug: 989 2311 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 990 2313 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 2 value 0xffffffff

Debug: 991 2313 armv7m.c:252 armv7m_write_core_reg(): write core reg 2 value 0xffffffff

Debug: 992 2313 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 993 2315 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 1 value 0x459c

Debug: 994 2315 armv7m.c:252 armv7m_write_core_reg(): write core reg 1 value 0x459c

Debug: 995 2315 stm32_stlink.c:155 stm32_stlink_store_core_reg_u32(): stm32_stlink_store_core_reg_u32

Debug: 996 2317 stm32_stlink.c:185 stm32_stlink_store_core_reg_u32(): write core reg 0 value 0x8000000

Debug: 997 2317 armv7m.c:252 armv7m_write_core_reg(): write core reg 0 value 0x8000000

Debug: 998 2319 target.c:1299 target_call_event_callbacks(): target event 2 (resumed)

Debug: 999 2319 target.c:1299 target_call_event_callbacks(): target event 4 (resume-end)

Debug: 1000 2321 target.c:2449 target_wait_state(): waiting for target halted…

Debug: 1001 2564 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1002 2566 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 0 value 0x1a8054cf

Debug: 1003 2566 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1004 2568 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 1 value 0x2000000

Debug: 1005 2568 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1006 2570 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 2 value 0x8000000

Debug: 1007 2570 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1008 2572 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 3 value 0x459c

Debug: 1009 2572 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1010 2574 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 4 value 0x459c

Debug: 1011 2574 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1012 2576 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 5 value 0x8

Debug: 1013 2576 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1014 2578 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 6 value 0x4c11db7

Debug: 1015 2578 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1016 2580 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 7 value 0xffffffff

Debug: 1017 2580 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1018 2582 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 8 value 0xffffffff

Debug: 1019 2582 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1020 2584 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 9 value 0xffffffff

Debug: 1021 2584 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1022 2586 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 10 value 0xffffffff

Debug: 1023 2586 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1024 2588 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 11 value 0xffffffff

Debug: 1025 2588 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1026 2590 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 12 value 0xffffffff

Debug: 1027 2590 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1028 2592 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 13 value 0x20002000

Debug: 1029 2592 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1030 2594 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 14 value 0xffffffff

Debug: 1031 2594 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1032 2596 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 15 value 0x2000002e

Debug: 1033 2596 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1034 2598 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 16 value 0x61000000

Debug: 1035 2598 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1036 2600 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 17 value 0x20002000

Debug: 1037 2600 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1038 2602 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 18 value 0xfffffffc

Debug: 1039 2602 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1040 2604 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 19 value 0x0

Debug: 1041 2604 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1042 2606 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 20 value 0x0

Debug: 1043 2606 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1044 2608 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 21 value 0x0

Debug: 1045 2608 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1046 2610 stm32_stlink.c:136 stm32_stlink_load_core_reg_u32(): load from special reg 22 value 0x0

Debug: 1047 2610 stm32_stlink.c:372 stlink_debug_entry(): entered debug state in core mode: Thread at PC 0x2000002e, target->state: halted

Debug: 1048 2610 target.c:1299 target_call_event_callbacks(): target event 0 (gdb-halt)

Debug: 1049 2610 target.c:1299 target_call_event_callbacks(): target event 1 (halted)

User : 1050 2610 target.c:1672 target_arch_state(): target state: halted

User : 1051 2610 armv7m.c:517 armv7m_arch_state(): target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000

Debug: 1052 2610 stm32_stlink.c:405 stm32_stlink_poll(): halted: PC: 0x2000002e

Debug: 1053 2610 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1054 2612 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 15 value 0x2000002e

Debug: 1055 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register xPSR with value 0xc1000000

Debug: 1056 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register pc with value 0x08004470

Debug: 1057 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r6 with value 0xffffffff

Debug: 1058 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r5 with value 0xffffffff

Debug: 1059 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r4 with value 0xffffffff

Debug: 1060 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r3 with value 0xffffffff

Debug: 1061 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r2 with value 0xffffffff

Debug: 1062 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r1 with value 0xffffffff

Debug: 1063 2612 armv7m.c:485 armv7m_wait_algorithm(): restoring register r0 with value 0xffffffff

Debug: 1064 2612 target.c:1592 target_free_working_area_restore(): freed 52 bytes of working area at address 0x20000000

Debug: 1065 2612 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

User : 1066 2612 command.c:549 command_print(): verified 17820 bytes in 0.319085s (54.538 KiB/s)

Debug: 1067 2612 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_sleep 100

Debug: 1068 2612 command.c:145 script_debug(): command - sleep ocd_sleep 100

Debug: 1071 2715 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset run

Debug: 1072 2715 command.c:145 script_debug(): command - reset ocd_reset run

Debug: 1074 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target names

Debug: 1075 2717 command.c:145 script_debug(): command - ocd_target ocd_target names

Debug: 1076 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-start

Debug: 1077 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-start

Debug: 1078 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init-reset

Debug: 1079 2717 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init-reset

Debug: 1081 2717 stlink_transport.c:37 stlink_transport_jtag_command(): stlink_transport_jtag_command

Debug: 1082 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -chain-position

Debug: 1083 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -chain-position

Debug: 1084 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1085 2717 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1086 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event examine-start

Debug: 1087 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event examine-start

Debug: 1088 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu arp_examine

Debug: 1089 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu arp_examine

Debug: 1090 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event examine-end

Debug: 1091 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event examine-end

Debug: 1092 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-assert-pre

Debug: 1093 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-assert-pre

Debug: 1094 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -chain-position

Debug: 1095 2717 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -chain-position

Debug: 1096 2717 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1097 2718 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1098 2718 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu arp_reset assert 0

Debug: 1099 2718 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu arp_reset assert 0

Debug: 1100 2718 target.c:1620 target_free_all_working_areas_restore(): freeing all working areas

Debug: 1101 2718 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

Debug: 1102 2718 stm32_stlink.c:418 stm32_stlink_assert_reset(): stm32_stlink_assert_reset

Debug: 1103 2718 stlink_interface.c:125 stlink_interface_execute_queue(): stlink_interface_execute_queue: ignored

Debug: 1104 2718 core.c:715 jtag_add_reset(): SRST line asserted

Debug: 1105 2725 stlink_usb.c:788 stlink_usb_reset(): RESET: 0x00000080

Debug: 1106 2725 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-assert-post

Debug: 1107 2725 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-assert-post

Debug: 1108 2725 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-deassert-pre

Debug: 1109 2725 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-deassert-pre

Debug: 1110 2725 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -chain-position

Debug: 1111 2725 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -chain-position

Debug: 1112 2725 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1113 2725 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1114 2725 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu arp_reset deassert 0

Debug: 1115 2725 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu arp_reset deassert 0

Debug: 1116 2725 target.c:1620 target_free_all_working_areas_restore(): freeing all working areas

Debug: 1117 2725 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

Debug: 1118 2725 stm32_stlink.c:476 stm32_stlink_deassert_reset(): stm32_stlink_deassert_reset

Debug: 1119 2727 stlink_interface.c:125 stlink_interface_execute_queue(): stlink_interface_execute_queue: ignored

Debug: 1120 2727 core.c:719 jtag_add_reset(): SRST line released

Debug: 1121 2727 target.c:1299 target_call_event_callbacks(): target event 3 (resume-start)

Debug: 1122 2727 stm32_stlink.c:539 stm32_stlink_resume(): stm32_stlink_resume 1 0x00000000 0 0

Debug: 1123 2727 stm32_stlink.c:669 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x08004470 2 1

Debug: 1124 2731 target.c:1941 target_read_u16(): address: 0x08004470, value: 0x480d

Debug: 1125 2731 armv7m.c:144 armv7m_restore_context():

Debug: 1126 2733 target.c:1299 target_call_event_callbacks(): target event 2 (resumed)

Debug: 1127 2733 target.c:1299 target_call_event_callbacks(): target event 4 (resume-end)

Debug: 1128 2733 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-deassert-post

Debug: 1129 2733 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-deassert-post

Debug: 1130 2733 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-end

Debug: 1131 2733 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-end

Error: 1132 2735 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

Debug: 1133 2735 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_shutdown

Debug: 1134 2735 command.c:145 script_debug(): command - shutdown ocd_shutdown

Error: 1135 2737 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

User : 1137 2737 server.c:580 handle_shutdown_command(): shutdown command invoked

Debug: 1138 2737 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init

Debug: 1139 2737 command.c:145 script_debug(): command - init ocd_init

Error: 1140 2739 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

Debug: 1142 2739 stlink_interface.c:99 stlink_interface_quit(): stlink_interface_quit

**** Build Finished ****

Hello Evert,

I just skimmed AP4061 and the code. It appears EE_Init() writes to Flash when called, typically a few bytes, but possibly a page. This next question sounds like nit-picking, but it is intended to be helpful:

Do you know, or can you determine, whether the openOCD communication fault occurs before EE_Init() is called? You might have to re-write or create a test application where EE_Init() is triggered by a button click, etc.

If the OpenOCD comm fault only occurs during or after the application writing to flash, I suspect you’re getting into territory that few (if any) have examined in much detail.

On the other hand, if the mere presence of the EE_Init() code somehow causes a fault, even before it is executed, that sounds more like a bug.

-Hugh

Hello Hugh,

The problem appears when I program the discovery board, this fails when I am using openOCD/ST-link in combination with the provided scripts.

When I am using the STM32 ST-link utility for writing to flash it works fine.

When I do not call EE_init in my code it is working fine with openOCD.

One strange thing I see in the logging is that functions are used for the armv7 architecture while the Cortex-M0 is using the armv6 architecture?

Regards,

Evert Huijben

Do not worry about the function names, they are more historical than anything else.

I may have some time to look into this tomorrow, it certainly sounds like a odd one.

Just one question does the code run OK, as it would not be the first time a user program crashing causes issues with debugging.

Spen

Hi Spen,

The code is running as expected when i omit the ee_init() function. Also when I program the board by using the STM32 st-link utility it went fine (including EE_init())

Evert

Ok i have looked into this and it seem the stlink is returning an STLINK_SWD_AP_WAIT - this is nothing to worry about and is an internal debug msg.

The error is reported by OpenOCD but as such is ignored as it will retry the polling again, which it does and the next time it suceeds.

Is this causing an issue, as other than the msg all is working as expected.

Cheers

Spen

Hi Spen,

Thank you for the investigation,

This error is indeed reported by OpenOCD, but without any patch OpenOCD is failing. The logging I have submitted in my post is including a patch which is ignoring the error.

Including this patch there is no issue, however I think the issue should be resolved in a proper way in archive,

Regards,

Evert

Evert,

You are going to have to give me more info, as i do not see a problem.

I agree you will get a message about “invalid mode value” etc, but this should not stop OpenOCD from working the next time it attempts to poll the target.

Can you you show me the debug log with the code unpatched ?

Cheers

Spen

Hello Spen,

Sorry, it’s a while ago I have worked on this topic, however I’ve generated debug logging without any patch:

It’s all about this line: Error: 1487 3937 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

It is strange that armv7m is mentioned while the cortex-m0 micro has a armv6 architecture.

Here is the logging:

Debug: 1407 3717 stm32_stlink.c:404 stm32_stlink_poll(): halted: PC: 0x2000002e

Debug: 1408 3717 stm32_stlink.c:56 stm32_stlink_load_core_reg_u32(): stm32_stlink_load_core_reg_u32

Debug: 1409 3719 stm32_stlink.c:71 stm32_stlink_load_core_reg_u32(): load from core reg 15 value 0x2000002e

Debug: 1410 3719 armv7m.c:485 armv7m_wait_algorithm(): restoring register xPSR with value 0xc1000000

Debug: 1411 3719 armv7m.c:485 armv7m_wait_algorithm(): restoring register pc with value 0x080050d4

Debug: 1412 3719 armv7m.c:485 armv7m_wait_algorithm(): restoring register r6 with value 0xffffffff

Debug: 1413 3719 armv7m.c:485 armv7m_wait_algorithm(): restoring register r5 with value 0xffffffff

Debug: 1414 3814 armv7m.c:485 armv7m_wait_algorithm(): restoring register r4 with value 0xffffffff

Debug: 1415 3814 armv7m.c:485 armv7m_wait_algorithm(): restoring register r3 with value 0xffffffff

Debug: 1416 3814 armv7m.c:485 armv7m_wait_algorithm(): restoring register r2 with value 0xffffffff

Debug: 1417 3814 armv7m.c:485 armv7m_wait_algorithm(): restoring register r1 with value 0xffffffff

Debug: 1418 3814 armv7m.c:485 armv7m_wait_algorithm(): restoring register r0 with value 0xffffffff

Debug: 1419 3814 target.c:1592 target_free_working_area_restore(): freed 52 bytes of working area at address 0x20000000

Debug: 1420 3814 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

User : 1421 3814 command.c:549 command_print(): verified 32768 bytes in 0.712994s (44.881 KiB/s)

Debug: 1422 3814 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_sleep 100

Debug: 1423 3814 command.c:145 script_debug(): command - sleep ocd_sleep 100

Debug: 1426 3917 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset run

Debug: 1427 3917 command.c:145 script_debug(): command - reset ocd_reset run

Debug: 1429 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target names

Debug: 1430 3919 command.c:145 script_debug(): command - ocd_target ocd_target names

Debug: 1431 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-start

Debug: 1432 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-start

Debug: 1433 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init-reset

Debug: 1434 3919 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init-reset

Debug: 1436 3919 stlink_transport.c:37 stlink_transport_jtag_command(): stlink_transport_jtag_command

Debug: 1437 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -chain-position

Debug: 1438 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -chain-position

Debug: 1439 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1440 3919 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1441 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event examine-start

Debug: 1442 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event examine-start

Debug: 1443 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu arp_examine

Debug: 1444 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu arp_examine

Debug: 1445 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event examine-end

Debug: 1446 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event examine-end

Debug: 1447 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-assert-pre

Debug: 1448 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-assert-pre

Debug: 1449 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -chain-position

Debug: 1450 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -chain-position

Debug: 1451 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1452 3919 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1453 3919 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu arp_reset assert 0

Debug: 1454 3919 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu arp_reset assert 0

Debug: 1455 3919 target.c:1620 target_free_all_working_areas_restore(): freeing all working areas

Debug: 1456 3919 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

Debug: 1457 3919 stm32_stlink.c:417 stm32_stlink_assert_reset(): stm32_stlink_assert_reset

Debug: 1458 3919 stlink_interface.c:125 stlink_interface_execute_queue(): stlink_interface_execute_queue: ignored

Debug: 1459 3919 core.c:715 jtag_add_reset(): SRST line asserted

Debug: 1460 3927 stlink_usb.c:788 stlink_usb_reset(): RESET: 0x00000080

Debug: 1461 3927 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-assert-post

Debug: 1462 3927 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-assert-post

Debug: 1463 3927 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-deassert-pre

Debug: 1464 3927 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-deassert-pre

Debug: 1465 3927 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -chain-position

Debug: 1466 3927 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -chain-position

Debug: 1467 3927 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1468 3927 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32f0x.cpu

Debug: 1469 3927 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu arp_reset deassert 0

Debug: 1470 3927 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu arp_reset deassert 0

Debug: 1471 3927 target.c:1620 target_free_all_working_areas_restore(): freeing all working areas

Debug: 1472 3927 target.c:1386 print_wa_layout(): 0x20000000-0x20001fff (8192 bytes)

Debug: 1473 3927 stm32_stlink.c:475 stm32_stlink_deassert_reset(): stm32_stlink_deassert_reset

Debug: 1474 3929 stlink_interface.c:125 stlink_interface_execute_queue(): stlink_interface_execute_queue: ignored

Debug: 1475 3929 core.c:719 jtag_add_reset(): SRST line released

Debug: 1476 3929 target.c:1299 target_call_event_callbacks(): target event 3 (resume-start)

Debug: 1477 3929 stm32_stlink.c:538 stm32_stlink_resume(): stm32_stlink_resume 1 0x00000000 0 0

Debug: 1478 3929 stm32_stlink.c:668 stm32_stlink_read_memory(): stm32_stlink_read_memory 0x080050d4 2 1

Debug: 1479 3933 target.c:1941 target_read_u16(): address: 0x080050d4, value: 0x480d

Debug: 1480 3933 armv7m.c:144 armv7m_restore_context():

Debug: 1481 3935 target.c:1299 target_call_event_callbacks(): target event 2 (resumed)

Debug: 1482 3935 target.c:1299 target_call_event_callbacks(): target event 4 (resume-end)

Debug: 1483 3935 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-deassert-post

Debug: 1484 3935 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-deassert-post

Debug: 1485 3935 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu invoke-event reset-end

Debug: 1486 3935 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu invoke-event reset-end

Error: 1487 3937 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

User : 1488 3937 target.c:2241 handle_target(): Polling target failed, GDB will be halted. Polling again in 100ms

Debug: 1489 3937 target.c:1299 target_call_event_callbacks(): target event 0 (gdb-halt)

Debug: 1490 3937 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_shutdown

Debug: 1491 3937 command.c:145 script_debug(): command - shutdown ocd_shutdown

User : 1493 3937 server.c:580 handle_shutdown_command(): shutdown command invoked

Debug: 1494 3937 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init

Debug: 1495 3937 command.c:145 script_debug(): command - init ocd_init

User : 1497 4323 target.c:2251 handle_target(): Polling succeeded again

Debug: 1499 4323 stlink_interface.c:99 stlink_interface_quit(): stlink_interface_quit

Do not worry about the armv7m message, internally OpenOCD treats them the same.

I still do not understand your issue, yes you are getting a failed poll but the next one recovers.

What is not working other than receiving a ‘communication failure’ message?

Cheers

Spen

Hi Spen,

Due to the Error, openOCD stops programming. I’ts about this error:

Error: 1487 3937 stm32_stlink.c:386 stm32_stlink_poll(): jtag status contains invalid mode value - communication failure

User : 1488 3937 target.c:2241 handle_target(): Polling target failed, GDB will be halted. Polling again in 100ms

If I adapt the openOCD code to ignore this error, it is working fine.

Regards,

Evert

Evert,

Sorry but we are still not getting anywhere.

I have downloaded the app note and tried it and found no problems, yes we get a ‘communication failure’ message but that should not matter.

Can you give me the exact config and cmds that you are using?

Cheers

Spen

Hi Spen,

I’ve looked carefully to my setup, but it seems like it is working now,

The reason I thought it went not ok is that I was confused by the logging I got.

Nevertheless thank you for your help,

Evert

Hi Evert, Spen,

I’m having the same problem using OpenOCD and an STM32F0. I use OpenOCD 0.6.1 with Eclipse. Debugging goes fine until I start writing to flash. The same error appears:

  • Error: jtag status contains invalid mode value - communication failure

    Polling target failed, GDB will be halted. Polling again in 100ms

    Warn : target not halted

    Polling succeeded again


  • So OpenOCD recovers, but has already halted my GDB. This is particularly annoying when I have an actual breakpoint a bit later.

    What can I do to stop OpenOCD from halting GDB?

    Regards,

    Marco

    Firstly with any problem you need to try the latest development version from our git repo on sourceforge, your issue may have been fixed.

    Then give exact instructions on how to reproduce, including a full debug log.

    It may also be better to start a new thread as your problem may not be related.

    Cheers

    Spen