当前位置:网站首页>[004] [stm32] MDK project configuration and commissioning

[004] [stm32] MDK project configuration and commissioning

2022-06-26 06:44:00 Cauchy's hesitation

STM32
Engineering configuration
Device
Target
Output
ListIng
User
C/C++
Asm
Linker
Debug
Simulation debugging
General debugging window
Observation window

This paper is about Baiwen & Weidong mountain 【 IOT smart home training camp 】 Course notes

1 Engineering configuration

1.1 Device

 Insert picture description here

1.2 Target

 Insert picture description here
Without using software simulation, you can ignore Xtal Parameters .

MrcroLIB Yes C Library has been optimized , quite a lot C Library functions cannot be used directly , The following code can be added without using the micro library , Normal use printf and scanf Redirect to serial port and other output devices :

#pragma import(__use_no_semihosting)
struct __FILE
{
    
	int a;
};
FILE __stdout;
FILE __stdin;

void _sys_exit(int x)
{
    
	
}

1.3 Output

 Insert picture description here
Don't check Browse Information unable F12 Jump .

1.4 ListIng

 Insert picture description here

  • .LST:Listing file generated by the C Compiler or Assembler. C And the list file generated by the assembly compiler .
  • .I: C Preprocessor Output File. Preprocessed files .
  • .map: Store image files , More important , You can analyze the details of the generated code , Such as code size 、 Memory address occupied by variables, etc .

1.5 User

 Insert picture description here
stay “After Build/Rebuild” add to fromelf --bin -o "[email protected]" "#L", Check... At the same time “Run #1”, Indicates that after compilation , perform fromelf Command to generate bin file .

1.6 C/C++

 Insert picture description here
Use cubemx Generate MDK engineering , You do not need to add a file path .

1.7 Asm

Asm The interface is generally configured with assembly code , Not commonly used .

1.8 Linker

 Insert picture description here

  • Use Memory Layout from Target Dialog: Use the distributed file load dialog Target page
  • Make RW Sections Position Independent: send RW Segment independence (–rwpi)
  • Make RO Sections Position Independent: send RO Segment independence (–ropi)
  • Don't Search Standard Libraries: Disable scanning of the default compiler runtime library (–noscanlib)
  • Report 'might fail' Conditions as Errors: The reported condition may cause a failed error , Not a warning (–strict)
  • xx BASE:X/O、R/O、R/W Base address (–xo_base=address)
  • disable Warnings: Police warning (–diag_suppress)

1.9 Debug

 Insert picture description here

  • Load Application at Startup: Load application at startup .
    Run to main(): When entering debug mode ,main(), That is, skip assembly code , Jump directly to main Function start simulation .
  • Reset debug session settings Restore Debug Session Settings: If you check , Click on it. “ Reset ” Will return to the previous state . Include : The breakpoint Breakpoints、 window Watch Windows、 Performance Analyzer Performance Analyzer、 Memory window Memory Window、 hold-all Toolbox、 System Finder System Viewer etc. .
  • Dialog DLL - Parameter: Conversation box DLL Documents and parameters ;CPU/Driver DLL - Parameter:CPU Driver files and parameters .
    Dialog DLL Respectively : DARMSTM.DLL and TARMSTM.DLL Parameter Are all :pSTM32F103RC(p+ Specific chip signals ), Used to set the software and hardware simulation that supports the corresponding chip ( That is, it can be done through Peripherals Select the dialog box of corresponding peripherals and observe the simulation results ).
  • Manage Component Viewer Description Files: Manage component description files ( Generally do not use )

Hardware simulation download configuration :
 Insert picture description here
 Insert picture description here

2 Simulation debugging

 Insert picture description here

2.1 General debugging window

 Insert picture description here

2.2 Observation window

Look at the value of the variable
 Insert picture description here
Default 16 Base display , Modifiable .

View kernel and peripheral register values
 Insert picture description here
If you look at GPIOA register :
 Insert picture description here
Check the kernel peripheral registers NCIC:
 Insert picture description here

  • E: Can make / Disability interruption
  • P: Whether the interrupt is suspended
  • A: Whether the interrupt is responding

You can also click Peripherals Select the corresponding peripheral to view :
 Insert picture description here
 Insert picture description here
Look at the function call stack
 Insert picture description here

Be careful

  • Keil When software simulation occurs no ‘write’ permission”,no ‘read’ permission Error of : No settings debug Options DLL.
  • Logic analyzer shall also be set DLL, And can only be used under software simulation , Cannot be used for hardware emulation , Otherwise prompt Unknown Signal., Or the following error occurs :
     Insert picture description here

Keil Series of tutorial reference

  1. Keil(MDK-ARM) Introduce 、 download 、 Installation and registration
  2. Keil(MDK-ARM) Series of tutorials ( One )_ New software engineering detailed process
  3. Keil(MDK-ARM) Series of tutorials ( Two )_ Detailed description of toolbar
  4. Keil(MDK-ARM) Series of tutorials ( 3、 ... and )_ Project target option configuration (Ⅰ)
  5. Keil(MDK-ARM) Series of tutorials ( Four )_ Project target option configuration (Ⅱ)
  6. Keil(MDK-ARM) Series of tutorials ( 5、 ... and )_Configuration(Ⅰ)
  7. Keil(MDK-ARM) Series of tutorials ( 6、 ... and )_Configuration(Ⅱ)
  8. Keil(MDK-ARM) Series of tutorials ( 7、 ... and )_ menu

END

原网站

版权声明
本文为[Cauchy's hesitation]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202171320205140.html