Prepare for analysis
This time we use C language to control the LED. We need to set the stack pointer. The start.S here is like crt0.o in the helloworld program with an operating system - it is a startup code.
The stack pointer is set to 0xD003_7D80.
Resource Tools
Same as "LED Application of S5PV210 (I)"
Start writing the program
@**************************************************************************************
@File:start.S
@ Function: Use it to transfer to C program
@**************************************************************************************
.text
.global _start
_start:
ldr sp, =0xD0037D80 @ Set up the stack to call the C function
bl main @ Call the main function in the C program
halt_loop:
b halt_loop
@**************************************************************************************
/**********************************************************************************
/* File: led.c
/* Turn on LED1
/**************************************************************************************/
#define GPJ2CON (*(volatile unsigned long *) 0xE0200280)
#define GPJ2DAT (*(volatile unsigned long *) 0xE0200284)
int main()
{
GPJ2CON = 0x00000001; //Set GPJ2_O to output
GPJ2DAT = 0; // LED1 on
while(1);
return 0;
}
Makefile:
led_sp.bin: start.o led.o
arm-linux-ld -Ttext 0x0 -o led_sp.elf $^
arm-linux-objcopy -O binary led_sp.elf led_sp.bin
arm-linux-objdump -D led_sp.elf > led_sp_elf.dis
gcc mkv210_image.c -o mkv210
./mkv210 led_sp.bin 210.bin
%.o : %.S
arm-linux-gcc -o $@ $< -c
%.o : %.c
arm-linux-gcc -o $@ $< -c
clean:
rm *.o *.elf *.bin *.dis mkv210 -f
Download and run
Same as "LED Application of S5PV210 (I)"
Run Debug
The program is simple and works fine.
Remaining problem
1. Knowing that the iROM program has already initialized the watchdog, I will not implement it myself yet. I will talk about the watchdog later.
Previous article:ARM processor Cache cortex a8
Next article:S5PV210 IRAM Application
- 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
- Paradox between power control accuracy and time delay accuracy of zero-crossing switch
- How to Make LED Bulbs Dimmable
- Digital tube... I have been looking at it for a long time but still don't understand it. Please give me some advice!
- [Content synchronization] A quick review of RVB2601 article synchronization specifications to avoid repeated returns and modifications
- This indicator has an EVM indicator in the previous high-speed rail or subway PA.
- Domestic MCU replacement: a pitfall
- Can the power supply master give me some advice on how to calculate the secondary winding wire diameter of the flyback switching power supply transformer?
- [ESP32-S2-Kaluga-1 Review] Development Environment Selection and Construction
- Do foldable electronic devices make sense?
- Qorvo and UWB AOA to develop together