解决了使用组件初始化会出现的硬件错误问题,修改了flash_readword函数中取地址的写法
This commit is contained in:
parent
d9b0473928
commit
fb914e8ed7
Binary file not shown.
|
@ -39,15 +39,15 @@ compiling ulog.c...
|
||||||
compiling bsp_flash.c...
|
compiling bsp_flash.c...
|
||||||
compiling ipc.c...
|
compiling ipc.c...
|
||||||
linking...
|
linking...
|
||||||
Program Size: Code=30106 RO-data=5894 RW-data=128 ZI-data=8192
|
Program Size: Code=29366 RO-data=5834 RW-data=128 ZI-data=9192
|
||||||
FromELF: creating hex file...
|
FromELF: creating hex file...
|
||||||
After Build - User command #1: "D:\SXDT\Official_information\HDDZ\demo\CIU32_L051_PROJECT\USART1_Interrupt - RT-Thread\keil5_disp_size_bar\keil5_disp_size_bar.exe"
|
After Build - User command #1: "D:\SXDT\Official_information\HDDZ\demo\CIU32_L051_PROJECT\USART1_Interrupt - RT-Thread\keil5_disp_size_bar\keil5_disp_size_bar.exe"
|
||||||
ram:
|
ram:
|
||||||
RW_IRAM1 :0x20000000
|
RW_IRAM1 :0x20000000
|
||||||
16.00 KB :|¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö__________| 50.78 % ( 8.12 KB / 16.00 KB) [8064 B]
|
16.00 KB :|¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö_________| 56.88 % ( 9.10 KB / 16.00 KB) [7064 B]
|
||||||
flash:
|
flash:
|
||||||
ER_IROM1 :0x8000000
|
ER_IROM1 :0x8000000
|
||||||
64.00 KB :|¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö__________| 54.93 % ( 35.16 KB / 64.00 KB) [29536 B]
|
64.00 KB :|¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö__________| 53.71 % ( 34.38 KB / 64.00 KB) [30336 B]
|
||||||
".\CIU32_L051_M307R.axf" - 0 Error(s), 1 Warning(s).
|
".\CIU32_L051_M307R.axf" - 0 Error(s), 1 Warning(s).
|
||||||
|
|
||||||
<h2>Software Packages used:</h2>
|
<h2>Software Packages used:</h2>
|
||||||
|
@ -61,7 +61,7 @@ Package Vendor: HED
|
||||||
C:/Users/16005/AppData/Local/Arm/Packs/HED/CIU32L0xx_DFP/1.2.5/Drivers/CMSIS/Device/CIU32L051/Include
|
C:/Users/16005/AppData/Local/Arm/Packs/HED/CIU32L0xx_DFP/1.2.5/Drivers/CMSIS/Device/CIU32L051/Include
|
||||||
|
|
||||||
<h2>Collection of Component Files used:</h2>
|
<h2>Collection of Component Files used:</h2>
|
||||||
Build Time Elapsed: 00:00:02
|
Build Time Elapsed: 00:00:01
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
Dependencies for Project 'USART1_Interrupt', Target 'USART1_Interrupt': (DO NOT MODIFY !)
|
Dependencies for Project 'USART1_Interrupt', Target 'USART1_Interrupt': (DO NOT MODIFY !)
|
||||||
CompilerVersion: 6210000::V6.21::ARMCLANG
|
CompilerVersion: 6210000::V6.21::ARMCLANG
|
||||||
F (..\user\Source\main.c)(0x66CEBF5B)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./main.o -MD)
|
F (..\user\Source\main.c)(0x66D7D723)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./main.o -MD)
|
||||||
I (..\RTOS\components\finsh\finsh_config.ha.\RTOS\inc\rtdebug.h)(0x00000000)
|
I (..\RTOS\components\finsh\finsh_config.ha.\RTOS\inc\rtdebug.h)(0x00000000)
|
||||||
I (..\RTOS\inc\rtdef.hf.\RTOS\inc\stdarg.ha.\RTOS\inc\rtservice.h)(0x00000000)
|
I (..\RTOS\inc\rtdef.hf.\RTOS\inc\stdarg.ha.\RTOS\inc\rtservice.h)(0x00000000)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std.h)(0x66138664)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std.h)(0x66138664)
|
||||||
|
@ -91,7 +91,7 @@ I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_usart.h)(0x65800BC6)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_vrefbuf.h)(0x65800BC6)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_vrefbuf.h)(0x65800BC6)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_wwdg.h)(0x65800BC5)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_wwdg.h)(0x65800BC5)
|
||||||
I (..\RTOS\components\finsh\finsh_api.h)(0x66C2AAF0)
|
I (..\RTOS\components\finsh\finsh_api.h)(0x66C2AAF0)
|
||||||
F (..\bsp\src\bsp_history.c)(0x66D6BEB2)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./bsp_history.o -MD)
|
F (..\bsp\src\bsp_history.c)(0x66D7CFC4)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./bsp_history.o -MD)
|
||||||
I (..\RTOS\inc\rtthread.h..\RTOS\rtconfig.h)(0x00000000)
|
I (..\RTOS\inc\rtthread.h..\RTOS\rtconfig.h)(0x00000000)
|
||||||
I (..\RTOS\components\finsh\finsh_config.hh.\RTOS\inc\rtdebug.h)(0x00000000)
|
I (..\RTOS\components\finsh\finsh_config.hh.\RTOS\inc\rtdebug.h)(0x00000000)
|
||||||
I (..\RTOS\inc\rtdef.hf.\RTOS\inc\stdarg.hh.\RTOS\inc\rtservice.h)(0x00000000)
|
I (..\RTOS\inc\rtdef.hf.\RTOS\inc\stdarg.hh.\RTOS\inc\rtservice.h)(0x00000000)
|
||||||
|
@ -142,7 +142,7 @@ I (..\LIB\RTT\SEGGER_RTT.he.\LIB\RTT\SEGGER_RTT_Conf.h)(0x00000000)
|
||||||
I (C:\Keil_v5\ARM\ARMCLANG\include\stdlib.h)(0x6569B012)
|
I (C:\Keil_v5\ARM\ARMCLANG\include\stdlib.h)(0x6569B012)
|
||||||
I (..\RTOS\components\utilities\ulog\ulog.h)(0x666E44C6)
|
I (..\RTOS\components\utilities\ulog\ulog.h)(0x666E44C6)
|
||||||
I (..\RTOS\components\utilities\ulog\ulog_def.h)(0x666E44C6)
|
I (..\RTOS\components\utilities\ulog\ulog_def.h)(0x666E44C6)
|
||||||
F (..\bsp\src\bsp_flash.c)(0x66D6D559)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./bsp_flash.o -MD)
|
F (..\bsp\src\bsp_flash.c)(0x66D7E1CF)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./bsp_flash.o -MD)
|
||||||
I (..\RTOS\inc\rtthread.hl.\RTOS\rtconfig.h)(0x00000000)
|
I (..\RTOS\inc\rtthread.hl.\RTOS\rtconfig.h)(0x00000000)
|
||||||
I (..\RTOS\components\finsh\finsh_config.hh.\RTOS\inc\rtdebug.h)(0x00000000)
|
I (..\RTOS\components\finsh\finsh_config.hh.\RTOS\inc\rtdebug.h)(0x00000000)
|
||||||
I (..\RTOS\inc\rtdef.hf.\RTOS\inc\stdarg.hh.\RTOS\inc\rtservice.h)(0x00000000)
|
I (..\RTOS\inc\rtdef.hf.\RTOS\inc\stdarg.hh.\RTOS\inc\rtservice.h)(0x00000000)
|
||||||
|
@ -1555,7 +1555,7 @@ I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_trng.h)(0x65800BC5)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_usart.h)(0x65800BC6)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_usart.h)(0x65800BC6)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_vrefbuf.h)(0x65800BC6)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_vrefbuf.h)(0x65800BC6)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_wwdg.h)(0x65800BC5)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_wwdg.h)(0x65800BC5)
|
||||||
F (..\Peripheral\CIU32L051_Lib\Source\ciu32l051_std_flash.c)(0x66D6BCE5)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./ciu32l051_std_flash.o -MD)
|
F (..\Peripheral\CIU32L051_Lib\Source\ciu32l051_std_flash.c)(0x66D7B363)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0plus -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-4 -Oz -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../RTOS/inc -I ../RTOS/components/finsh -I ../drivers/inc -I ../Peripheral/CIU32L051_Lib/Include -I ../Peripheral/CMSIS/Core -I ../Peripheral/CMSIS/Device -I ../startup -I ../user/Include -I ../RTOS -I ../RTOS/components/utilities/ulog -I ../RTOS/components/utilities/ulog/backend -I ../RTOS/components/drivers/inc -I ../LIB/lwrb -I ../LIB/RTT -I ../bsp/inc -I ../LIB/LwUtil -I ../LIB/perf_counter -D__UVISION_VERSION="539" -DCIU32L051 -DCIU32L051
-o ./ciu32l051_std_flash.o -MD)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std.h)(0x66138664)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std.h)(0x66138664)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_config.h)(0x65800BC6)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_config.h)(0x65800BC6)
|
||||||
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_rcc.h)(0x65E679B7)
|
I (..\Peripheral\CIU32L051_Lib\Include\ciu32l051_std_rcc.h)(0x65E679B7)
|
||||||
|
|
|
@ -6,18 +6,18 @@
|
||||||
[Found keyword]: ----------Execution Region----------
|
[Found keyword]: ----------Execution Region----------
|
||||||
[name]: ER_IROM1
|
[name]: ER_IROM1
|
||||||
[Exec base]: 0x8000000
|
[Exec base]: 0x8000000
|
||||||
[Size]: 0x8ca0
|
[Size]: 0x8980
|
||||||
[Max]: 0x10000
|
[Max]: 0x10000
|
||||||
[Found keyword]: ----------Execution Region----------
|
[Found keyword]: ----------Execution Region----------
|
||||||
[name]: RW_IRAM1
|
[name]: RW_IRAM1
|
||||||
[Exec base]: 0x20000000
|
[Exec base]: 0x20000000
|
||||||
[Size]: 0x2080
|
[Size]: 0x2468
|
||||||
[Max]: 0x4000
|
[Max]: 0x4000
|
||||||
[parse_keil_map over printf bar]:
|
[parse_keil_map over printf bar]:
|
||||||
RW_IRAM1 :0x20000000
|
RW_IRAM1 :0x20000000
|
||||||
16.00 KB :|ĄöĄöĄöĄöĄöĄöĄöĄöĄöĄö__________| 50.78 % ( 8.12 KB / 16.00 KB) [8064 B]
|
16.00 KB :|ĄöĄöĄöĄöĄöĄöĄöĄöĄöĄöĄö_________| 56.88 % ( 9.10 KB / 16.00 KB) [7064 B]
|
||||||
ER_IROM1 :0x8000000
|
ER_IROM1 :0x8000000
|
||||||
64.00 KB :|ĄöĄöĄöĄöĄöĄöĄöĄöĄöĄö__________| 54.93 % ( 35.16 KB / 64.00 KB) [29536 B]
|
64.00 KB :|ĄöĄöĄöĄöĄöĄöĄöĄöĄöĄö__________| 53.71 % ( 34.38 KB / 64.00 KB) [30336 B]
|
||||||
[export csv]: ./USART1_Interrupt_sort_by_flash.csv
|
[export csv]: ./USART1_Interrupt_sort_by_flash.csv
|
||||||
[export csv]: ./USART1_Interrupt_sort_by_ram.csv
|
[export csv]: ./USART1_Interrupt_sort_by_ram.csv
|
||||||
[export xlsx]: USART1_Interrupt_analysis.xlsx
|
[export xlsx]: USART1_Interrupt_analysis.xlsx
|
||||||
|
|
Binary file not shown.
|
@ -1,65 +1,65 @@
|
||||||
File_name,flash percent,flash,ram,Code,RO_data,RW_data,ZI_data
|
File_name,flash percent,flash,ram,Code,RO_data,RW_data,ZI_data
|
||||||
bsp_flash.o,13.934979%,5165,4,3656,1509,0,4
|
bsp_flash.o,13.508520%,4899,4,3420,1479,0,4
|
||||||
cmd.o,9.682989%,3589,0,2592,997,0,0
|
cmd.o,9.896321%,3589,0,2592,997,0,0
|
||||||
ipc.o,6.577634%,2438,0,1424,1014,0,0
|
ipc.o,6.722550%,2438,0,1424,1014,0,0
|
||||||
ulog.o,5.800621%,2150,589,1950,200,0,589
|
ulog.o,5.936690%,2153,589,1950,203,0,589
|
||||||
thread.o,5.784433%,2144,12,1902,242,0,12
|
thread.o,5.911873%,2144,12,1902,242,0,12
|
||||||
drv_uart.o,5.393228%,1999,2180,1920,79,0,2180
|
kservice.o,5.498263%,1994,260,1738,256,0,260
|
||||||
kservice.o,5.379738%,1994,260,1738,256,0,260
|
mem.o,5.183919%,1880,72,1512,368,0,72
|
||||||
mem.o,5.072171%,1880,72,1512,368,0,72
|
drv_uart.o,4.927480%,1787,3180,1708,79,0,3180
|
||||||
bsp_history.o,4.092810%,1517,1684,1408,109,0,1684
|
bsp_history.o,4.171952%,1513,1684,1404,109,0,1684
|
||||||
shell.o,3.893161%,1443,281,1412,31,0,281
|
shell.o,3.978933%,1443,281,1412,31,0,281
|
||||||
timer.o,3.121543%,1157,20,1002,155,0,20
|
timer.o,3.190316%,1157,20,1002,155,0,20
|
||||||
mc_p.l,2.754620%,1021,4,884,133,4,0
|
mc_p.l,2.815309%,1021,4,884,133,4,0
|
||||||
segger_rtt_printf.o,2.692567%,998,0,998,0,0,0
|
segger_rtt_printf.o,2.751889%,998,0,998,0,0,0
|
||||||
msh.o,2.549575%,945,0,784,161,0,0
|
msh.o,2.605747%,945,0,784,161,0,0
|
||||||
object.o,2.501012%,927,132,708,107,112,20
|
object.o,2.556113%,927,132,708,107,112,20
|
||||||
bsp_rtc.o,1.885876%,699,6,600,99,0,6
|
bsp_rtc.o,1.927425%,699,6,600,99,0,6
|
||||||
segger_rtt.o,1.715904%,636,1208,610,26,0,1208
|
segger_rtt.o,1.753709%,636,1208,610,26,0,1208
|
||||||
lwrb.o,1.651153%,612,0,612,0,0,0
|
lwrb.o,1.494513%,542,0,542,0,0,0
|
||||||
scheduler.o,1.354377%,502,280,484,18,0,280
|
scheduler.o,1.384217%,502,280,484,18,0,280
|
||||||
ciu32l051_std_lpuart.o,0.895724%,332,0,332,0,0,0
|
ciu32l051_std_lpuart.o,0.915458%,332,0,332,0,0,0
|
||||||
main.o,0.874140%,324,0,244,80,0,0
|
perf_counter.o,0.854795%,310,56,298,4,8,48
|
||||||
perf_counter.o,0.836369%,310,56,298,4,8,48
|
cpuport.o,0.849280%,308,12,308,0,0,12
|
||||||
cpuport.o,0.830973%,308,12,308,0,0,12
|
idle.o,0.744499%,270,416,248,22,0,416
|
||||||
idle.o,0.728450%,270,416,248,22,0,416
|
components.o,0.672807%,244,0,228,16,0,0
|
||||||
components.o,0.658303%,244,0,228,16,0,0
|
ciu32l051_std_rtc.o,0.650747%,236,0,236,0,0,0
|
||||||
ciu32l051_std_rtc.o,0.636719%,236,0,236,0,0,0
|
startup_ciu32l051.o,0.606629%,220,1024,28,192,0,1024
|
||||||
startup_ciu32l051.o,0.593552%,220,1024,28,192,0,1024
|
context_rvds.o,0.595599%,216,0,216,0,0,0
|
||||||
context_rvds.o,0.582760%,216,0,216,0,0,0
|
ciu32l051_std_rcc.o,0.595599%,216,0,216,0,0,0
|
||||||
ciu32l051_std_rcc.o,0.582760%,216,0,216,0,0,0
|
drv_common.o,0.562510%,204,0,204,0,0,0
|
||||||
drv_common.o,0.550384%,204,0,204,0,0,0
|
system_ciu32l051.o,0.551481%,200,4,164,32,4,0
|
||||||
system_ciu32l051.o,0.539593%,200,4,164,32,4,0
|
ciu32l051_std_flash.o,0.518392%,188,0,188,0,0,0
|
||||||
ciu32l051_std_flash.o,0.539593%,200,0,200,0,0,0
|
ciu32l051_std_usart.o,0.512877%,186,0,186,0,0,0
|
||||||
ciu32l051_std_usart.o,0.501821%,186,0,186,0,0,0
|
_strtoul.o,0.457729%,166,0,166,0,0,0
|
||||||
_strtoul.o,0.447862%,166,0,166,0,0,0
|
perf_os_patch_rt_thread.o,0.435670%,158,0,154,4,0,0
|
||||||
perf_os_patch_rt_thread.o,0.426278%,158,0,154,4,0,0
|
ciu32l051_std_gpio.o,0.424640%,154,0,154,0,0,0
|
||||||
ciu32l051_std_gpio.o,0.415486%,154,0,154,0,0,0
|
ctype_o.o,0.388794%,141,0,8,133,0,0
|
||||||
ctype_o.o,0.380413%,141,0,8,133,0,0
|
board.o,0.358462%,130,0,130,0,0,0
|
||||||
board.o,0.350735%,130,0,130,0,0,0
|
strtol.o,0.308829%,112,0,112,0,0,0
|
||||||
strtol.o,0.302172%,112,0,112,0,0,0
|
ciu32l051_std_dma.o,0.275740%,100,0,100,0,0,0
|
||||||
ciu32l051_std_dma.o,0.269796%,100,0,100,0,0,0
|
uldiv.o,0.264711%,96,0,96,0,0,0
|
||||||
uldiv.o,0.259004%,96,0,96,0,0,0
|
irq.o,0.242652%,88,12,88,0,0,12
|
||||||
irq.o,0.237421%,88,12,88,0,0,12
|
main.o,0.237137%,86,0,40,46,0,0
|
||||||
uidiv_div0.o,0.167274%,62,0,62,0,0,0
|
uidiv_div0.o,0.170959%,62,0,62,0,0,0
|
||||||
console_be.o,0.145690%,54,48,50,4,0,48
|
console_be.o,0.148900%,54,48,50,4,0,48
|
||||||
clock.o,0.145690%,54,4,54,0,0,4
|
clock.o,0.148900%,54,4,54,0,0,4
|
||||||
init.o,0.129502%,48,0,48,0,0,0
|
init.o,0.132355%,48,0,48,0,0,0
|
||||||
cpp_init.o,0.107919%,40,0,40,0,0,0
|
cpp_init.o,0.110296%,40,0,40,0,0,0
|
||||||
memseta.o,0.097127%,36,0,36,0,0,0
|
memseta.o,0.099267%,36,0,36,0,0,0
|
||||||
memcpya.o,0.097127%,36,0,36,0,0,0
|
memcpya.o,0.099267%,36,0,36,0,0,0
|
||||||
llushr.o,0.091731%,34,0,34,0,0,0
|
llushr.o,0.093752%,34,0,34,0,0,0
|
||||||
llshl.o,0.086335%,32,0,32,0,0,0
|
llshl.o,0.088237%,32,0,32,0,0,0
|
||||||
strncmp.o,0.080939%,30,0,30,0,0,0
|
strncmp.o,0.082722%,30,0,30,0,0,0
|
||||||
handlers.o,0.080939%,30,0,30,0,0,0
|
handlers.o,0.082722%,30,0,30,0,0,0
|
||||||
_chval.o,0.080939%,30,0,30,0,0,0
|
_chval.o,0.082722%,30,0,30,0,0,0
|
||||||
strncpy.o,0.070147%,26,0,26,0,0,0
|
strncpy.o,0.071692%,26,0,26,0,0,0
|
||||||
memcmp.o,0.070147%,26,0,26,0,0,0
|
memcmp.o,0.071692%,26,0,26,0,0,0
|
||||||
atoi.o,0.070147%,26,0,26,0,0,0
|
atoi.o,0.071692%,26,0,26,0,0,0
|
||||||
ciu32l051_std.o,0.064751%,24,0,24,0,0,0
|
ciu32l051_std.o,0.066178%,24,0,24,0,0,0
|
||||||
strlen.o,0.037771%,14,0,14,0,0,0
|
strlen.o,0.038604%,14,0,14,0,0,0
|
||||||
errno.o,0.032376%,12,4,8,0,4,0
|
errno.o,0.033089%,12,4,8,0,4,0
|
||||||
entry9a.o,0.021584%,8,0,8,0,0,0
|
entry9a.o,0.022059%,8,0,8,0,0,0
|
||||||
entry2.o,0.021584%,8,0,8,0,0,0
|
entry2.o,0.022059%,8,0,8,0,0,0
|
||||||
entry8a.o,0.010792%,4,0,4,0,0,0
|
entry8a.o,0.011030%,4,0,4,0,0,0
|
||||||
entry5.o,0.010792%,4,0,4,0,0,0
|
entry5.o,0.011030%,4,0,4,0,0,0
|
||||||
|
|
|
|
@ -1,24 +1,24 @@
|
||||||
File_name,ram_percent,ram,flash,Code,RO_data,RW_data,ZI_data
|
File_name,ram_percent,ram,flash,Code,RO_data,RW_data,ZI_data
|
||||||
drv_uart.o,26.227142%,2180,1999,1920,79,0,2180
|
drv_uart.o,34.149483%,3180,1787,1708,79,0,3180
|
||||||
bsp_history.o,20.259865%,1684,1517,1408,109,0,1684
|
bsp_history.o,18.084192%,1684,1513,1404,109,0,1684
|
||||||
segger_rtt.o,14.533205%,1208,636,610,26,0,1208
|
segger_rtt.o,12.972508%,1208,636,610,26,0,1208
|
||||||
startup_ciu32l051.o,12.319538%,1024,220,28,192,0,1024
|
startup_ciu32l051.o,10.996564%,1024,220,28,192,0,1024
|
||||||
ulog.o,7.086141%,589,2150,1950,200,0,589
|
ulog.o,6.325172%,589,2153,1950,203,0,589
|
||||||
idle.o,5.004812%,416,270,248,22,0,416
|
idle.o,4.467354%,416,270,248,22,0,416
|
||||||
shell.o,3.380655%,281,1443,1412,31,0,281
|
shell.o,3.017612%,281,1443,1412,31,0,281
|
||||||
scheduler.o,3.368624%,280,502,484,18,0,280
|
scheduler.o,3.006873%,280,502,484,18,0,280
|
||||||
kservice.o,3.128008%,260,1994,1738,256,0,260
|
kservice.o,2.792096%,260,1994,1738,256,0,260
|
||||||
object.o,1.588066%,132,927,708,107,112,20
|
object.o,1.417526%,132,927,708,107,112,20
|
||||||
mem.o,0.866217%,72,1880,1512,368,0,72
|
mem.o,0.773196%,72,1880,1512,368,0,72
|
||||||
perf_counter.o,0.673725%,56,310,298,4,8,48
|
perf_counter.o,0.601375%,56,310,298,4,8,48
|
||||||
console_be.o,0.577478%,48,54,50,4,0,48
|
console_be.o,0.515464%,48,54,50,4,0,48
|
||||||
timer.o,0.240616%,20,1157,1002,155,0,20
|
timer.o,0.214777%,20,1157,1002,155,0,20
|
||||||
thread.o,0.144370%,12,2144,1902,242,0,12
|
thread.o,0.128866%,12,2144,1902,242,0,12
|
||||||
irq.o,0.144370%,12,88,88,0,0,12
|
irq.o,0.128866%,12,88,88,0,0,12
|
||||||
cpuport.o,0.144370%,12,308,308,0,0,12
|
cpuport.o,0.128866%,12,308,308,0,0,12
|
||||||
bsp_rtc.o,0.072185%,6,699,600,99,0,6
|
bsp_rtc.o,0.064433%,6,699,600,99,0,6
|
||||||
mc_p.l,0.048123%,4,1021,884,133,4,0
|
mc_p.l,0.042955%,4,1021,884,133,4,0
|
||||||
errno.o,0.048123%,4,12,8,0,4,0
|
errno.o,0.042955%,4,12,8,0,4,0
|
||||||
system_ciu32l051.o,0.048123%,4,200,164,32,4,0
|
system_ciu32l051.o,0.042955%,4,200,164,32,4,0
|
||||||
clock.o,0.048123%,4,54,54,0,0,4
|
clock.o,0.042955%,4,54,54,0,0,4
|
||||||
bsp_flash.o,0.048123%,4,5165,3656,1509,0,4
|
bsp_flash.o,0.042955%,4,4899,3420,1479,0,4
|
||||||
|
|
|
BIN
MDK/bsp_flash.o
BIN
MDK/bsp_flash.o
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
MDK/drv_uart.o
BIN
MDK/drv_uart.o
Binary file not shown.
BIN
MDK/kservice.o
BIN
MDK/kservice.o
Binary file not shown.
BIN
MDK/main.o
BIN
MDK/main.o
Binary file not shown.
|
@ -120,10 +120,8 @@ std_status_t std_flash_word_program(uint32_t address, uint32_t prog_data)
|
||||||
{
|
{
|
||||||
/* 进入编程模式 */
|
/* 进入编程模式 */
|
||||||
std_flash_program_enable();
|
std_flash_program_enable();
|
||||||
|
|
||||||
/* 向目标地址写入数据 */
|
/* 向目标地址写入数据 */
|
||||||
*(uint32_t *)address = (uint32_t)prog_data;
|
*(uint32_t *)address = (uint32_t)prog_data;
|
||||||
|
|
||||||
/* 查询Flash忙状态及错误状态,等待擦除完成 */
|
/* 查询Flash忙状态及错误状态,等待擦除完成 */
|
||||||
status = std_flash_wait_for_last_operation(FLASH_WAIT_PROGRAM);
|
status = std_flash_wait_for_last_operation(FLASH_WAIT_PROGRAM);
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: mbw
|
* @Author: mbw
|
||||||
* @Date: 2024-08-22 16:15:08
|
* @Date: 2024-08-22 16:15:08
|
||||||
* @LastEditors: mbw && 1600520629@qq.com
|
* @LastEditors: mbw && 1600520629@qq.com
|
||||||
* @LastEditTime: 2024-09-04 08:59:24
|
* @LastEditTime: 2024-09-04 11:52:14
|
||||||
* @FilePath: \USART1_Interrupt - RT-Thread\bsp\src\bsp_flash.c
|
* @FilePath: \USART1_Interrupt - RT-Thread\bsp\src\bsp_flash.c
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
|
@ -62,7 +62,7 @@ const uint32_t hr_record_info_start_addr[9] = {
|
||||||
FLASH_UPDATE_TIME_ADDR,
|
FLASH_UPDATE_TIME_ADDR,
|
||||||
};
|
};
|
||||||
|
|
||||||
static rt_ubase_t interrupt_value;
|
rt_ubase_t level = 0;
|
||||||
static void BSP_Flash_UnLock(void)
|
static void BSP_Flash_UnLock(void)
|
||||||
{
|
{
|
||||||
std_flash_unlock();
|
std_flash_unlock();
|
||||||
|
@ -76,12 +76,12 @@ static void BSP_Flash_Lock(void)
|
||||||
|
|
||||||
static void Flash_Interrupt_Disable(void)
|
static void Flash_Interrupt_Disable(void)
|
||||||
{
|
{
|
||||||
interrupt_value = rt_hw_interrupt_disable();
|
level = rt_hw_interrupt_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Flash_Interrupt_Enable(void)
|
static void Flash_Interrupt_Enable(void)
|
||||||
{
|
{
|
||||||
rt_hw_interrupt_enable(interrupt_value);
|
rt_hw_interrupt_enable(level);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算校验和的函数
|
// 计算校验和的函数
|
||||||
|
@ -112,9 +112,14 @@ static size_t Flash_ReadWord(uint32_t addr, uint32_t *buf, size_t len)
|
||||||
RTT_LOG_E("addr %#X is not aligned\r\n", addr);
|
RTT_LOG_E("addr %#X is not aligned\r\n", addr);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < len; i++, buf += 4, addr += 4, read_len++)
|
for (size_t i = 0; i < len; i++, read_len++)
|
||||||
{
|
{
|
||||||
*(uint32_t *)buf = *(uint32_t *)addr;
|
buf[i] = ((uint32_t *)addr)[i];
|
||||||
|
if (buf[i] != ((uint32_t *)addr)[i])
|
||||||
|
{
|
||||||
|
RTT_LOG_E("Flash_Read Data Mismatch at addr %#X, expected %d got %d", addr, *(uint32_t *)buf, *(uint32_t *)addr);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return read_len;
|
return read_len;
|
||||||
|
@ -139,19 +144,19 @@ static std_status_t Flash_WriteWord(uint32_t addr, uint32_t write_data)
|
||||||
if (std_flash_get_lock_status() == false)
|
if (std_flash_get_lock_status() == false)
|
||||||
{
|
{
|
||||||
/* 进入编程模式 */
|
/* 进入编程模式 */
|
||||||
std_flash_program_enable();
|
// std_flash_program_enable();
|
||||||
Flash_Interrupt_Disable();
|
Flash_Interrupt_Disable();
|
||||||
if (std_flash_word_program(addr, write_data) != SUCCESS) // 写入操作 字节写入
|
if (std_flash_word_program(addr, write_data) != SUCCESS) // 写入操作 字节写入
|
||||||
{
|
{
|
||||||
Flash_Interrupt_Enable();
|
Flash_Interrupt_Enable();
|
||||||
LOG_D("addr = %#X, read %d", addr, *(uint32_t *)addr);
|
LOG_D("addr = %#X, read %d", addr, *(uint32_t *)addr);
|
||||||
|
|
||||||
std_flash_program_disable();
|
// std_flash_program_disable();
|
||||||
BSP_Flash_Lock();
|
BSP_Flash_Lock();
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
Flash_Interrupt_Enable();
|
Flash_Interrupt_Enable();
|
||||||
std_flash_program_disable();
|
// std_flash_program_disable();
|
||||||
BSP_Flash_Lock();
|
BSP_Flash_Lock();
|
||||||
if (*(uint32_t *)addr != write_data)
|
if (*(uint32_t *)addr != write_data)
|
||||||
{
|
{
|
||||||
|
@ -337,18 +342,27 @@ static std_status_t Flash_WritePage(uint32_t addr, uint32_t *buf, size_t len)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
std_status_t Flash_ErasePage(uint32_t index)
|
||||||
|
{
|
||||||
|
std_flash_unlock();
|
||||||
|
RTT_LOG_D("ErasePage %d", index);
|
||||||
|
// Flash_Interrupt_Disable();
|
||||||
|
std_status_t status = std_flash_erase(FLASH_ERASE_PAGE, index);
|
||||||
|
// Flash_Interrupt_Enable();
|
||||||
|
std_flash_lock();
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 擦除产品信息页
|
* @description: 擦除产品信息页
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
void Flash_ErasePage_ConfigInfo(void)
|
void Flash_ErasePage_ConfigInfo(void)
|
||||||
{
|
{
|
||||||
std_flash_unlock();
|
if (Flash_ErasePage(FLASH_HR_INFO_PAGE) != SUCCESS)
|
||||||
if (std_flash_page_erase(FLASH_HR_INFO_PAGE) != SUCCESS)
|
|
||||||
{
|
{
|
||||||
RTT_LOG_E("error_page = %#x\r\n");
|
RTT_LOG_E("error_page = %#x\r\n");
|
||||||
}
|
}
|
||||||
std_flash_lock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorStatus BSP_Flash_Program_InfoPage(uint32_t address, uint32_t *data_buf)
|
ErrorStatus BSP_Flash_Program_InfoPage(uint32_t address, uint32_t *data_buf)
|
||||||
|
@ -365,9 +379,12 @@ ErrorStatus BSP_Flash_Program_InfoPage(uint32_t address, uint32_t *data_buf)
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rt_thread_mdelay(2);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 写产品信息页(最后一页)
|
* @description: 写产品信息页(最后一页)
|
||||||
* @param {uint8_t*} frame
|
* @param {uint8_t*} frame
|
||||||
|
@ -383,15 +400,7 @@ uint32_t Flash_Get_Current_Page(uint32_t addr)
|
||||||
{
|
{
|
||||||
return (addr - FLASH_START_ADDR) / FLASH_PAGE_BYTE_SIZE;
|
return (addr - FLASH_START_ADDR) / FLASH_PAGE_BYTE_SIZE;
|
||||||
}
|
}
|
||||||
std_status_t Flash_ErasePage(uint32_t index)
|
|
||||||
{
|
|
||||||
std_flash_unlock();
|
|
||||||
RTT_LOG_D("ErasePage %d", index);
|
|
||||||
std_status_t status = std_flash_erase(FLASH_ERASE_PAGE, index);
|
|
||||||
std_flash_lock();
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @description: 擦除历史记录区的页
|
* @description: 擦除历史记录区的页
|
||||||
* @param {TeRecord} addr 需要擦除的页相对于其项目起始页的偏移量
|
* @param {TeRecord} addr 需要擦除的页相对于其项目起始页的偏移量
|
||||||
|
@ -410,7 +419,6 @@ ErrorStatus Flash_ErasePage_Records(TeRecord record, uint8_t page_offset)
|
||||||
|
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Flash_ErasePage(erase_page) != SUCCESS)
|
if (Flash_ErasePage(erase_page) != SUCCESS)
|
||||||
{
|
{
|
||||||
RTT_LOG_E("Flash_ErasePage failed\r\n");
|
RTT_LOG_E("Flash_ErasePage failed\r\n");
|
||||||
|
@ -448,11 +456,9 @@ ErrorStatus BSP_Flash_EraseRecodrs(void)
|
||||||
|
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*擦除初始信息区*/
|
|
||||||
Flash_ErasePage_ConfigInfo();
|
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -488,8 +494,6 @@ ErrorStatus Flash_GetProductTimeLimit(TuFlashHrRecordFrame *pLimitTime, TeFlashP
|
||||||
RTT_LOG_E("FactoryTime check_sum error\r\n");
|
RTT_LOG_E("FactoryTime check_sum error\r\n");
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTT_LOG_D("FactoryTime: %#X", pLimitTime->hr_data);
|
|
||||||
RTT_LOG_D("Flash_Read_FactoryTime:%04d-%02d-%02d,%02d:%02d",
|
RTT_LOG_D("Flash_Read_FactoryTime:%04d-%02d-%02d,%02d:%02d",
|
||||||
BASE_YEAR + pLimitTime->time.year, pLimitTime->time.month, pLimitTime->time.day,
|
BASE_YEAR + pLimitTime->time.year, pLimitTime->time.month, pLimitTime->time.day,
|
||||||
pLimitTime->time.hour, pLimitTime->time.minute);
|
pLimitTime->time.hour, pLimitTime->time.minute);
|
||||||
|
@ -509,9 +513,6 @@ ErrorStatus Flash_GetProductTimeLimit(TuFlashHrRecordFrame *pLimitTime, TeFlashP
|
||||||
RTT_LOG_E("ExpirationTime check_sum error\r\n");
|
RTT_LOG_E("ExpirationTime check_sum error\r\n");
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTT_LOG_D("kExpirationTimeId: %#X", pLimitTime->hr_data);
|
|
||||||
|
|
||||||
RTT_LOG_D("Flash_Read_ExpirationTime:%04d-%02d-%02d,%02d:%02d",
|
RTT_LOG_D("Flash_Read_ExpirationTime:%04d-%02d-%02d,%02d:%02d",
|
||||||
BASE_YEAR + pLimitTime->time.year, pLimitTime->time.month, pLimitTime->time.day,
|
BASE_YEAR + pLimitTime->time.year, pLimitTime->time.month, pLimitTime->time.day,
|
||||||
pLimitTime->time.hour, pLimitTime->time.minute);
|
pLimitTime->time.hour, pLimitTime->time.minute);
|
||||||
|
@ -537,6 +538,7 @@ void Flash_SetProductTimeLimit(uint16_t year, uint8_t mon, uint8_t day, uint8_t
|
||||||
TuFlashHrRecordFrame ReadLimitTime;
|
TuFlashHrRecordFrame ReadLimitTime;
|
||||||
uint32_t page_buf[FLASH_PAGE_RECORD_WORD_NUM] = {0}; // 暂存最后一页的值
|
uint32_t page_buf[FLASH_PAGE_RECORD_WORD_NUM] = {0}; // 暂存最后一页的值
|
||||||
|
|
||||||
|
|
||||||
Flash_ErasePage_ReadConfigInfo(page_buf);
|
Flash_ErasePage_ReadConfigInfo(page_buf);
|
||||||
|
|
||||||
LimitTime.time.year = year - BASE_YEAR;
|
LimitTime.time.year = year - BASE_YEAR;
|
||||||
|
@ -554,10 +556,11 @@ void Flash_SetProductTimeLimit(uint16_t year, uint8_t mon, uint8_t day, uint8_t
|
||||||
{
|
{
|
||||||
page_buf[kFlashExpirationTime] = LimitTime.hr_data;
|
page_buf[kFlashExpirationTime] = LimitTime.hr_data;
|
||||||
}
|
}
|
||||||
RTT_LOG_D("Flash_SetProductTimeLimit((%d)):%04d-%02d-%02d,%02d:%02d ", id, year, mon, day, hour, min);
|
// RTT_LOG_D("Flash_SetProductTimeLimit((%d)):%04d-%02d-%02d,%02d:%02d ", id, year, mon, day, hour, min);
|
||||||
Flash_Write_ConfigInfo(&page_buf[0]);
|
Flash_Write_ConfigInfo(&page_buf[0]);
|
||||||
Flash_GetProductTimeLimit(&ReadLimitTime, id);
|
Flash_GetProductTimeLimit(&ReadLimitTime, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/**
|
/**
|
||||||
* @description: 产品信息初始化,
|
* @description: 产品信息初始化,
|
||||||
|
@ -568,23 +571,24 @@ int BSP_Flash_Init(void)
|
||||||
|
|
||||||
if (*(uint32_t *)FLASH_CONFIG_INFO_START_ADDR != FLASH_FIRST_INIT_VALUE)
|
if (*(uint32_t *)FLASH_CONFIG_INFO_START_ADDR != FLASH_FIRST_INIT_VALUE)
|
||||||
{
|
{
|
||||||
uint32_t info_page_buf[FLASH_PAGE_RECORD_WORD_NUM / 2] = {0};
|
uint32_t info_page_buf[FLASH_PAGE_RECORD_WORD_NUM] = {0};
|
||||||
|
|
||||||
BSP_Flash_EraseRecodrs(); // 擦除历史数据区
|
BSP_Flash_EraseRecodrs(); // 擦除历史数据区
|
||||||
// TODO: 此处需要完善,比如写入初始化标志位,写入产品信息,写入出厂时间,写入到期时间
|
// TODO: 此处需要完善,比如写入初始化标志位,写入产品信息,写入出厂时间,写入到期时间
|
||||||
info_page_buf[kFlashInitFlag] = FLASH_FIRST_INIT_VALUE;
|
// info_page_buf[kFlashInitFlag] = FLASH_FIRST_INIT_VALUE;
|
||||||
if (Flash_Write_ConfigInfo(info_page_buf) != STD_OK)
|
|
||||||
{
|
// if (Flash_Write_ConfigInfo(info_page_buf) != STD_OK)
|
||||||
RTT_LOG_E("Flash_Write_ConfigInfo failed\r\n");
|
// {
|
||||||
return RT_ERROR;
|
// RTT_LOG_E("Flash_Write_ConfigInfo failed\r\n");
|
||||||
}
|
// return RT_ERROR;
|
||||||
|
// }
|
||||||
Flash_SetProductTimeLimit(2024, 1, 2, 3, 4, kFactoryTimeId);
|
Flash_SetProductTimeLimit(2024, 1, 2, 3, 4, kFactoryTimeId);
|
||||||
rt_thread_mdelay(100);
|
|
||||||
Flash_SetProductTimeLimit(2024 + 10, 1, 2, 3, 4, kExpirationTimeId);
|
Flash_SetProductTimeLimit(2024 + 10, 1, 2, 3, 4, kExpirationTimeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RT_EOK;
|
return RT_EOK;
|
||||||
}
|
}
|
||||||
|
INIT_APP_EXPORT(BSP_Flash_Init);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
/**
|
/**
|
||||||
|
@ -709,9 +713,8 @@ ErrorStatus Flash_Read_Record(TuFlashHrRecordFrame *pHrRecord, TeRecord record,
|
||||||
pHrRecord->time.hour, pHrRecord->time.minute);
|
pHrRecord->time.hour, pHrRecord->time.minute);
|
||||||
|
|
||||||
RTT_LOG_D("read :hr_start_addr = %#x, index_addr: %#x, hr_num: %d, hr_page:%d, read_data : %#X\r\n",
|
RTT_LOG_D("read :hr_start_addr = %#x, index_addr: %#x, hr_num: %d, hr_page:%d, read_data : %#X\r\n",
|
||||||
Index_Frame.hr_start_addr, index_addr, Index_Frame.hr_num, Index_Frame.hr_page, pHrRecord.hr_data);
|
Index_Frame.hr_start_addr, index_addr, Index_Frame.hr_num, Index_Frame.hr_page, pHrRecord->hr_data);
|
||||||
|
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -230,11 +230,11 @@ ErrorStatus HR_ProcessData(const TsFrameData *pHostFrameData)
|
||||||
}
|
}
|
||||||
case kGetCurrentTime: // AA 00 08 00 B2 55
|
case kGetCurrentTime: // AA 00 08 00 B2 55
|
||||||
{
|
{
|
||||||
// uint8_t rtctime[3] = {0}, rtcdate[3] = {0};
|
uint8_t rtctime[3] = {0}, rtcdate[3] = {0};
|
||||||
|
|
||||||
data_len = FRAME_DATA_LEN;
|
data_len = FRAME_DATA_LEN;
|
||||||
|
|
||||||
// BSP_Rtc_Get_Calendar(rtcdate, rtctime);
|
BSP_Rtc_Get_Calendar(rtcdate, rtctime);
|
||||||
|
|
||||||
data_field[0] = ((std_rtc_convert_bcd2bin(rtcdate[0]) + 2000) >> 8) & 0xFF;
|
data_field[0] = ((std_rtc_convert_bcd2bin(rtcdate[0]) + 2000) >> 8) & 0xFF;
|
||||||
data_field[1] = (std_rtc_convert_bcd2bin(rtcdate[0]) + 2000) & 0xFF;
|
data_field[1] = (std_rtc_convert_bcd2bin(rtcdate[0]) + 2000) & 0xFF;
|
||||||
|
@ -250,6 +250,7 @@ ErrorStatus HR_ProcessData(const TsFrameData *pHostFrameData)
|
||||||
|
|
||||||
goto send;
|
goto send;
|
||||||
}
|
}
|
||||||
|
/*扩展指令*/
|
||||||
// case kSetFactoryTime: /*2024-03-26 9:30:00 AA 00 0B 07 07 E8 03 1A 09 1E 00 EF 55*/
|
// case kSetFactoryTime: /*2024-03-26 9:30:00 AA 00 0B 07 07 E8 03 1A 09 1E 00 EF 55*/
|
||||||
// {
|
// {
|
||||||
// LOG_D("kSetFactoryTime\r\n");
|
// LOG_D("kSetFactoryTime\r\n");
|
||||||
|
@ -335,8 +336,8 @@ static void hr_send_thread_entry(void *param)
|
||||||
static void Hr_Thread_Entry(void *param)
|
static void Hr_Thread_Entry(void *param)
|
||||||
{
|
{
|
||||||
rt_uint8_t buf[32] = {0};
|
rt_uint8_t buf[32] = {0};
|
||||||
BSP_Flash_Init();
|
// BSP_Flash_Init();
|
||||||
rt_thread_mdelay(100);
|
// rt_thread_mdelay(100);
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
rt_sem_take(hr_rx_sem, RT_WAITING_FOREVER); // 等待信号量
|
rt_sem_take(hr_rx_sem, RT_WAITING_FOREVER); // 等待信号量
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: mbw
|
* @Author: mbw
|
||||||
* @Date: 2024-08-20 15:51:16
|
* @Date: 2024-08-20 15:51:16
|
||||||
* @LastEditors: mbw && 1600520629@qq.com
|
* @LastEditors: mbw && 1600520629@qq.com
|
||||||
* @LastEditTime: 2024-08-29 16:19:28
|
* @LastEditTime: 2024-09-04 11:54:28
|
||||||
* @FilePath: \USART1_Interrupt - RT-Thread\drivers\inc\drv_uart.h
|
* @FilePath: \USART1_Interrupt - RT-Thread\drivers\inc\drv_uart.h
|
||||||
* @Description:
|
* @Description:
|
||||||
* @
|
* @
|
||||||
|
@ -45,7 +45,7 @@ typedef enum
|
||||||
|
|
||||||
/*------------------------------------------defines---------------------------------------------*/
|
/*------------------------------------------defines---------------------------------------------*/
|
||||||
/***********************UART1**************************** */
|
/***********************UART1**************************** */
|
||||||
#define UART1_DMA_RX_THREAD_STACK_SIZE (1024)
|
#define UART1_DMA_RX_THREAD_STACK_SIZE (2024)
|
||||||
#define UART1_DMA_RX_THREAD_PRIORITY (20)
|
#define UART1_DMA_RX_THREAD_PRIORITY (20)
|
||||||
#define UART1_DMA_RX_THREAD_TIMESLICE (5)
|
#define UART1_DMA_RX_THREAD_TIMESLICE (5)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: mbw
|
* @Author: mbw
|
||||||
* @Date: 2024-08-19 10:10:06
|
* @Date: 2024-08-19 10:10:06
|
||||||
* @LastEditors: mbw && 1600520629@qq.com
|
* @LastEditors: mbw && 1600520629@qq.com
|
||||||
* @LastEditTime: 2024-08-28 14:09:18
|
* @LastEditTime: 2024-09-04 11:42:27
|
||||||
* @FilePath: \USART1_Interrupt - RT-Thread\user\Source\main.c
|
* @FilePath: \USART1_Interrupt - RT-Thread\user\Source\main.c
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
|
@ -41,11 +41,11 @@ int main(void)
|
||||||
{
|
{
|
||||||
// uint8_t rtctime[3], rtcdate[3];
|
// uint8_t rtctime[3], rtcdate[3];
|
||||||
|
|
||||||
LOG_I("test CIU32 L051 RT-Thread!\r\n");
|
// LOG_I("test CIU32 L051 RT-Thread!\r\n");
|
||||||
LOG_I("SystemCoreClock = %d MHZ\n", SystemCoreClock/1000000);
|
// LOG_I("SystemCoreClock = %d MHZ\n", SystemCoreClock/1000000);
|
||||||
|
|
||||||
UART1_SendString("test CIU32 L051 uart1 dma send RT-Thread!\r\n");
|
// UART1_SendString("test CIU32 L051 uart1 dma send RT-Thread!\r\n");
|
||||||
LPUART1_SendString("test CIU32 L051 Lpuart1 interrupt send RT-Thread!\r\n");
|
// LPUART1_SendString("test CIU32 L051 Lpuart1 interrupt send RT-Thread!\r\n");
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ int main(void)
|
||||||
// LOG_D("RTC Time: %04d-%02d-%02d %02d:%02d:%02d\n",
|
// LOG_D("RTC Time: %04d-%02d-%02d %02d:%02d:%02d\n",
|
||||||
// 2000 + std_rtc_convert_bcd2bin(rtcdate[0]),std_rtc_convert_bcd2bin(rtcdate[1]), std_rtc_convert_bcd2bin(rtcdate[2]),
|
// 2000 + std_rtc_convert_bcd2bin(rtcdate[0]),std_rtc_convert_bcd2bin(rtcdate[1]), std_rtc_convert_bcd2bin(rtcdate[2]),
|
||||||
// std_rtc_convert_bcd2bin(rtctime[0]), std_rtc_convert_bcd2bin(rtctime[1]), std_rtc_convert_bcd2bin(rtctime[2]));
|
// std_rtc_convert_bcd2bin(rtctime[0]), std_rtc_convert_bcd2bin(rtctime[1]), std_rtc_convert_bcd2bin(rtctime[2]));
|
||||||
rt_thread_mdelay(50000);
|
rt_thread_mdelay(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue