My story with ARM 3 beep journey, the most detailed ARM bare metal project settings

Publisher:a407895356Latest update time:2017-01-06 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Preface

     I searched for a long time in the blog garden to find the corresponding bare metal development program of mini2440. What disappointed me was that no one gave a detailed answer to the arm part. I didn't know how to do it and how to configure it. I was very confused. So I spent nearly a week reading books, looking up information, and browsing forums. Finally, I figured out the whole process by myself! And who said that students of ARM hardware platform don't do open source? As hardware dogs, we are also happy to share our projects with you!

Personal goal setting

Use the buzzer on the mini2440 to make a call.

Prepare

Mini2440 development board, keil 4 for arm

Keil Configuration

OK, first we need to create a new project

Project->new uvision project

After writing your project name, you need to choose your own CPU

OK, we chose Samsung's S3C2440A chip

Ask you whether to add Keil to the project, we choose no and configure it ourselves

Press F2 to modify the project name

Of course, we can also right-click and select Mange Project Items to manage our project

Click OK

Our project now has a complete system

The following is to set the keil target.

Find the button

Set the ROM start address. As for why it is 0x30000000, please check the chip manual.

Setting RAM

Set the location where the file is generated. We usually put it in the Out directory

Click select folder for objects

Choose the path you want

Check the run#1 item in USER to indicate how to connect during the compilation process.

The command is as follows:

fromelf.exe --bin -o ./out/@l.bin  ./out/@l.axf

 

Since keil cannot generate bin files by default, you need to use the fromelf.exe tool to generate bin files

Header file introduction settings

OK, basically our project is set up!

Start your Beep journey

To operate the hardware, we must know what its circuit diagram looks like?

You see, we need to find the GPB0 port to operate the buzzer.

Then we need to operate this port, we must find its address, we go to find the MINI2440_CPU chip document

OK, we found the register of the GPB port

You have seen the GPB0 port in the chip manual, OK, then we should use the OUTPUT mode, um! Basically we have an idea.

OK, this is the register where we set the data, haha, that’s it!

Look at the blue line, English is really important! When the port is set as an output port, the GPBDAT register is set to the corresponding value.

Coding Time

OK, we have explained how to configure it very clearly above. A clear idea has been formed in our minds, and the following is how we can implement it.

Create a new blank file.

Then coded:

Copy code

  AREA RESET,CODE,READONLY
    ENTRY
    LDR R1, =0x56000010 
    LDR R2, =0x1 
    STR R2, [R1]  
MainLoop
    LDR R1, =0x56000014  
    LDR R2, =0x1    
    STR R2, [R1]        
    
    LDR R1, =0xFFFFFF
Delay1 SUB R1, R1, #1
    CMP R1, #1
    BNE Delay1
    
    LDR R1, =0x56000014
    LDR R2, =0x0
    STR R2, [R1]

    LDR R1, =0xFFFFFF
Delay2 SUB R1, R1, #1
    CMP R1, #0
    BNE Delay2
    
    B MainLoop END

Copy code

 Save and save our file in demo.s format

Add our files to our src directory

Add existing file to ….

Compile

See the results:

Obviously, there is no error in this project. OK, use MINItool to download the bin file in the OUT directory!


Keywords:ARM Reference address:My story with ARM 3 beep journey, the most detailed ARM bare metal project settings

Previous article:My story with ARM 2JINLK burning nor flash
Next article:ARM Architecture and Programming Series Blog - ARM's History and Application Scope

Recommended ReadingLatest update time:2024-11-16 13:57

Arm Technology (China)'s solemn statement on "Arm's media statement"
Arm Technology (China) Co., Ltd. also issued a solemn statement regarding the " Arm Company Media Statement " today. The specific contents are as follows:   1. The "Arm Media Statement" released by Arm and Hopu Investments to the media contains completely groundless accusations against Mr. Wu Xiong'ang, the legal re
[Semiconductor design/manufacturing]
Arm Technology (China)'s solemn statement on
Design of I2C communication between ARM/DSP and other machines based on Linux operating system
introduction In many embedded control systems, the system must complete a large amount of information collection and complex algorithms, and also realize precise control functions. The ARM9 microcontroller running the embedded Linux operating system is used to complete signal collection and implement the upper-level
[Microcontroller]
Design of I2C communication between ARM/DSP and other machines based on Linux operating system
Memory alignment processing for ARM processors
There are three main alignment issues: variable alignment, structure alignment, and data alignment. The first two are variable mapping and structure layout determined by the compiler. The last one is related to the CPU architecture (CISC/RISC). In most cases, alignment is a matter for the compiler and the CPU, and has
[Microcontroller]
Memory alignment processing for ARM processors
Fuel cell engine main controller based on ARM9 and MPC56x
With the increasing demand for clean energy, fuel cell engines and their applications in automotive power systems are becoming increasingly important. Fuel cells directly convert isothermal chemical energy into electrical energy based on electrochemical principles. Since they are not limited by the thermal engine
[Industrial Control]
Fuel cell engine main controller based on ARM9 and MPC56x
IAR for ARM series tutorial (I)_Detailed process of creating a new software project
II. Main Points Many people on the Internet asked: "I previously built a project using IAR for ARM V5 or V6. After IED upgraded to V7, when I opened the previous project, a lot of compilation errors appeared?" After the IAR for ARM version upgrade, there are slight differences in the tool chain. These issues will be
[Microcontroller]
IAR for ARM series tutorial (I)_Detailed process of creating a new software project
ARM Assembly Language - Introduction [I]
Note: This series of articles will mainly introduce some basic knowledge of ARM assembly language, taking ARMv7 and ARMv8 architecture as examples. Regarding the study of ARM assembly language, I would like to recommend a book and a website. The book is "Cortex-M3 Authoritative Guide" translated by Song Yan, which is
[Microcontroller]
ARM Assembly Language - Introduction [I]
ARM History 9-ARM Interrupt
    It has been 10 days since I last wrote about my journey. It was the National Day holiday, so I gave myself a few days off - I played some games, chess, etc.     In fact, it took a lot of time and brainpower to write the touch screen driver and understand the interrupt process in ARM. I will simply share the cond
[Microcontroller]
Analysis of arm's bin binary code
In the bin file, there are machine instructions one by one, each instruction is 4 bytes. Open a .s file in ADS and select project- disassemble You can see the assembled machine code The assembly code is as follows (a routine in ADS/ARM/ADSv1_2/Examples/asm/armex.s):         AREA ARMex, CODE, READONLY  ; name this bl
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号