What is bsp?

First, what is BSP?
What is bsp?

The board support package (BSP) is a layer between the motherboard hardware and the driver layer program in the operating system. It is generally considered to be part of the operating system, mainly to support the operating system and provide access to the upper driver. The function package of the device register enables it to run better on the hardware board. In the composition of embedded system software, there is a BSP. BSP is relative to the operating system. Different operating systems correspond to different definitions of BSP. For example, BSP of VxWorks and BSP of Linux are the same as those of a certain CPU, but the writing and interface definitions are complete. Different, so write BSP must be written according to the definition of the system BSP (BSP programming process is mostly modified on a certain BSP template). In this way, it can maintain the correct interface with the upper OS and support the upper OS well.

The content contained in pure BSP is generally related to the system-related drivers and programs, such as network drivers and network protocols in the system, serial port drivers and system download debugging. Leaving these drive systems will not work.

Second, the main function of BSP

The main function of BSP is to shield hardware, provide operating system and hardware driver. Specific functions include:

1. Board hardware initialization, mainly CPU initialization, providing the underlying hardware support for the entire software system

2. Provide device drivers and system interrupt service routines for the operating system

3. Customize the functionality of the operating system to provide a real-time multitasking operating environment for the software system

4. Initialize the operating system to prepare the operating system for normal operation.

Third, the role of BSP

Establish a basic environment for the operating system to run

1, initialize the CPU internal register

2, set the RAM working sequence

3, clock drive and interrupt controller driver

4, serial port driver

Improve the operating environment of the operating system

1, improve the driver of the cache and memory management unit

2, specify the starting position of the program

3. Improve interrupt management

4, improve the system bus driver

Fourth, the difference between BSP in the application
What is bsp?

BSP is different in embedded systems and Windows systems

In fact, there are BSPs running on windows or linux systems on PCs. Only the PCs adopt a unified X86 architecture, so the BSP of the certain operating system (windows, linux.) is single-determined, and it is easy to support the OS to run normally on x86 without any modification. It doesn't make sense to talk about the concept of BSP on a PC.

For embedded systems, the situation is completely different. At present, multiple embedded CPUs (RISC) are coexisting on the market (PPC, ARM, MIPS.). For performance needs, peripheral devices will also have different Choice and definition. An embedded operating system will have different BSPs for different CPUs. Even with the same CPU, the corresponding parts of the BSP are different because of the difference in peripherals (such as the size and type of external extended DRAM).

Therefore, it is very important to write and modify the BSP according to the hardware design to ensure the normal operation of the system.

BIOS difference between BSP and PC motherboard

The BIOS between the BSP and the motherboard of the PC is very different. The BIOS is mainly responsible for detecting and initializing the system device when the computer is turned on (setting the stack pointer, interrupting the allocation, and initializing the memory.), loading the operating system and scheduling the operating system to send the hardware to the hardware. The instructions, its Firmware code is solidified during the chip production process, and generally the user cannot modify it. In fact, in preparation for downloading and running the operating system, the operating system is loaded from the hard disk into the memory, and some hardware interface settings are passed to the system. After the OS is running normally, the role of the BIOS is basically completed, which is why the BIOS must be booted from a new shutdown.

The BSP is tied to the operating system and runs on the motherboard. Although the beginning of the BSP is similar to the work done by the BIOS, most of them are different from the BIOS and have completely different functions. In addition, the BSP also contains basic drivers related to the system (serial port, network port...). In addition, the programmer can also program and modify the BSP, add any system-independent drivers or programs to the BSP, and even develop the upper layer. Put it in the BSP.

The BIOS program can not be changed by the user, compiled and programmed, and can only be modified and set. Will not include some basic hardware drivers

The position and role of BSP in embedded development

BSP development is in the early stage of the entire embedded development, which is the guarantee that the application can run normally on the back system.

The approximate steps are as follows:

1. Hardware motherboard development, testing.

2. Operating system selection, BSP programming.

3. Development of upper application.

The BSP part is between the hardware and the operating system, and the upper application. So this requires BSP programmers to have a certain understanding of hardware, software and operating systems. This way you can do BSP programming.

Five, BSP development process
What is bsp?

1, verify the hardware

Understand the voltage and current after power-on, connect the debugger to read and write the CPU internal registers, and control the output port (GPIO) of the processor to observe the output. And verify the clock settings.

2, configure RAM

This step includes initialization and testing of the RAM. The RAM register associated with the RAM needs to be filled in during the initialization of the RAM. In the test process can be divided into: unit test, overall test, noise test three parts.

3, memory management

Need to plan the use of memory, open MMU and so on.

Peripheral pump

Wuxi Doton Power , https://www.dotonpower.com