Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
在你之后
rt-thread
提交
06eafe39
R
rt-thread
项目概览
在你之后
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
06eafe39
编写于
10月 28, 2020
作者:
B
Bernard Xiong
提交者:
GitHub
10月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3979 from Dozingfiretruck/master
修复ADC异常
上级
f399aa6f
ec3e26ba
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
64 addition
and
75 deletion
+64
-75
bsp/stm32/README.md
bsp/stm32/README.md
+2
-0
bsp/stm32/libraries/HAL_Drivers/drv_adc.c
bsp/stm32/libraries/HAL_Drivers/drv_adc.c
+6
-4
bsp/stm32/libraries/STM32WBxx_HAL/SConscript
bsp/stm32/libraries/STM32WBxx_HAL/SConscript
+44
-44
bsp/stm32/stm32wb55-st-nucleo/.config
bsp/stm32/stm32wb55-st-nucleo/.config
+3
-18
bsp/stm32/stm32wb55-st-nucleo/board/linker_scripts/link.lds
bsp/stm32/stm32wb55-st-nucleo/board/linker_scripts/link.lds
+7
-1
bsp/stm32/stm32wb55-st-nucleo/rtconfig.h
bsp/stm32/stm32wb55-st-nucleo/rtconfig.h
+2
-8
未找到文件。
bsp/stm32/README.md
浏览文件 @
06eafe39
...
...
@@ -58,6 +58,8 @@ STM32 系列 BSP 目前支持情况如下表所示:
|
**MP1 系列**
| |
|
[
stm32mp157a-st-discovery
](
stm32mp157a-st-discovery
)
| ST 官方 STM32MP157A-DK1 开发板 |
|
[
stm32mp157a-st-ev1
](
stm32mp157a-st-ev1
)
| ST 官方 STM32MP157A-EV1 开发板 |
|
**WB 系列**
| |
|
[
stm32wb55-st-nucleo
](
stm32wb55-st-nucleo
)
| ST 官方 STM32WB55-nucleo 开发板 |
可以通过阅读相应 BSP 下的 README 来快速上手,如果想要使用 BSP 更多功能可参考 docs 文件夹下提供的说明文档,如下表所示:
...
...
bsp/stm32/libraries/HAL_Drivers/drv_adc.c
浏览文件 @
06eafe39
...
...
@@ -193,7 +193,7 @@ static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t ch
return
-
RT_ERROR
;
}
#if defined(SOC_SERIES_STM32MP1) || defined (SOC_SERIES_STM32H7)
#if defined(SOC_SERIES_STM32MP1) || defined (SOC_SERIES_STM32H7)
|| defined (SOC_SERIES_STM32WB)
ADC_ChanConf
.
Rank
=
ADC_REGULAR_RANK_1
;
#else
ADC_ChanConf
.
Rank
=
1
;
...
...
@@ -205,22 +205,24 @@ static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t ch
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_55CYCLES_5
;
#elif defined(SOC_SERIES_STM32F2) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F7)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_112CYCLES
;
#elif defined(SOC_SERIES_STM32L4)
|| defined (SOC_SERIES_STM32WB)
#elif defined(SOC_SERIES_STM32L4)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_247CYCLES_5
;
#elif defined(SOC_SERIES_STM32MP1)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_810CYCLES_5
;
#elif defined(SOC_SERIES_STM32H7)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_64CYCLES_5
;
#elif defined (SOC_SERIES_STM32WB)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_2CYCLES_5
;
#endif
#if defined(SOC_SERIES_STM32F2) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F7) || defined(SOC_SERIES_STM32L4) || defined (SOC_SERIES_STM32WB)
ADC_ChanConf
.
Offset
=
0
;
#endif
#if defined(SOC_SERIES_STM32L4)
|| defined (SOC_SERIES_STM32WB)
#if defined(SOC_SERIES_STM32L4)
ADC_ChanConf
.
OffsetNumber
=
ADC_OFFSET_NONE
;
ADC_ChanConf
.
SingleDiff
=
LL_ADC_SINGLE_ENDED
;
#elif defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7)
#elif defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7)
|| defined (SOC_SERIES_STM32WB)
ADC_ChanConf
.
OffsetNumber
=
ADC_OFFSET_NONE
;
/* ADC channel affected to offset number */
ADC_ChanConf
.
Offset
=
0
;
ADC_ChanConf
.
SingleDiff
=
ADC_SINGLE_ENDED
;
/* ADC channel differential mode */
...
...
bsp/stm32/libraries/STM32WBxx_HAL/SConscript
浏览文件 @
06eafe39
...
...
@@ -8,73 +8,73 @@ cwd = GetCurrentDir()
src
=
Split
(
'''
CMSIS/Device/ST/STM32WBxx/Source/Templates/system_stm32wbxx.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_comp.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_cortex.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_crc.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_crc_ex.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_cryp.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_cryp_ex.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_dma.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_dma_ex.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_exti.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_pwr.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_pwr_ex.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_rcc.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_rcc_ex.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_rng.c
STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_gpio.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_comp.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_cortex.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_crc.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_crc_ex.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_cryp.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_cryp_ex.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_dma.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_dma_ex.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_exti.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_pwr.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_pwr_ex.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_rcc.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_rcc_ex.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_rng.c
STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_gpio.c
'''
)
if
GetDepend
([
'RT_USING_SERIAL'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_uart.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_uart_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_usart.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_usart_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_uart.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_uart_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_usart.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_usart_ex.c'
]
if
GetDepend
([
'RT_USING_I2C'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_i2c.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_i2c_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_i2c.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_i2c_ex.c'
]
if
GetDepend
([
'RT_USING_SPI'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_spi.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_spi_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_qspi.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_spi.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_spi_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_qspi.c'
]
if
GetDepend
([
'RT_USING_USB_HOST'
])
or
GetDepend
([
'RT_USING_USB_DEVICE'
]):
# src += ['STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_hcd.c']
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_pcd.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_pcd_ex.c'
]
# src += ['STM32WBxx_HAL_Driver/Src/
STM
32wbxx_ll_usb.c']
# src += ['STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_hcd.c']
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_pcd.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_pcd_ex.c'
]
# src += ['STM32WBxx_HAL_Driver/Src/
stm
32wbxx_ll_usb.c']
if
GetDepend
([
'RT_USING_HWTIMER'
])
or
GetDepend
([
'RT_USING_PWM'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_lptim.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_tim.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_tim_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_lptim.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_tim.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_tim_ex.c'
]
if
GetDepend
([
'RT_USING_ADC'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_adc.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_adc_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_adc.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_adc_ex.c'
]
if
GetDepend
([
'RT_USING_RTC'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_rtc.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_rtc_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_rtc.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_rtc_ex.c'
]
if
GetDepend
([
'RT_USING_WDT'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_iwdg.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_wwdg.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_iwdg.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_wwdg.c'
]
if
GetDepend
([
'RT_USING_AUDIO'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_sai.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_sai_ex.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_sai.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_sai_ex.c'
]
if
GetDepend
([
'RT_USING_PM'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_lptim.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_lptim.c'
]
if
GetDepend
([
'BSP_USING_ON_CHIP_FLASH'
]):
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_flash.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_flash_ex.c'
]
# src += ['STM32WBxx_HAL_Driver/Src/
STM
32wbxx_hal_flash_ramfunc.c']
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_flash.c'
]
src
+=
[
'STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_flash_ex.c'
]
# src += ['STM32WBxx_HAL_Driver/Src/
stm
32wbxx_hal_flash_ramfunc.c']
...
...
bsp/stm32/stm32wb55-st-nucleo/.config
浏览文件 @
06eafe39
...
...
@@ -65,7 +65,7 @@ CONFIG_RT_USING_DEVICE=y
# CONFIG_RT_USING_INTERRUPT_INFO is not set
CONFIG_RT_USING_CONSOLE
=
y
CONFIG_RT_CONSOLEBUF_SIZE
=
128
CONFIG_RT_CONSOLE_DEVICE_NAME
=
"uart"
CONFIG_RT_CONSOLE_DEVICE_NAME
=
"uart
1
"
CONFIG_RT_VER_NUM
=
0
x40003
CONFIG_ARCH_ARM
=
y
CONFIG_RT_USING_CPU_FFS
=
y
...
...
@@ -108,18 +108,7 @@ CONFIG_FINSH_ARG_MAX=10
#
# Device virtual file system
#
CONFIG_RT_USING_DFS
=
y
CONFIG_DFS_USING_WORKDIR
=
y
CONFIG_DFS_FILESYSTEMS_MAX
=
2
CONFIG_DFS_FILESYSTEM_TYPES_MAX
=
2
CONFIG_DFS_FD_MAX
=
16
# CONFIG_RT_USING_DFS_MNTTABLE is not set
# CONFIG_RT_USING_DFS_ELMFAT is not set
CONFIG_RT_USING_DFS_DEVFS
=
y
# CONFIG_RT_USING_DFS_ROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set
# CONFIG_RT_USING_DFS_UFFS is not set
# CONFIG_RT_USING_DFS_JFFS2 is not set
# CONFIG_RT_USING_DFS is not set
#
# Device Drivers
...
...
@@ -164,11 +153,7 @@ CONFIG_RT_USING_PIN=y
#
CONFIG_RT_USING_LIBC
=
y
# CONFIG_RT_USING_PTHREADS is not set
CONFIG_RT_USING_POSIX
=
y
# CONFIG_RT_USING_POSIX_MMAP is not set
# CONFIG_RT_USING_POSIX_TERMIOS is not set
# CONFIG_RT_USING_POSIX_GETLINE is not set
# CONFIG_RT_USING_POSIX_AIO is not set
# CONFIG_RT_USING_MODULE is not set
#
...
...
bsp/stm32/stm32wb55-st-nucleo/board/linker_scripts/link.lds
浏览文件 @
06eafe39
...
...
@@ -5,7 +5,7 @@
/* Program Entry, set to mark it as "used" and avoid gc */
MEMORY
{
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 1024 /* 1024KB flash */
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 1024
k
/* 1024KB flash */
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 192k /* 192KB sram */
}
ENTRY(Reset_Handler)
...
...
@@ -153,4 +153,10 @@ SECTIONS
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
bsp/stm32/stm32wb55-st-nucleo/rtconfig.h
浏览文件 @
06eafe39
...
...
@@ -40,7 +40,7 @@
#define RT_USING_DEVICE
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart"
#define RT_CONSOLE_DEVICE_NAME "uart
1
"
#define RT_VER_NUM 0x40003
#define ARCH_ARM
#define RT_USING_CPU_FFS
...
...
@@ -74,12 +74,6 @@
/* Device virtual file system */
#define RT_USING_DFS
#define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 2
#define DFS_FILESYSTEM_TYPES_MAX 2
#define DFS_FD_MAX 16
#define RT_USING_DFS_DEVFS
/* Device Drivers */
...
...
@@ -96,7 +90,7 @@
/* POSIX layer and C standard library */
#define RT_USING_LIBC
#define RT_USING_POSIX
/* Network */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录