s3c2416 naked running environment configuration

Publisher:pi26Latest update time:2023-09-14 Source: elecfansKeywords:s3c2416 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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!


Keywords:s3c2416 Reference address:s3c2416 naked running environment configuration

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
Latest Microcontroller Articles
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号