ARM architecture and assembly 100 (4)

Source: Internet
Author: User
Tags random seed

61st Q:
Q: How can easyarm2104 program call C Programs and compile programs that are useless?
A: follow these steps:
1. Delete all original files in the Project Management window;
2. Add the Assembly file *. s in the Project Management window;
3. Compile the link and debug it.

62nd Q:
Q: Could you tell me the Moderator: When I run the axd debugging software in a certain step, I want to re-run the software I edited from the reset position. In the axd software, the execute column has functions such as single-step, continuous, running at the cursor, but no reset function. How to implement this function?
A: I have not found it. Currently, I can only use the reload operation.

63rd Q:
Q: During axd debugging, the following information is displayed when the JTAG interface is used to connect to the lpc2106:
Tksimulator for ads, v1.2, 2003/08
Software supplied by: zlgmcu
ARM7TDMI-S, little endian.
There are two situations in the file | load imgage... file:
1. Normal, fully capable of debugging;
2. the following error occurs: RDI warning 00254: unimplemented RDI message. Where can I solve this problem? Thank you!
A: It may be caused by poor contact with power supplies or other connectors.

64th Q:
Q: How many questions can I ask:
1. Can the _ SWI keyword in the underlying interface be used in SDT?
2. Why do I remove the Enable interrupt and Off-Cycle Macros in the clock cycle service subroutine in the errata document?
3. Should the clock cycle interrupt priority be set to the highest?
A: 1. I do not know. Please take a look at the software documentation.
2. the interrupted service program must be disconnected.
3. No.

