Skip to content

Commit b315c36

Browse files
authored
Merge pull request #9 from RT-Thread/master
pr
2 parents 4a4f00d + cbe9250 commit b315c36

File tree

282 files changed

+386911
-33992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+386911
-33992
lines changed

ChangeLog.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,205 @@
1+
# RT-Thread v4.0.3 Change Log
2+
3+
Change log since v4.0.2
4+
5+
## Kernel
6+
7+
* Add `__RTTHREAD__` global macro definition
8+
* Add user heap options
9+
* Fix bug of rt_memheap_detach
10+
* Add rt_memory_info() for memheap.c
11+
* Add rt_object_get_length/rt_object_get_pointers APIs
12+
* Fix double release for thread
13+
* Fix thread control bug about `RT_THREAD_CTRL_CLOSE` command
14+
* Avoid deadlock (rt_hw_interrupt_disable and rt_enter_critical when enable smp)
15+
* Fix the issue of judging the ready_table of pcpu when multi-core rt_schedule_remove_thread
16+
* Fix the issue that the yield operation cannot release the cpu in time
17+
* Fix the iterator failure for softtimer list timeout check
18+
* Fix rt_timer_list_next_timeout multi-task safe
19+
* Add timer working status query function to software timer
20+
* Fix the software issue when the system timer thread is pending
21+
* Fix the timer/software timer handling issue if the timeout function starts/stops/deletes this timer.
22+
* Fix an issue with rt_timer_start being broken and destroying the timer list
23+
* Fix the bug that the linked list is still mounted when the single timer is not modified
24+
* Add function rt_tick_get_millisecond()
25+
* Fix the delay_until issue
26+
* Add mb mq value overflow-check code
27+
* Fix the rt_event_recv function, if the event met without blocking, assigning thread->event_set/event_info will goes well
28+
* Add the definition of the maximum value of ipc type
29+
* Remove the call of rt_system_object_init/rt_system_tick_init from the code.
30+
* Removes component configuration macro `RT_USING_FINSH` from the kernel
31+
* Use object_find to implement thread_find/device_find
32+
* The cleanup operation is executed before the current thread exits
33+
34+
## Components
35+
36+
* Fix assert in the sys_arch_mbox_fetch function when close socket
37+
* Add dhcp start or stop function to start or stop dhcp.
38+
* Change rt_data_queue_peak to rt_data_queue_peek.
39+
* Update elmfat to R0.14 patch 1.
40+
* Add SAL_INTERNET_CHECK configuration item to support turning on or off the network status check
41+
* Solve the issue that the do_pollfd function processing the underlying network device returns error -1
42+
* Fix the issue that when the network card device calls to close dhcp, the bottom layer no need to call the dhcp_stop function to close dhcp
43+
* Add the function of judging the network card up and down in the sal_accept function
44+
* Modify the spelling error of the macro definition, modify the printing error when printing the IMEI number
45+
* Fix the issue that the server closed the connection when web socket requests the data that comes back from the server, and the socket status is incorrectly judged at that point
46+
* Fix the issue of incorrect sal_getaddrinfo release when sal socket supports multiple network cards
47+
* Update AT socket
48+
* Support alloc socket dynamically with at device
49+
* Update AT_SW_VERSION and adjust at_socket_ops
50+
* Adjust where the AT socket callback function
51+
* Fix at_client, avoid creating the same client repeatedly and prevent working exceptions and memory leaks.
52+
* Fix the bug that rx_notice out of sync when the data is received after last rt_device_read() is zero
53+
* [FinSH] rm command supports recursive deletion of folders
54+
* Add clear command for FINSH
55+
* [posix] Implement usleep function
56+
* Fix the issue of pthreads compilation error when using the new version of newlib; at the same time solve the problem of pthreads under 64-bit;
57+
* [dlmodule] Fix crash when dlmodule exits
58+
* Add priority & stack_size param parsing for dlmodule
59+
* libc adds getline/getdelim functions
60+
* Change the header file included in some libc files from <rtthread.h> to <rtconfig.h> to narrow the scope of inclusion to prevent recursive compilation
61+
* [jffs2] error check of rt_event_recv()
62+
* Add rt_data_queue_deinit and fix bug of dataqueue
63+
* Change log in device driver framework
64+
* [pin] Add rt_pin_get to pin frame
65+
* [PM] Update RT-Thread PM2.0 framework
66+
* [audio] Fix compile warning, undefine var
67+
* [serial] Fix the crash caused when the serial port receiving buffer is full and ULOG_USING_ISR_LOG is not turned on
68+
* [wlan] Add raw frame send interface and Management frame filter interface
69+
* [Sensor] Add vendor info and sensor types for cmd
70+
* [Sensor] Support custom commands for rt_sensor_control
71+
* [sensor] Support TOF sensor class
72+
* [SFUD] Update the 'sf bench' command.
73+
* [spi] Fix "response+1" causing hard fault of unaligned access to SPI memory of STM32 HAL library
74+
* [RTC] Optimize RTC alarm function, add alarm function for SOFT_RTC
75+
* [hwtimer] When getting the timer count, prevent overflow update due to the interruption
76+
* [dirver/i2c] i2c driver supports bus lock, STOP control
77+
* [usb] Fix bug in device descriptor that MAC OS enumeration failed
78+
* Fix the bug that USB cannot recognize composite device normally
79+
* Fix USB host core bugs
80+
* Limit >4 USB ports hubs
81+
* Double free intf
82+
* dname buffer size is too small
83+
* Reset child pointer after detaching instance
84+
85+
## BSP and CPU porting
86+
87+
* Add license info and code cleanup for vexpress-a9 BSP
88+
* Add HDSC hc32f4a0 BSP support
89+
* Add support for Cypress PSoC6 series products
90+
* Fix the lpc55 issue under Linux/GCC
91+
* [qemu] Fix spelling mistakes of code in drv_pl041.c
92+
* [loongson] Update the SPI driver and UART driver on the Loongson 2K1000 platform
93+
* [allwinner_tina]Fix spi driver bug
94+
* [smartfusion2]Support Microsemi SmartFusion2 family FPGA
95+
* [imxrt] Add ethernet configuration for imxrt1064-nxp-evk
96+
* Add support for architecture sparc-v8 and soc bm3803.
97+
* [libc] libc adds getline/getdelim functions (posix.1-2008)
98+
* Add support for c28x mcu hardware fpu
99+
* [at32] Add link detecting thread for ethernet driver
100+
* Fix gcc assembly option in rtconfig.py for imxrt1064-nxp-evk
101+
* [IMXRT]Fix scons --dist in IMXRT BSP
102+
* [ls2kdev] Initial gpio driver without irq support on ls2kdev
103+
* Optimize BSP dist handle process
104+
* [nrfx] Add the qspi_flash of nordic pdk
105+
* [nrf5x] Add the BSP of nrf5x, which support UART, SPI, PWM, ADC, i2c drivers and rtc device driver
106+
* [nrfx] Add the on-chip flash for nrf5x
107+
* [RISC-V:K210]Add UART1~3 support for K210
108+
* [Nuclei] Add Nuclei RISC-V Processor support
109+
* Update BSP for mini2440
110+
* Add soc timer cntpct
111+
* LPC55S69: Add NS project and TFM support on LPC55S69
112+
* Make MicroPython runs on Raspi3-64 BSP
113+
* Add rt_hw_us_delay for W60x
114+
* [imxrt] [driver] Add usb device driver
115+
* Fix raspi4-32
116+
* Add: dma driver, bsc driver, dsi lcd/touch driver, waveshare spi lcd/touch driver, watchdog driver, hdmi driver, sdio driver, gpio interrupt
117+
* Fix: eth driver, spi driver, uart driver
118+
* Add more BSP on BSP framework:
119+
* At32/at32f403a-start
120+
* At32/at32f407-start
121+
* bluetrum/ab32vg1-ab-prougen
122+
* bm3803
123+
* cypress/psoc6-pioneerkit_modus
124+
* essemi/es32f0271
125+
* essemi/es32f369x
126+
* essemi/es32f0654
127+
* lpc55sxx/lpc55s69_nxp_evk_ns
128+
* ls2kdev
129+
* nrf5x
130+
* nuclei/gd32vf103_rvstar
131+
* nuclei/hbird_eval
132+
* nuvoton/nk-980iot
133+
* nuvoton/numaker-iot-m487
134+
* nuvoton/numaker-pfm-m487
135+
* raspi2
136+
* raspi3-32
137+
* raspi3-64
138+
* raspi4-32
139+
* raspi4-64
140+
* smartfusion2
141+
* thead-smart
142+
* tm4c123 BSP
143+
* zynqmp-r5-axu4ev
144+
145+
* Add more STM32 BSP based on new STM32 BSP framework:
146+
* STM32L431-BearPi
147+
* stm32f103-blue-pill
148+
* stm32f103-onenet-nbiot
149+
* stm32f410-st-nucleo
150+
* stm32f411-atk-nano
151+
* stm32f413-st-nucleo
152+
* stm32g070-st-nucleo
153+
* stm32h747-st-discovery
154+
* stm32l010-st-nucleo
155+
* stm32l412-st-nucleo
156+
* stm32l433-st-nucleo
157+
* stm32l496-st-nucleo
158+
* stm32mp157a-st-discovery
159+
* stm32mp157a-st-ev1
160+
* stm32wb55-st-nucleo
161+
* New STM32 BSP framework:
162+
* Add dcmi, ov2640 and SD Card driver for stm32h743
163+
* Fix bug that caused system crash by changing the run_mode in low power mode
164+
* Fix issue when using gcc to compile the chips of stm G4 series, but chip doesn't work
165+
* drv_flash_f7.c supports single bank mode
166+
* Add stm32f103-atk-warshipv3 sram driver
167+
* Update void HAL_Delay(__IO uint32_t Delay)
168+
* Add PWM9_CONFIG default configuration and TIM3_CONFIG default configuration
169+
* [stm32f103-atk-warshipv3] Add sdcard driver
170+
* Add English readme for stm32
171+
* Add dac and can driver for stm32l4 and stm32f4
172+
* openamp driver and add rs485 driver for stm32mp157a
173+
* Optimize the pin-index algorithm
174+
* [stm32f769-disco] Support ethernet device
175+
* Add C++ Support
176+
* Fix the clock configuration issue of STM32 hardware timer
177+
* Adjust the interrupt priority configuration of some peripherals of the STM32 series BSP
178+
* Fix stm32 f1 series rtc bug
179+
* Support SPI/ADC/TIME on-chip peripheral driver
180+
* [stm32h743-atk-apollo]Support stm32h7 uart dma
181+
* Add stm32h743-atk-apollo support for pcf8574 and uart2
182+
* Support stm32h743-atk-apollo pcf8574 and uart2(485)
183+
* Update bsp/stm32/stm32h743-st-nucleo
184+
* Fix ADC channel Configuration bug for SMT32F0/L0/H7
185+
* Add support for onboard AP6181
186+
* Fix UART DMA TX
187+
* Add pm support by cubemx tool for stm32l4
188+
* Add stm32f407-atk-explorer sram driver
189+
* Fix PWM timer init about pwm
190+
* [stm32f103-atk-warshipv3]Add sdcard driver
191+
* Add stm32f103-atk-warshipv3 sram driver
192+
193+
## Tools
194+
195+
* Add C++ support for eclipse target
196+
* Keep user's lib configuration while running --target=eclipse
197+
* Add Libraries when perform `scons --dist`
198+
* Update tools/building.py and add `tackanalysis` option
199+
* Improve the logic of generating `rtconfig.h` files in scons with command `scons --menuconfig`
200+
* Fix makeimg.py wrong on linux
201+
* Add Studio IDE dist feature for stm32 BSP
202+
1203
# RT-Thread v4.0.2 Change Log
2204

