Keil MDK3.20 debug stm32 method under ULINK

Publisher:BlissfulSpiritLatest update time:2018-02-13 Source: eefocusKeywords:Keil  MDK3  ULINK Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    1. Programs run in RAM

    Key points: (1) Change the download address of the program to the RAM space

    (2) Before debugging the program, set the SP and PC pointers to the Ram space.

    Create a new project and select the specific model of STM32. I bought Wanli development board and selected stm32f103Vb.

     

    Set the program download address, as shown in the figure below, the address of IROM1 points to the RAM space of STM32.

    How to allocate the space depends on your needs. The internal RAM size of this processor is 20K, 16K is allocated to the read-only area, and 4K is allocated to the readable and writable area. In this way, the size of IROM is set to 0x4000, the start of IRAM1 becomes 0X20004000, and the size is only 0X1000.

    Select ULINK1 Cortex Debugger in the Debug tab (the software uses the yjgyiysb CC crack method). Unselect Load Application at Start and add the startup script RAM.ini in Initialization.

    The specific contents of RAM.ini are as follows:

    FUNC void Setup (void) {

    SP = _RDWORD(0x20000000); // Setup Stack Pointer

    PC = _RDWORD(0x20000004); // Setup Program Counter

    _WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register

    }

    LOAD XXX.axf INCREMENTAL // Download, red represents the project file name.axf

    Setup(); // Setup for Running

    g, main

    Uncheck Update Target before Debugging under Utilities

    After adding this, you can debug in RAM.

    >>>>>>We need to set the correct interrupt vector table location in the code. The interrupt vector table is usually placed at the beginning of the user program, so when running in flash, the vector table is located at 0x08000000, and when the code is placed in SRAM, its location becomes 0x20000000. When initializing NVIC, we can place the following code to define the location of the vector table

    NVIC_SetVectorTable(0x20000000, 0x0);

    or

    NVIC_SetVectorTable(0x08000000, 0x0);

    or

    ?

     

    >>>>>In the Debug item in the project options, in the Download tab, remove all hooks and do not download the code to flash. In this way, you can debug the program in RAM!

    2. Debugging in Flash

    After creating a new project, the system sets IROM1 as the address and size of FLASH by default. Only two steps are required:

    1) Set the debugging tool to ULINK1 CORTEX DEBUGGER, as shown in the figure below. There is no need to set the start script.

     

    2) Select ULINK1 cortex debugger in the Utility and set the programming algorithm, as shown below.

   

 

    After that, you can debug the FLASH.

    Hardware: Wanli's EK-STM32F development board, remove the RS3 and RS4 resistors, and disconnect the emulator of the development board itself.

    Software: KEIL MDK3.20+ULINK driver replacement file.

    Emulator: ULINK


Keywords:Keil  MDK3  ULINK Reference address:Keil MDK3.20 debug stm32 method under ULINK

Previous article:Transplantation and implementation of LwIP TCP/IP protocol stack on embedded real-time operating system uC/0SII
Next article:Design of Embedded IPv6 Firewall Based on S3C2440 Processor

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号