65th Q:
Q: What is brackets in arm assembly? For example, what is brackets in the following example?
[Pllonstart
LDR r0, = pllcon
LDR R1, = (0xe8 <12) + (0x4 <4) + 0x2)
STR R1, [R0]
]
A: It is equivalent:
If pllonstart
LDR r0, = pllcon
LDR R1, = (0xe8 <12) + (0x4 <power-on-> Start axd. phenomenon: the digital tube can display the ever-changing number 0--f, but the axd connection fails, prompting "DBE warning 00041 :.... ". retried several times, the same phenomenon. ask for Reasons and Countermeasures.
A: I changed the user attribute of Win2k System of my machine from "poweruser" to "Administrator. it may be because the Administrator permission is used for ads/axd installation. If you have a problem working under "poweruser.
If someone has a similar problem, try this method.

67th Q:
Q: there is such a section in init. S:
Reset
BL initstack; initialize the stack
BL targetresetinit; Basic initialization of the target board
B _ main; jump to the C language portal
Who knows the specific content of the _ main () function?
If I do not need to call the library function, can I change it to B Main?
A: Check that the compilation Code contains _ main (). The components are related to some link options.
Yes. But the global variable cannot be initialized.

68th Q:
Q: I have embedded such a statement in C.
_ ASM
{
Mrs R4, CPSR;
Stmfd SP !, {R4 };
ORR R4, R4, 0x80;
MSR cpsr_cxsf, r4
}
There will be a new error "illegal write to SP". How can I solve this problem?
A: you cannot use SP for Embedded Assembly.

69th Q:
Q: What does the following analyticdb compilation error mean by l6221e: Execution region er_ro overlays with execution region er_zi?
A: The program segment memory allocation may be faulty. Ro (read-only), Zi (0 initialization)

70th Q:
Q: Is there any time calculator Keil in axd that has something like that.
A: Yes, but it is not a time but an execution cycle. It can be converted to a time. For details, refer to the help documentation in debugger internals.

71st Q:
Q: My initial init. the heap allocation and the _ user_initial_stackheap function are not added to S. The result program jumps to the endless loop in SWI. I just joined them. or you can change "B _ main" to "B Main" without adding them. in addition, even if the target board is in an endless loop, software simulation can run normally. he Jie
A: The heap location is not allocated to a valid Ram instance.

72nd Q:
Q: In the arm assembly language, there is a requirement for immediate number. I remember I didn't say this before. now, I am confused. I am very careful when I use the data now. I don't want to use it as I like for 51. Some friends who are familiar with the data now will come up to explain this to everyone.
A: If "illegal data can be sent to registers using LRD. first define a constant in the memory, and then LDR in it. The Compiler does this. you can see the differences in the following statement disassembly;
Int z = 0x101;
Int z = 0xff;

73rd Q:
Q: after running a program in an axd step, I want to return to the program and start re-running. In addition to re-loading, there are other methods or buttons.
A: How big is your program running in Flash? It doesn't take 1 second to Click Reload current image ~ Or set Pc = 0 in the code window.

74th Q:
Q: In osintctxsw_1 on page 1 of the "ARM microcontroller basics and Practices" procedure list 6.22:
LDR R4, [R6]
Add SP, R4, #68
Ldr lr, [Sp, #-8]
MSR cpsr_c, # (noint | svc32mode)
MoV sp, r4

Ldmfd SP !, {R4, R5}
LDR R3, = osentersum
STR R4, [R3]
MSR spsr_cxsf, R5
Ldmfd SP !, {R0-R12, LR, PC} ^
MASTER: ldmfd SP !, {R0-R12, LR, PC} ^ is not to recover the new task working register and working mode, LR register is restored together, then add command after ldr lr, [Sp, #-8] Can commands be removed?
A: The two recover LR in two different processor modes.

75th Q:
Q: Since the image entry point on the option page is filled with the debugging entry address, it will not overwrite the entry declaration in the Code during the actual program running, right? It's just for debugging convenience.
A: Image entry point takes precedence. In fact, the entry in the code is used to ensure that the Code is not optimized.

76th Q:
Q: I want to use library functions in the Standard C language. For example, memset is defined in string. H, But I directly include # include, but the compilation is not correct and the running is indeed incorrect. How should I set it?
A: use the latest Engineering Template.

77th Q:
Q: must the software interrupt be triggered by the SWI command?
A: You can directly define the Soft Interrupt function name. For example:
_ SWI (0x12) void myswi (void); // declare a function
_ ASM // call method 1
{
SWI 0x12
}
Myswi (); // call method 2

78th Q:
Q: Where is the program in program list 6.9 in ARM microcontroller basics and practices called? _ user_initial_stackheap
LDR r0, = bottom_of_heap
MoV PC, LR
A: __main. Do not delete it. Otherwise, a major event will occur.

79th Q:
Q: "LDR r0, = pinsel0" in "=" What does this statement mean by taking the address or the content in the address?
A: This is a LDR pseudocommand. It can be used to load 32-bit immediate number or address. LDR r0, = pinsel0 is used to load the address of pinsel0 to R0.

80th Q:
Q: I don't know how to use 0 and 0x123456 in the "SWI 0" and "SWI 0x123456" commands. Are there any examples of using SWI?
A: This is a specific center disconnected address. For details, see SWI under ads_{guide_d.

81st Q:
Q: SWI menu?
A: The SWI menu is determined by the SWI exception service program. It is often determined by the programmer.

82nd Q:
Q: I used example 1 when porting your original code to UCOS, however, the Enable comms channel view and semihostin items are inactive when the processor's simulator mode is set according to Figure 7.17. why? Can you give me a prompt?
A: Some simulators enable them to affect the SWI exception handling program.

83rd Q:
Q: What is the error message "unimplemented RDI message "?
Also, sometimes when I use axd to load a. axf file, loading is always endless. Why?
A: unimplemented RDI message: indicates that the command operation failed and you need to reconnect. if the download is not completed, it is abnormal. Please connect and download again. if this problem occurs every time, contact our technical support.

84th Q:
Q: Hello, everyone. I am a beginner of arm. Why is PC = 0x0000000c after I run the "LDR PC, [PC, R2]" command in program debugging, is the value on the PC + R2 address 0x0000000c before this command is executed?
A: You need to use software simulation. 0x0000000c is prefetch aborted.
Q: What is the relationship between CPSR and cpsr_c In the CPU stack initialization of the arm7. cpsr_c is defined there.
A: This is the syntax of the MSR command. The CPSR domain is specified after "_". For details, refer to the instructions on this command in ARM microcontroller basics and practices.

85th Q:
Q: Why is the following function called through Soft Interrupt directly?
OS _task_sw (),
_ Osstarthightdy (),
OS _enter_critical ),
OS _exit_critical (),
A: it cannot be called directly in user mode or thumb status.

86th Q:
Q: An arm command is 32-bit long, but sometimes the number of immediate messages is 32-bit. How can this be explained?
A: The immediate number used in the command must be obtained by an 8-digit shift. Not all numbers can be obtained.

87th Q:
Q: Will the global variable value be automatically cleared after reset (power-on) (with the startup Code provided by the CD)
A: in C language, 0 is usually initialized or the value specified by the user, but this is not automatic by hardware.

88th Q:
Q: The setting files for *. MCP is locked! What is the problem?
A: file attributes are read-only.

89th Q:
Q: Why can't I use printf () in ads? Thank you!
A: Large.

90th Q:
Q: What is the relationship between the function number of SWI and the value of LR registers? For example, in the "ARM microcontroller basics and Practices" program list 6.13
Ldreq r0, [LR, #-4]; biceq r0, R0, 0xff000000
A: ldreq r0, [LR, #-4]; used to read SWI code
Biceq r0, R0, 0xff000000; access in arm mode, with 24 Bit lower

91st Q:
Q: What is the purpose of the targetinit () function to execute srand (int32u) targetinit )?
A: ex1 uses it to generate random seed.

Q: In the project I created, all the source files are the same as the source files in the CD 2104 example. The compilation link is also normal, but it cannot be run on the board! The error message is: the vector interrupt has an error and cannot run freely !! This is why the same source file is added to your project. It is normal. An error occurs when it is added to my project! I created an arm executable image.
A: vector. S. If you want to calculate the sum of vectors.

92nd Q:
Q: Do I need to modify 0xb9205f80 of "DCD 0xb9205f80" in vectors. s in actual use?
A: No change is required unless the instruction code in the vector table is changed.

93rd Q:
Q: Why is the queue data queue circled in ARM microcontroller basics and practices?
A: Because the pointer between the header and the tail points to an address, the queue is logically ring.

94th Q:
Q: Has anyone successfully defined a data in a program space? I have tried various methods. Is there any compilation switch?
A: Use the const modifier to define a variable with an initialization value. It must be a global variable.

95th Q:
Q: There is no code keyword in ads. How can I make the defined String Array not occupy Ram space?
A: const unsigned char string []

96th Q:
Q: In the routine, the timeout in time_test prompts when being written:
Warnning! Interrupt vectors data is not correct!
Program you downloaded can not run freely!
I don't know how to change the settings. Which one should I remind me?
A: The checksum of the interrupt vector table is not 0. You can use axd to view the data of the 0 address (in 32-Bit mode) and add it yourself. Remove the part above 32 bits.

97th Q:
Q: I am doing a timeout Experiment (2104 Board), make is passed, and the following error message is prompted during Debug:
Warnning! Interrupt vectors data is not correct!
Program you downloaded can not run freely!
Set link: Arm link
R0 base: 0x00000000
RW base: 0x40003000
Image entry point: 0x00000000 others unchanged !!
I can use ISP to download and run it! This can be said to be a setup problem, but I cannot find it! What should I do?
A: Please take a look at Appendix 1 of the supporting ARM microcontroller basics and practices. ISP software may have processed it, But JTAG has no special processing.

98th Q:
Q: * (volatile unsigned int *) What does it mean, for example, * (volatile unsigned int *) ADDR?
A: Let's separate them. (volatile unsigned int *) is to define a variable unsigned integer pointer. The previous one * is to get the content.

99th Q:
Q: How to understand # define vicirqstatus (* (volatile unsigned long *) 0xfffff000 ))
A: macro definition. Refer to books in C language. (volatile unsigned long *) 0xfffff000 forcibly converts 0xfff000 to a pointer, and then * (pointer) can access this address.

100th Q:
Q: Why don't I directly write the entry address of the exception vector into the PC in the settings of the Exception Processing vector table? Why do I need to use the pseudo commands such as DCD? What is the purpose?
A: To ensure that the sum is zero at any time, otherwise the program will be calculated once.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.