MindMap Gallery GD32 processor knowledge map
GigaDevice innovative processor, GD32 processor is a high-performance, low-power consumption 32-bit microcontroller series with broad application prospects and strong development support.
Edited at 2024-11-30 07:30:42呼吸功能不全是指由於外呼吸功能的嚴重障礙,以致動脈血氧分壓(PaO₂)低於正常範圍,或伴隨二氧化碳分壓(PaCO₂)升高的病理過程。
Respiratory insufficiency refers to a pathological process in which the partial pressure of arterial oxygen (PaO₂) is lower than the normal range or accompanied by an increase in the partial pressure of carbon dioxide (PaCO₂) due to severe impairment of external respiratory function.
現場施工及商務文件,詳細描述了工程項目從準備到竣工的各個階段和關鍵任務。有助於專案管理人員更能掌握專案進度和關鍵環節,確保專案順利進行。
呼吸功能不全是指由於外呼吸功能的嚴重障礙,以致動脈血氧分壓(PaO₂)低於正常範圍,或伴隨二氧化碳分壓(PaCO₂)升高的病理過程。
Respiratory insufficiency refers to a pathological process in which the partial pressure of arterial oxygen (PaO₂) is lower than the normal range or accompanied by an increase in the partial pressure of carbon dioxide (PaCO₂) due to severe impairment of external respiratory function.
現場施工及商務文件,詳細描述了工程項目從準備到竣工的各個階段和關鍵任務。有助於專案管理人員更能掌握專案進度和關鍵環節,確保專案順利進行。
GD32
GD32F307C
Boot from SRAM
The address of Reset_Handler must be 0x200001e1
Check map file
Adjust vector tables in .s files
Add before __Vectors_End
The exact number depends on the situation
Adjust IROM1 IRAM1 in Target
Adjust Flash Download
Start by modifying the main function
nvic_vector_table_set(NVIC_VECTTAB_RAM, 0x00)
Configure the NVIC interrupt vector table base address
STM32
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x00);
Note: STM32 has macro VECT_TAB_SRM control
SystemInit();
NVIC interrupt
Responsible for managing interrupt requests (IRQs)
Interrupt priority management
: NVIC supports up to 256 interrupt priority levels, but GD32F307C usually only uses 16 of them. Each interrupt can be assigned a priority level, with lower priority values indicating higher priority.
Interrupt vector table
: NVIC uses the interrupt vector table to store the address of the interrupt service routine (ISR). When an interrupt occurs, NVIC will obtain the corresponding ISR address from the vector table based on the interrupt number, and jump to this address to execute the ISR.
Break nesting
: NVIC supports interrupt nesting, that is, high-priority interrupts can interrupt low-priority interrupt processing.
Interrupt enable and disable
: NVIC allows the enable and disable status of each interrupt to be controlled through registers.
NVIC register
ISER (Interrupt Set-Enable Register): used to enable interrupts.
ICER (Interrupt Clear-Enable Register): used to disable interrupts.
ISPR (Interrupt Set-Pending Register): used to set interrupts to pending status.
ICPR (Interrupt Clear-Pending Register): used to clear the pending status of interrupts.
IPR (Interrupt Priority Register): used to set the priority of interrupts.
SysTick
24-bit down counter
Usually used to implement the operating system's clock tick or simple delay function
Features
Auto-reload: SysTick can be configured to automatically reload a preset value when the counter decrements to zero, thus enabling periodic interrupts.
Interrupt generation: When the SysTick counter decrements to zero, a SysTick interrupt can be triggered. This interrupt is usually used for task scheduling or time slice rotation of the operating system.
Simple and easy to use: SysTick is very simple to configure and use, usually only needing to set a few registers.
register
CTRL (Control and Status Register): used to control the working mode and status of SysTick.
LOAD (Reload Value Register): used to set the reload value of the SysTick counter.
VAL (Current Value Register): used to read the value of the current SysTick counter.
CALIB (Calibration Value Register): used to provide calibration information, usually used for the clock beat of the operating system.
Example
Polling to read characters
serial port
USART
Application scenarios
Suitable for situations where synchronous and asynchronous communication are required, such as clock-synchronized data transmission with external devices.
synchronous mode
asynchronous mode
Similar to UART
UART
Application scenarios
Simple point-to-point asynchronous communication, such as communicating with sensors, debugging tools, etc.
asynchronous mode
Only supports asynchronous communication mode
Compatible with M3
M4 without FP was compatible with M3
FreeRTOS
The port can use CM3 files
Transplantation process
1. Prepare
Download FreeRTOS LTS source code
FreeRTOSv202406.01-LTS
Keil Engineering
2. Copy the FreeRTOS Kernel code file to the corresponding directory of the project
1. The directory under the project is FreeRTOS
2. Crop, keep file
croutine.c
event_groups.c
list.c
queue.c
stream_buffer.c
tasks.c
timers.c
include directory
portable directory
MemMang Catalog
RVDS directory
ARM_CM3 directory
3. FreeRTOSConfig.h
Can be configured manually
You can also directly copy other reference routines
3. Modify code
gd32f30x_it.c
Annotation function void PendSV_Handler(void)
Annotation function void SVC_Handler(void)
Annotation function void SysTick_Handler(void)
Using the implementation in the FreeRTOS file port.c
4. Configure Keil project
(1) Options for Target
Inclusion Paths
..\FreeRTOS\include
..\FreeRTOS\portable\RVDS\ARM_CM3
(2) Manage Project Items
Project Items
Groups
Add group
FreeRTOS_Core
FreeRTOS_Port
5. Program reference FreeRTOS API
Example
xTimerCreate
xTaskCreate
Actual combat
Reference header file
#include "FreeRTOS.h"
other
project
keil5 opens the keil4 project
Directly modify the file name uproj -> uprojx
GD32 processor knowledge map
NVIC interrupt
Responsible for managing interrupt requests (IRQs)
Interrupt priority management
The NVIC supports up to 256 interrupt priority levels, but the GD32F307C typically only uses 16 of them. Each interrupt can be assigned a priority level, with lower priority values indicating higher priority.
Interrupt vector table
The NVIC uses an interrupt vector table to store the addresses of interrupt service routines (ISRs). When an interrupt occurs, NVIC will obtain the corresponding ISR address from the vector table based on the interrupt number, and jump to this address to execute the ISR.
Break nesting
NVIC supports interrupt nesting, that is, high-priority interrupts can interrupt low-priority interrupt processing.
Interrupt enable and disable
The NVIC allows the enable and disable status of each interrupt to be controlled through registers.
NVIC register
ISER (Interrupt Set-Enable Register): used to enable interrupts.
ICER (Interrupt Clear-Enable Register): used to disable interrupts.
ISPR (Interrupt Set-Pending Register): used to set interrupts to pending status.
ICPR (Interrupt Clear-Pending Register): used to clear the pending status of interrupts.
IPR (Interrupt Priority Register): used to set the priority of interrupts.
SysTick
24-bit down counter
Usually used to implement the operating system's clock tick or simple delay function
Features
Auto-reload: SysTick can be configured to automatically reload a preset value when the counter decrements to zero, thus enabling periodic interrupts.
Interrupt generation: When the SysTick counter decrements to zero, a SysTick interrupt can be triggered. This interrupt is usually used for task scheduling or time slice rotation of the operating system.
Simple and easy to use: SysTick is very simple to configure and use, usually only needing to set a few registers.
register
CTRL (Control and Status Register): used to control the working mode and status of SysTick.
LOAD (Reload Value Register): used to set the reload value of the SysTick counter.
VAL (Current Value Register): used to read the value of the current SysTick counter.
CALIB (Calibration Value Register): used to provide calibration information, usually used for the clock beat of the operating system.
Example
serial port
USART
Application scenarios
Suitable for situations where synchronous and asynchronous communication are required, such as clock-synchronized data transmission with external devices.
synchronous mode
asynchronous mode
Similar to UART
UART
Application scenarios
Simple point-to-point asynchronous communication, such as communicating with sensors, debugging tools, etc.
asynchronous mode
Only supports asynchronous communication mode