Cannot set debug register

Comments

11 comments

  • Avatar
    Jon Elliott

    Try reducing the JTAG clock frequency - see http://rowley.zendesk.com/entries/45529-reduce-the-jtag-tck-frequency for more information.

    0
    Comment actions Permalink
  • Avatar
    Benoît

    Thanks ! I do a step ! Now the problem when I try to connect is : "read failed"

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    I should have said, reduce the JTAG clock frequency by increasing the "JTAG Clock Divider".

    You will get read/write errors on this device if adaptive clocking has been enabled as the STM32 doesn't support adaptive clocking.

    0
    Comment actions Permalink
  • Avatar
    Benoît

    Yes I tried some different possibility without result but now it's work by disabling the adaptive clocking and increasing the Jtag clock divider !!

    Thanks a lot Jon !!!

    Have a nice day

    0
    Comment actions Permalink
  • Avatar
    Roger Schweizer

    Hi Benoit

    I have the same problem ! What is your value for the clock divider ?

    Kind regards

    Roger

    0
    Comment actions Permalink
  • Avatar
    Benoît

    Hi ! 

    my jstag settings are the following :

    adaptive clocking :    No
    JTAG Clock Divider : 2
    nSRST Open Darin : true
    nTRST Open Drain true 

     

    0
    Comment actions Permalink
  • Avatar
    Roger Schweizer

    Hi

    Thanks for your info !

    I have also this settings and now it works fine

    0
    Comment actions Permalink
  • Avatar
    filip

    I have the same problem, I've tried many clock dividers, including max 255, please help

    0
    Comment actions Permalink
  • Avatar
    filip

    hello I still have this problem, changing clock dividers doesnt help, I have proper processor type selected and adaptive clocking :  No

    0
    Comment actions Permalink
  • Avatar
    filip

    and this is my Executable_1.hzp

     

    <!DOCTYPE CrossStudio_Project_File>
    <solution Name="Executable_1" target="8" version="2">
      <project Name="Executable_1">
        <configuration Name="Common" Placement="Flash" Target="STM32F407VG" arm_architecture="v7EM" arm_core_type="Cortex-M4" arm_fpu_type="FPv4-SP-D16" arm_gcc_target="arm-unknown-eabi" arm_linker_heap_size="128" arm_linker_jtag_pad_pre_dr="1" arm_linker_jtag_pad_pre_ir="5" arm_linker_process_stack_size="0" arm_linker_stack_size="256" arm_simulator_memory_simulation_filename="$(TargetsDir)/STM32/STM32SimulatorMemory.dll" arm_simulator_memory_simulation_parameter="STM32F407VG;0x100000;0x20000" arm_target_connect_with_reset="Yes" arm_target_debug_interface_type="ADIv5" arm_target_interface_type="Default" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_target_restrict_memory_accesses="Yes" c_preprocessor_definitions="STARTUP_FROM_RESET" c_user_include_directories="$(TargetsDir)/STM32/include;$(TargetsDir)/CMSIS_3/CMSIS/Include;$(ProjectDir)/STM32F4xx;$(ProjectDir)/STM32F4xx_StdPeriph_Driver/inc" linker_memory_map_file="$(TargetsDir)/STM32/STM32F407VG_MemoryMap.xml" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/STM32/propertyGroups.xml" target_get_partname_script="GetPartName()" target_match_partname_script="MatchPartName(&quot;$(Target)&quot;)" target_reset_script="Reset()" target_trace_initialize_script="EnableTrace(&quot;$(TraceInterfaceType)&quot;)"/>
        <configuration Name="Flash" arm_target_flash_loader_file_path="$(TargetsDir)/STM32/Release/STM32F2xx_Loader_rpc.elf" arm_target_flash_loader_type="LIBMEM RPC Loader" arm_target_loader_can_erase_all="Yes" arm_target_loader_can_lock_all="No" arm_target_loader_can_lock_range="No" arm_target_loader_can_unlock_all="No" arm_target_loader_can_unlock_range="No" target_reset_script="FLASHReset()"/>
        <folder Name="Source Files" file_name="">
          <configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc"/>
          <file file_name="main.c"/>
          <file file_name="STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c"/>
          <file file_name="STM32F4xx_StdPeriph_Driver/src/misc.c"/>
          <file file_name="STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c"/>
          <file file_name="STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c"/>
          <file file_name="STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c"/>
          <file file_name="STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c"/>
        </folder>
        <folder Name="System Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s"/>
          <file file_name="$(TargetsDir)/STM32/STM32_Startup.s"/>
          <file file_name="$(TargetsDir)/STM32/STM32_Target.js">
            <configuration Name="Common" file_type="Reset Script"/>
          </file>
        </folder>
      </project>
    </solution>

    0
    Comment actions Permalink
  • Avatar
    Lance Kasari

    SOLUTION: I had the same problem, but changing the clock dividers did not help.  I found that my Target Interface Type was set for JTAG instead of SWD, but my board was using an SWD connection.  So if you still have this problem, try changing Target -> Target Interface Type between SWD and JTAG to match your hardware interface.

    0
    Comment actions Permalink

Please sign in to leave a comment.