1. Development environment:
1. Ubuntu
2.JZ2440 development board
Hardware
The four pins GPF4-7 on the JZ2440 development board are connected to external LEDs. From the circuit diagram, we can see that the LED lights up when the IO port is at a low level.
According to the s3c2440 datasheet, the GPF pin register address is as follows:
Three software parts:
led.s
.text
.global _start
_start:
ldr r0 ,= 0x53000000 @WATCHDOG ADD
mov r1 ,#0x0
str r1 ,[r0] @r1 data is written to r0
ldr r0 ,=0x56000050 @GPFCON
mov r1 ,#0x5500
str r1 ,[r0] @Set GPF4-7 to output
add r0 ,r0,4 @GPFDAT
mov r1 ,#0x0
str r1 ,[r0]
loop:
b loop
Makefile
CC=arm-linux-gcc
LD=arm-linux-ld
led.bin:led.o
$(LD) -Ttext 0x0000000 -g led.o -o led_elf
arm-linux-objcopy -O binary -S led_elf led.bin
arm-linux-objdump -D -m arm led_elf > led.dis
led.o:led.s
$(CC) -c -g -o led.o led.s
clean:
rm -f led.bin led_elf led.dis
Enter mak in the virtual machine to get the led.bin file
Four burning:
I use BootLoader to burn nandflash
1. Download led.bin via tftp to 30000000.
tftp 30000000 led.bin
2. Erase the nandflash bootloader partition (the partition in the BootLoader provided by Teacher Wei is the first 256k memory of nandflash)
nand erase bootloader
3. Write to nandflash
nand write 30000000 bootloader
————————————————
Copyright Statement: This article is an original article by CSDN blogger ""Deleted"", which complies with the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement when reprinting.
Original link: https://blog.csdn.net/ggz_qq1300046380/article/details/78439157
Previous article:s3c2440 ARM9 bare metal driver first article - GPIO driver (C)
Next article:Porting the kernel to s3c2440
Recommended posts
- The new week's evaluation information has been sent to ~
- Hi,everyone~Thenewweek'sevaluationinformationhasbeensenttoyou~Pleasereceiveit~Inthepastweek,anewevaluationactivityhasbeenlaunched~~Letmetellyousecretlythatwiththeeffortsofthemanagers,awaveofboardsareonthe
- okhxyyo Special Edition for Assessment Centres
- 【GigaDevice GD32H759I-EVAL】 i2c read and write at24c02 test
- Testtheat24c02readandwritetestthroughthei2croutinetestontheofficialwebsite. 1.Hardware 1.1,i2chardwarecircuitdiagram I2C1usesportsPH4andPB11 1.2、MappingofPH4andPB11inthedatasheet 1.3,at24
- TL-LED Domestic Chip Exchange
- [Project source code] Linux view and delete processes
- ThisarticleanddesigncodewerewrittenbyFPGAenthusiastXiaoMeige.Withouttheauthor'spermission,thisarticleisonlyallowedtobecopiedandreproducedononlineforums,andtheoriginalauthormustbeindicatedwhenreprinting. Basic
- 小梅哥 Altera SoC
- A four-way digital buzzer using Quartus II simulation and Verilog HDL programming
- Iwanttomakeadigitalbuzzer,butwhycan'tthesecondcircuitanswerthequestion?Fromthefirstsetoftimingdiagrams,wecanseethatthereisnoproblemwiththecountdownmoduleandtheanswermodule.However,whenthecountdownmodule
- 依旧青葱年少 FPGA/CPLD
- Anti-glare rearview mirror problem: Now when there is a little light in the shade, the color turns darker and the anti-glare function is turned on. R5 modified...
- Anti-glarerearviewmirrorproblem:Nowitturnsonwhenthereisalittlelightintheshadeandthecolorbecomesdarker,andtheanti-glarefunctionisturnedon.R5ismadesmaller?R6isclampedalittle,isthedirectioncorrect? It
- QWE4562009 Circuit Observation Room
- Xiaozhi Comics丨What is an oscillation circuit
- Thisseriesisexcellent. Thankyouforyoursupport,butIdon'tknowhowtouploaditsoitwillbeautomaticallycompressedandblurred. Clickthepicturewiththemousetodisplayitinanotherwindow.Rollthemousewheelbackan
- NGI123 Test/Measurement
- 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.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- 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
- Why are there Flash and EEPROM in microcontrollers?
- MCU solves RFID smart tag/smart card system design problems
- Recommended series of articles on functional safety
- TI official website millimeter wave radar application demonstration
- Looking for a displacement sensor, impact sensor, acceleration sensor and GPS kit to assemble into a system
- Industrial Automation Equipment Recruitment
- IPTV and “three-phase broadcasting” are struggling in Germany
- Use familiar methods to quickly realize every idea! Gizwits Gokit3 free trial
- DSPC6678 on-chip storage space allocation mechanism
- Ask a question about CAN isolation