Create a project, edit source files, add files to the project, set project properties, compile and link options, make!
Error : A1163E: Unknown opcode
vector.s line 14
14 00000020 Reset_Addr DCD Reset_Handler
。。。
The people of the country were shocked again, and the people of the world were dumbfounded. . .
I really edited the code in CodeWarrior of ADS this time~! Why! ? Why doesn't armassembler recognize DCD again?
I checked each letter one by one and found no errors. I pressed Enter once before and after the error code to ensure that the line breaks were correct, but it still reported an error. . . . I removed the Tab symbol in front of the pseudo-operation statement Reset_Addr DCD Reset_Handler, and it was amazing! ! It no longer reported an error~ ! ! Could it be that the Tab key was causing trouble last time, and I wrongly blamed the vim editor?
ADS used its stubbornness to prove once again to the ugly man with low self-esteem and the proud silly girl: What's the point of looking good? You can't eat it~!
天,我在语句前面加一个Tab符号,不过是想代码看起来整齐些,难道爱美也有错嘛~没有规矩,不成方圆,当兵就得有当兵的样,部队就有部队的规矩,要不去当文艺兵得了————写代码就是让代码去当兵,个个理成平头一个样,还谈啥好看哩~想不到,有些时候Tab也是不能乱加的,想让代码整齐清楚的一些小动作,到了ADS这里竟也成了壞習慣了~!
You don't have to tell me, the armassembler/compiler/linker of ADS is sometimes weird, and it always makes some errors that only machines can understand! Why not make a development environment to let the machine do the coding~! Look at this code:
MCR P15, 0, R1, C1, C0, 0
Is it wrong? It's a very simple instruction to write coprocessor CP15 register 1. The syntax and spelling are correct! If ADS reports an error to you, are you crazy? It actually reports an error!
Error :A1151E: Bad register name symbol
boot.s line 107
Fortunately, I have a strong psychological endurance and found this error that is invisible to the naked eye before I went crazy: just represent P15, C1, and C0 with lowercase letters!
MCR p15, 0, R1, c1, c0, 0 ;correct now
At this point, people all over the world couldn't help but give ADS a thumbs up in their hearts.
It turns out that all coprocessor register symbols must be represented by lowercase letters~! My God! What a ***ing world!
Oh, I encountered a new problem! I mentioned earlier that some pseudo-operation statements do not need TAB in front of them, but some pseudo-operations (directionsThere must be a tab or space before TI ve! Don't believe it? Try writing AREA and its corresponding END statement at the top? ADS will give you an error! There must also be a tab or space before EXPORT/IMPORT!
When using ADS1.2, for assembly files, such as initialization init.s, a "TAB" or space must be added before each statement, otherwise an "unkown opcode" error will occur.
If you encounter this kind of problem, you can try the following methods:
1. Remove the TAB in front of the statement or try it (some pseudo operations such as DCD and EQU statements cannot have a TAB symbol before them);
2. Try adding a space or Tab symbol before the statement (it is known that there must be a space or Tab symbol before AREA, END, EXPORT/IMPORT);
3. Change uppercase letters to lowercase letters (it is known that coprocessors and coprocessor registers must be represented by lowercase letters);
4. TAB for space or space for TAB and other methods.
Comments in assembly begin with ; and in C or C++ begin with //
--------------------------------------------------
Under ADS, __main() is an internal library function of C language, which completes the initialization of internal RAM before entering the user main().
-------------------------
Since ARM uses a three-stage pipeline structure, when SWI and undefined instruction exception interrupts occur, the value of the program counter PC has not been updated, and it points to the second instruction after the current instruction (for ARM instructions, it points to the current instruction address plus 8 bytes; for Thumb instructions, it points to the current instruction address plus 4 bytes). This is why when SWI and undefined instruction exception interrupts occur, the processor saves (PC-4) to the register lr_mode in the exception mode, and then (PC-4) points to the next instruction after the current instruction.
Previous article:How many coprocessors does ARM have? Detailed explanation of ARM coprocessors
Next article:In-depth understanding of ARM architecture basics
Recommended ReadingLatest update time:2024-11-16 12:45
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Factory Visit Live Replay] Arrived at the destination - TE Qingdao Factory
- Useful tutorial | How to quickly splice PCB data at unconventional angles?
- Class AB Audio Amplifier
- Max30102 heart rate blood oxygen sensor measures heart rate problem 2
- Xunwei IMX6 development board non-device tree source code compilation environment construction (I)
- Execution process before keil main
- I need help from a great God to look at this circuit diagram, thank you very much
- FPGA Global Clock Constraints (Xilinx)
- The 2020-2021 ON Semiconductor and Avnet IoT Innovation Design Competition awards have been announced!
- How to implement this email sending program? How to write program analysis? Please help me answer