S3C6410 bare metal program, LED light flashes

Publisher:心有归属Latest update time:2024-09-19 Source: cnblogsKeywords:S3C6410 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 /*

2 * Realize the running light, LED1 LED2 LED3 LED4 are turned on and off in turn

3  */

4

5 .global _start

6 .section .text

7

8 _start:

9

10     /*

11      * set the CPU to SVC32 mode

12      */

13     mrs r0,cpsr

14     bic r0,r0,#0x1f        @ clear the last 5 bits

15     orr r0,r0,#0xd3        @ 0b11010011, set the svc mod, and disable fiq irq

16     msr cpsr,r0

17

18     /*

19 * flush v4 I/D cahces

20      */

21 rice r0, #0

22 mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */

23     mcr p15, 0, r0, c8, c7, 0        /* flush the v4 TLB */

24

25     /*

26      * disable MMU stuff and caches

27      */

28     mrc p15, 0, r0, c1, c0, 0

29     bic    r0, r0, #0x00002300    @ clear bits 13, 9:8 (--V- --RS)

30     bic    r0, r0, #0x00000087    @ clear bits 7, 2:0 (B--- -CAM)

31     orr    r0, r0, #0x00000002    @ set bit 2 (A) Align

32     orr    r0, r0, #0x00001000    @ set bit 12 (I) I-Cache

33     mcr    p15, 0, r0, c1, c0, 0

34

35     /* peripheral port register address range set */

36     ldr r0, =0x70000000    @the base address of peripheral port is 0x70000000

37     orr r0, #0x13        @address range is 256M,  0x7000 0000 -- 0x7FFF FFFF

38     mcr p15,0,r0,c15,c2,4

39

40     /* disable the watchdog */

41     ldr r0, =0x7E004000

42     mov r1, #0

43 pp r1, [r0]

44

45     b user_program

46

47     /*

48      * LED1 <----> GPK4

49      * LED2 <----> GPK5

50      * LED3 <----> GPK6

51      * LED4 <----> GPK7

52      */

53 user_program:

54     /************** control the led ***************/

55     /* control led1 GPK4 */

56     ldr r0, =0x7F008800

57     ldr r1, =0x11110000

58     str r1, [r0]        /* set GPK4 GPK5 GPK6 GPK7 as output*/

59

60     ldr r0, =0x7F008808

61     ldr r1, [r0]

62     bic r1, #0x00F0

63

64     mov r2, #0xf

65 light_water:

66 orr r3,r1,r2,LSL #4

67 str r3, [r0]

68     bl delay

69     subs r2,r2,#1

70     moveq r2, #0xf

71     b light_water

72

73

74 delay:

75 mov r4,#0x20000

76 delay_loop:

77     subs r4,r4,#1

78     bne delay_loop

79     mov pc,lr    @return

80

81 .end


Keywords:S3C6410 Reference address:S3C6410 bare metal program, LED light flashes

Previous article:ARM-Linux S5PV210 UART driver (3) ----Serial port core layer, key structures, interface relationships
Next article:Use jlink+gdbserver+insight to debug ARM program--Configure insight

Recommended ReadingLatest update time:2024-11-23 07:47

Deleting s3c6410 bare metal program (2)
I originally thought that I could write the interrupt program quickly, but I didn't expect that I only had some idea of ​​it yesterday. Although I don't know if it is correct, I wrote it out for everyone to criticize and correct. Since I wrote a polling-type button-driven LED light last time, I have been
[Microcontroller]
s3c6410 system clock
----------------------------- Environment  PC: ubuntu 11.04 kernel: 2.6.32-28-generic corss: arm-linux-gcc 4.3.2 arm: s3c6410 ----------------------------- System clock configuration This article mainly introduces how s3c6410 handles the clock settings. Everyone should be familiar with ARM. When using it, you are oft
[Microcontroller]
In-depth understanding of ARM architecture (S3C6410) --- S3C6410 reset
reset S3C6410X has three types ofreset signals and SYSCON can place the system into one of three resets. • Hardware reset: It isgenerated by asserting XnRESET. It is an uncompromised, ungated, total andcomplete reset that is used when you do not require information in system anymore. It fully initializes all syste
[Microcontroller]
In-depth understanding of ARM architecture (S3C6410) --- S3C6410 reset
wince6.0+s3c6410 camera driver modification
During this period, I developed an image recognition project based on WinCE6.0+s3c6410 system, using the 6410 development board of Youjian Hengtian. The development board has an OV9650 camera interface, but the biggest problem is that the image obtained by the camera is too small, and only 320*240 images can be seen
[Microcontroller]
S3C6410 Embedded Application Platform Construction (Part 2)
After the previous experiments, we have a general understanding of Uboot. We have turned on the LED light before, but this is not our fundamental purpose. We want to enter the boot. After two days of code analysis and repeated experiments, we can finally enter the normal uboot startup. Next, let's look at
[Microcontroller]
S3C6410 uboot re-engineering (5) Setting up the stack and jumping to the C entry
Get straight to the point 1. Set up the stack 1 skip_hw_init: 2 /* Set up the stack */ 3 stack_setup: 4 ldr r0, =CONFIG_SYS_UBOOT_BASE /* base of copy in DRAM */ //0x57e0_0000 5 sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area */ //#define CONFIG_SYS_MALLOC_LEN (C
[Microcontroller]
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号