3205
Change log since v4.0.1

bsp/bluetrum/ab32vg1-ab-prougen/.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ CONFIG_RT_USING_LIBC=y
380380
# CONFIG_PKG_USING_UC_COMMON is not set
381381
# CONFIG_PKG_USING_UC_MODBUS is not set
382382
# CONFIG_PKG_USING_PPOOL is not set
383+
# CONFIG_PKG_USING_OPENAMP is not set
383384

384385
#
385386
# peripheral libraries and drivers

bsp/bluetrum/ab32vg1-ab-prougen/link.lds

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,10 @@ SECTIONS
6060
} > ram1 AT > flash
6161

6262
.comm : {
63-
KEEP (*(.vector))
64-
EXCLUDE_FILE (*hal_drivers**.o *ab32vg1_hal**.o *components*finsh**.o *components*libc**.o *rt-thread*src**.o *kernel*src**.o *romfs.o *lib_a**.o) *(.text*)
65-
*idle.o (.text*)
66-
*ipc.o (.text*)
67-
*irq.o (.text*)
68-
*scheduler.o (.text*)
69-
*timer.o (.text*)
70-
*kservice.o (.text*)
71-
EXCLUDE_FILE (*romfs.o *lib_a**.o) *(.rodata*)
63+
KEEP(*(.vector))
64+
EXCLUDE_FILE(*components*finsh**.o *components*libc**.o *romfs.o *lib_a**.o) *(.text*)
65+
*finsh*shell.o (.text*)
66+
EXCLUDE_FILE (*components*libc**.o *romfs.o *lib_a**.o) *(.rodata*)
7267
*(.srodata*)
7368
*(.rela*)
7469
*(.data*)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rtthread.siz:
2+
riscv64-unknown-elf-size --format=berkeley "rtthread.elf"
3+
sh ../pre_build.sh
4+
riscv32-elf-xmaker -b rtthread.xm
5+
riscv32-elf-xmaker -b download.xm
6+
7+
clean2:
8+
-$(RM) $(CC_DEPS)$(C++_DEPS)$(C_UPPER_DEPS)$(CXX_DEPS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS)
9+
-$(RM) $(OBJS) *.elf
10+
-@echo ' '
11+
12+
13+
*.elf: $(wildcard D:/Softwares/RT-ThreadStudio/workspace/ab32vg1/link.lds)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cp ../riscv32-elf-xmaker.exe .
2+
cp ../header.bin .
3+
cp ../rtthread.xm .
4+
cp ../download.xm .

bsp/bluetrum/libcpu/cpu/context_gcc.S

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
.global rt_interrupt_from_thread
1414
.global rt_interrupt_to_thread
1515
.global rt_cur_thread_sp
16-
.global rt_switch_flag
16+
.global rt_thread_switch_interrupt_flag
1717
.global rt_interrupt_nest
1818

1919
/*
@@ -77,20 +77,20 @@ enable_int_ret:
7777
sw x30, 108(sp)
7878
sw x31, 112(sp)
7979

80-
lw a5, EPC(zero) //Saves current program counter (EPC) as task program counter
80+
lw a5, EPC(zero) //Saves current program counter (EPC) as task program counter
8181
sw a5, 116(sp)
8282
lw a5, EPICCON(zero)
8383
sw a5, 120(sp)
8484

85-
sw sp, rt_cur_thread_sp, a4 //store sp in preempted tasks tcb
85+
sw sp, rt_cur_thread_sp, a4 //store sp in preempted tasks tcb
8686
.endm
8787

8888

8989
/* Macro for restoring task context */
9090
.macro restore_context
9191

9292
la a5, rt_cur_thread_sp
93-
lw sp, 0(a5) //get new task stack pointer
93+
lw sp, 0(a5) //get new task stack pointer
9494

9595
/* Load task program counter EPC*/
9696
lw a5, 116(sp)
@@ -140,16 +140,16 @@ enable_int_ret:
140140
*/
141141
.globl rt_hw_context_switch_to
142142
rt_hw_context_switch_to:
143-
sw zero, rt_interrupt_from_thread, a4 /*set from thread to 0*/
144-
sw a0, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
143+
sw zero, rt_interrupt_from_thread, a4 /*set from thread to 0*/
144+
sw a0, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
145145

146-
sb zero, rt_interrupt_nest, a4 /*rt_interrupt_nest = 0*/
146+
sb zero, rt_interrupt_nest, a4 /*rt_interrupt_nest = 0*/
147147

148148
li a5, 1
149-
sw a5, rt_switch_flag, a4 // rt_switch_flag = 1;
149+
sw a5, rt_thread_switch_interrupt_flag, a4 // rt_thread_switch_interrupt_flag = 1;
150150

151151
SWINT /*kick soft interrupt*/
152-
lw a5, PICCON(zero) /*enable interrupt*/
152+
lw a5, PICCON(zero) /*enable interrupt*/
153153
ori a5, a5, 1
154154
sw a5, PICCON(zero)
155155
ret
@@ -161,10 +161,10 @@ rt_hw_context_switch_to:
161161
*/
162162
.globl rt_hw_context_switch
163163
rt_hw_context_switch:
164-
sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/
164+
sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/
165165
sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
166166
li a5, 1
167-
sw a5, rt_switch_flag, a4 // rt_switch_flag = 1;
167+
sw a5, rt_thread_switch_interrupt_flag, a4 /*rt_thread_switch_interrupt_flag = 1*/
168168
SWINT /*kick soft interrupt*/
169169
ret
170170

@@ -190,37 +190,37 @@ rt_switch_to_thread:
190190
*/
191191
.global rt_hw_context_switch_interrupt
192192
rt_hw_context_switch_interrupt:
193-
lw a5, rt_switch_flag
193+
lw a5, rt_thread_switch_interrupt_flag
194194
bnez a5, _reswitch
195195
li a5, 0x01
196-
sw a5, rt_switch_flag, a4
197-
sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/
196+
sw a5, rt_thread_switch_interrupt_flag, a4
197+
sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/
198198
_reswitch:
199-
sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
199+
sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
200200
ret
201201

202202
//软中断服务
203203
.global rt_soft_isr
204204
rt_soft_isr:
205-
li a5, 0x4 // PICPND = BIT(IRQ_SW_VECTOR); 清软中断Pending
205+
li a5, 0x4 // PICPND = BIT(IRQ_SW_VECTOR); 清软中断Pending
206206
sw a5, PICPND(zero)
207207
ret
208208

209209
.globl low_prio_irq
210210
low_prio_irq:
211211
save_context
212-
li a5, 1
213-
sb a5, rt_interrupt_nest, a4 // rt_interrupt_nest = 1;
212+
213+
lw a5, rt_interrupt_nest
214+
bnez a5, _low_prio_irq_exit
214215

215216
lw a5, cpu_irq_comm_hook
216217
jalr a5
217218

218-
lw a5, rt_switch_flag
219-
beqz a5, _low_prio_irq_exit // if (rt_switch_flag)
219+
lw a5, rt_thread_switch_interrupt_flag
220+
beqz a5, _low_prio_irq_exit // if (rt_thread_switch_interrupt_flag)
220221
jal rt_switch_to_thread
221-
sw zero, rt_switch_flag, a4 // rt_switch_flag = 0;
222+
sw zero, rt_thread_switch_interrupt_flag, a4 // rt_thread_switch_interrupt_flag = 0;
222223

223224
_low_prio_irq_exit:
224-
sb zero, rt_interrupt_nest, a4 // rt_interrupt_nest = 0;
225225
restore_context
226226

bsp/bluetrum/libcpu/cpu/cpuport.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
volatile rt_ubase_t rt_interrupt_from_thread = 0;
1515
volatile rt_ubase_t rt_interrupt_to_thread = 0;
1616
volatile rt_uint32_t rt_thread_switch_interrupt_flag = 0;
17-
volatile rt_uint32_t rt_switch_flag = 0;
1817
rt_uint32_t rt_cur_thread_sp = 0;
1918

2019
/**
@@ -42,13 +41,13 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
4241
stk--;
4342
*stk = (rt_uint32_t)0x10003; /* Start address */
4443
stk--;
45-
*stk = (rt_uint32_t)tentry; /* Start address */
46-
stk -= 22;
47-
*stk = (rt_uint32_t)parameter; /* Register a0 parameter*/
48-
stk -= 6;
49-
*stk = (rt_uint32_t)tp; /* Register thread pointer */
50-
stk --;
51-
*stk = (rt_uint32_t)texit; /* Register ra texit*/
44+
*stk = (rt_uint32_t)tentry; /* Start address */
45+
stk -= 22;
46+
*stk = (rt_uint32_t)parameter; /* Register a0 parameter*/
47+
stk -= 6;
48+
*stk = (rt_uint32_t)tp; /* Register thread pointer */
49+
stk --;
50+
*stk = (rt_uint32_t)texit; /* Register ra texit*/
5251

5352
/* return task's current stack address */
5453
return (rt_uint8_t *)stk;

0 commit comments

Comments
 (0)