-
Notifications
You must be signed in to change notification settings - Fork 0
Hello world!
In this section, the first objective is to display a Hello world missatge through UART communication.
There are a few important files to perform a boot and send messages:
- boot.S : Is the first code to be runned, here be need to prepare some parameters.
- linker.ld : This file contains instructions for the compiler and define some memory regions.
- kernel.c : here it is the main method, called by the boot.S
With this files correctly programmed, the linker puts the boot.S at the address 0x0 and the CPU starts running this file. When the setup is completed, the boot.S jumps to the kernel.c main method and here it's possible to interact with the memory positions and peripherals.
The next step is a lecture of the ARM-peripherals manual and design some interface to work with the GPIO pins and the UART module.
For every GPIO pin there are some predefined function, designed by the GPIO function select register(pg. 91 ) and some register For this particular case, the interface I designed is:
void setfunctionGPIO(int pin, const int F);
void setPin(int pin);
void clrPin(int pin);
enum level {LVL_HIGH, LVL_LOW};
level levelPin(int pin);With this
Powered by GreenTreeData