微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > ucOS学习笔记(6)——一步一步移植ucOS到STM32

ucOS学习笔记(6)——一步一步移植ucOS到STM32

时间:11-10 来源:互联网 点击:

arm through EXT Line Interrupt
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.
DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int.

AREA |.text|, CODE, READONLY

App_NMI_ISR B App_NMI_ISR
App_Fault_ISR B App_Fault_ISR
App_Spurious_ISR B App_Spurious_ISR

; Reset handler routine
Reset_Handler PROC
EXPORT Reset_Handler

IF DATA_IN_ExtSRAM == 1
; FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is
; required, then adjust the Register Addresses

; Enable FSMC clock
LDR R0,= 0x00000114
LDR R1,= 0x40021014
STR R0,[R1]

; Enable GPIOD, GPIOE, GPIOF and GPIOG clocks
LDR R0,= 0x000001E0
LDR R1,= 0x40021018
STR R0,[R1]

; SRAM Data lines, NOE and NWE configuration
; SRAM Address lines configuration
; NOE and NWE configuration
; NE3 configuration
; NBL0, NBL1 configuration

LDR R0,= 0x44BB44BB
LDR R1,= 0x40011400
STR R0,[R1]

LDR R0,= 0xBBBBBBBB
LDR R1,= 0x40011404
STR R0,[R1]

LDR R0,= 0xB44444BB
LDR R1,= 0x40011800
STR R0,[R1]

LDR R0,= 0xBBBBBBBB
LDR R1,= 0x40011804
STR R0,[R1]

LDR R0,= 0x44BBBBBB
LDR R1,= 0x40011C00
STR R0,[R1]

LDR R0,= 0xBBBB4444
LDR R1,= 0x40011C04
STR R0,[R1]

LDR R0,= 0x44BBBBBB
LDR R1,= 0x40012000
STR R0,[R1]

LDR R0,= 0x44444B44
LDR R1,= 0x40012004
STR R0,[R1]

; FSMC Configuration
; Enable FSMC Bank1_SRAM Bank

LDR R0,= 0x00001011
LDR R1,= 0xA0000010
STR R0,[R1]

LDR R0,= 0x00000200
LDR R1,= 0xA0000014
STR R0,[R1]


ENDIF

IMPORT __main
LDR R0, =__main
BX R0
ENDP

ALIGN

;*******************************************************************************
; User Stack and Heap initialization
;*******************************************************************************
IF :DEF:__MICROLIB

EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit

ELSE

IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap

__user_initial_stackheap

LDR R0, = Heap_Mem
LDR R1, =(Stack_Mem + Stack_Size)
LDR R2, = (Heap_Mem + Heap_Size)
LDR R3, = Stack_Mem
BX LR

ALIGN

ENDIF

END

;******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE*****

第二个问题是在main函数中我启用了统计任务,具体讲就是用OSStatInit初始化统计任务,通过串口向外发送统计任务结果发现CPU使用率始终为零。最终将OSStatInit函数放在最高优先级任务里执行才能得到有效的CPU利用率统计结果为1%。至于发生该情况的原因可以参考http://blog.csdn.net/liuxp_008/archive/2007/08/16/1746499.aspx

http://blog.163.com/tianyake@yeah/blog/static/74933141201141035129678/

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top