Please indicate the source when reprinting, thank you, Zhang Tonghao: http://blog.csdn.net/muge0913/article/details/15016959
Email: muge0913@sina.com
The following is a simple program to light up the LED lamp, running on the tiny6410. The set_peri_port function must be added so that the peripheral space of the s3c6410 can be accessed.
@ @ File:led_on.S @ Function: LED lighting program, light up LED1 @ .equ WATCHDOGCON, 0x7e004000 .equ LEDCON, 0x7f008800 .equ LEDDAT, 0X7f008808 .text .global _start _start: bl setup_peri_port bl disable_watch_dog bl setup_sp bl display_led MAIN_LOOP: b MAIN_LOOP disable_watch_dog: @Write 0 to the WATCHDOG register ldr r0,=WATCHDOGCON mov r1,#0x0 str r1,[r0] mov pc,lr setup_sp: @Currently the stack size cannot exceed 8k ldr sp,=1024*8 mov pc,lr setup_peri_port: ldr r0,=0x70000013 @base addres:0x70000000,size:256MB mcr p15,0,r0,c15,c2,4 mov pc,lr display_led: ldr r0,=LEDCON @ R0 is set to LEDCON, that is, GPKCON0 register. This register @ Used to select the function of each pin of port K: @ is output, input, or something else mov r1,#0x110000 str r1,[r0] @ Set GPK4,5 as output port ldr r0,=LEDDAT @ R0 is set to GPKDAT register. This register @ Used to read/write data of each pin of port B mov r1,#0x00000000 @ This value is 0x000000, low level lights up the LED str r1,[r0] @ GPK4,5 output 0, LED4,5 lights up mov pc,lr
The Makefile is as follows:
led_on.bin : led_on.s arm-linux-gcc -g -O0 -c -o led_on.o led_on.s arm-linux-ld -Ttext 0x0000000 -g led_on.o -o led_on_elf arm-linux-objcopy -O binary -S led_on_elf led_on.bin clean: rm -f led_on.bin led_on_elf *.o
Previous article:Jlink debugs ARM bare metal program
Next article:ARM bare metal debugging environment construction under pure Linux (GDB + JLink)
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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
- How to protect the microcontroller from read and write
- AVR Offline Downloader - SD Card - with File System
- EEWORLD University Hall----Intelligent Connected Vehicles from the Inside Out: Current Status and Development of Internet of Vehicles
- Application of relay (flooding relay, directional relay) in wireless communication
- Has anyone used the SKY1311T card reader chip?
- The most powerful TI Bluetooth 5.0 solution CC2652R chip module
- Outsourcing: 485 multi-channel low voltage signal detection instrument [designated Guangdong/Dongguan/Shenzhen area}
- FPGA_100 Days_Edge Detection
- 【AT-START-F403A Evaluation】+ Icon-based Application System Design (and Final Report)
- In KEIL5, what is the difference between using J-LINK to download programs and debugging after downloading the programs? How do I know where the programs are downloaded to?