I just started learning ARM-linux recently. I bought a tq2416 board last week. The Linux information given was too complicated and profound and I didn’t want to read it. I can’t wait to run the 2416. So I searched everywhere for relevant information on naked running, but there were really few people using 2416, and there was even less information on the Internet. The information on naked running was almost blank. Finally, I found a related post on amobbs http://www.amobbs.com/thread-5529091-1-1.html , and downloaded the code shared by Tifosi_ through my colleagues, and then through my own exploration, I finally realized s3c2416 Running naked, I would like to express my gratitude to Tifosi_ and my colleague Brother Yuan!
Debugging software environment: Keil uVision 4.7, special attention needs to be paid here. Some versions of Keil support s3c2416 Device, but cannot be compiled. For example, Keil uVision 4.1 will prompt that ARM926EJ-S is not supported.
Debugging tool: J-link V8
Target board: tq2416, of course it can also be other boards, the premise is to lead out the JTAG pins, all descriptions here take tq2416 as an example
Keil configuration: Download and install Keil uVision 4.7, create a new project, enter the target options dialog box to set the compilation environment, the main settings here are the Target option, Debug option and Utilities option
Target option settings
The 2416 SRAM is used for debugging here, but we seem to have made a mistake here, because the memory map provided in the 2416 user manual clearly indicates that the starting position of the SRAM is 0x40000000. In fact, I did make a mistake here, and it took me several days to find out. The first code started by 2416 is the program solidified in IROM. The address of IROM is 0x00000000. It is responsible for copying the startup code of the selected startup source to SRAM, and then forcibly mapping the SRAM address to 0x00000000. At this point, the IROM disappears and runs is the code in SRAM. Naturally, there is no more SRAM at 0x40000000. This SRAM, called Steppingstone, has a total space of 64KB. As shown in the figure above, the first 32KB is set as ROM, which is equivalent to program memory, and the last 32KB is set as RAM, which is data memory.
Debug option configuration
Here we mainly choose the debugging tool (J-LINK), and more importantly, add a configuration script file (as shown in the figure above. StartUpStart.ini file). This script file can make the CPU execute commands through J-LINK before debugging. Here The main purpose is to load the executable file and set the program execution starting address. The content of the script file is as follows:
1 FUNC void SetupForStart (void)
2 {
3 SP = 0x0000f000;
4 PC = 0x00000000;
5 }
6 LOAD .Objects3c2416.axf INCREMENTAL
7 SetupForStart();
Next set the Utilities options, refer to the picture below.
Utilities option configuration
After completing the above settings, save, and the compilation and debugging environment settings are completed. Next, you need to write a piece of code to verify whether 2416 can operate normally. The code is relatively simple. It is a small program written in assembly to calculate the sum of 1+...+100. In project "s3c2416", create a new "s3c2416_Add.s" file and write the following code:
1 AREA RESET, CODE, READONLY;, ALIGN = 3
2 ARM
3 ;PRESERVE8
4
5 ENTRY
6
7 LDR R0,=0x00 ;R0=0
8 LDR R1,=0x00 ;R1=0
9 LDR R2,=0x00008000 ;R2=0x00008000
10 ADDER ADD R0,R0,#0x01 ;R0++
11 ADD R1,R1,R0 ;R1+=R0
12 CMP R0,#100 ;R0==100?LOOP:ADDER
13 FROG LOOP
14 B ADDER
15
16 STR R1,[R2] ;*(0x00008000)=R1
17 LOOP B LOOP ;while(1);
18 END
The general idea of the above code is: R0 is the counter, from 1 to 100; R1 is the accumulator, recording the result of each addition; R2 is a pointer pointing to 0x00008000, and the final result will be saved to the above address; when the program starts, Initialize the value of the register, then enter the loop accumulation. After the accumulation is completed, the result is saved to 0x00008000, and finally enters an infinite loop. Save the file and settings, compile, and start debugging if there are no errors. Before debugging, you need to ensure that the J-link driver is installed and connected to the JTAG port on the development board.
Debugging interface
Click the debug button to enter the debugging interface. Debugging starts. You can execute it step by step and observe the values of each register and the execution steps of the program. The logic of the program is very simple, and it doesn't matter whether it is right or wrong. The most important significance is that s3c2416 can finally run naked!
Previous article:JLINK burns .hex file to LPC2214
Next article:Some additions to the article "s3c2416 Naked Running Environment Configuration"
Recommended posts
- How to draw PCB without understanding EMC?
- Inadditiontocomponentselectionandcircuitdesign,goodprintedcircuitboard(PCB)designisalsoaveryimportantfactorinelectromagneticcompatibility.ThekeytoPCBEMCdesignistominimizethereturnareaandletthereturnpathflowin
- 木犯001号 Power technology
- "Run Linux Kernel (2nd Edition) Volume 2: Debugging and Case Analysis" - qemu + kdump debugging analysis
- Theproblemthatcrashdebuggingcannotbeusednormallyinthedebianenvironmentofqemuaftercompilingthekernelhasbeenfixedbyreplacingthetoolchain. Theprevioustoolchainwas aarch64-linux-gnu-gcc-v Usingbuilt-inspecs. COLLECT_G
- iysheng Linux and Android
- Embedded Tutorial_Digital Signal Processing: 2-18 Analog-to-Digital Conversion (AD) Experiment (Acquisition Waveform)
- Purpose: ThepurposeofthisvideoistomastertheuseofEMIFA,understandthechipcharacteristicsanduseofAD7606,andrealizetheacquisitionofsinewavesbasedonAD7606. AD9833SchematicDiagram Findthewaveformgeneratorand
- 创龙教仪 DSP and ARM Processors
- Guess what device this power supply uses?
- Guessthepackagebytheway! Youcanplaywithpositiveandnegativevoltages Technicalworkersmustbefamiliarwiththedevicesof10first-tieroriginalmanufacturers,andeachoriginalmanufacturermustknowatleast100similar
- PowerAnts Power technology
- [CY8CKIT-149 PSoC 4100S Review] + Familiar with the development environment
- Itonlytookme2hourstogetusedtothePSoCCreator4.2developmentenvironment.Itisaveryinterestingdevelopmentenvironment.Letmetalkaboutmyexperience.OpenthePSoCCreator4.2developmentenvironmentandselecttheFilecolumn.Sele
- yangjiaxu MCU
- Internal bus block diagram of DM644x Davinci processor
- Themasterdeviceinitiatesdatatransmission Theslavedevicecanonlytransferdataaccordingtothecommand,buttheslavedevicecaninitiatethetransferbysendingatransferrequestinterrupttotheCPUorEDMA3; C64xon-chipstorage
- Aguilera DSP and ARM Processors
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Breaking through the intelligent competition, Changan Automobile opens the "God's perspective"
- The world's first fully digital chassis, looking forward to the debut of the U7 PHEV and EV versions
- Design of automotive LIN communication simulator based on Renesas MCU
- When will solid-state batteries become popular?
- Adding solid-state batteries, CATL wants to continue to be the "King of Ning"
- The agency predicts that my country's public electric vehicle charging piles will reach 3.6 million this year, accounting for nearly 70% of the world
- U.S. senators urge NHTSA to issue new vehicle safety rules
- Giants step up investment, accelerating the application of solid-state batteries
- Guangzhou Auto Show: End-to-end competition accelerates, autonomous driving fully impacts luxury...
- Lotus launches ultra-900V hybrid technology "Luyao" to accelerate the "Win26" plan
- Problems with ADS1220
- Why do smart water meters use disposable 17450 (or other models) disposable lithium batteries? Why not use rechargeable batteries?
- How do Wi-Fi antennas work? How do you test and evaluate the performance of Wi-Fi networks? (Part 2)
- Digital Audio Amplifier
- 【Development and application based on NUCLEO-F746ZG motor】15. Mathematical model - voltage equation and electromagnetic torque equation
- What is high-precision timing? How does it change the rules of the game for 5G infrastructure?
- First review | Experience the world's first GD32V series development board based on RISC-V core
- Using Protel99's shortcut keys
- Playing with Zynq Serial 42——[ex61] Image Laplacian Sharpening Processing of OV5640 Camera
- Snake moving in a twisting motion