s3c2440 ARM9 bare metal driver first article - GPIO driver (assembly)

Publisher:PeacefulWarriorLatest update time:2022-04-21 Source: eefocusKeywords:s3c244  ARM9  assembly Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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


Keywords:s3c244  ARM9  assembly Reference address:s3c2440 ARM9 bare metal driver first article - GPIO driver (assembly)

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
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号