Skip to content

Commit

Permalink
[bsp][stm32][nano] support nano version
Browse files Browse the repository at this point in the history
stm32 BSPs to support nano version (RT_USING_NANO)

这个commit支持到stm32f7之前的BSP
  • Loading branch information
mysterywolf committed Dec 3, 2023
1 parent 860094e commit bb66d1e
Show file tree
Hide file tree
Showing 305 changed files with 973 additions and 728 deletions.
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32f10x/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ menu "On-chip Peripheral Drivers"

endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32l1xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_WDT
default n

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32l5xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32mp1xx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ menu "On-chip Peripheral Drivers"

endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/templates/stm32wbxx/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ menu "On-chip Peripheral Drivers"
endchoice
endif

source "../libraries/HAL_Drivers/drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
10 changes: 10 additions & 0 deletions bsp/stm32/stm32f072-st-nucleo/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ config PKGS_DIR
option env="PKGS_ROOT"
default "packages"

config SOC_STM32F072RB
bool
select SOC_SERIES_STM32F0
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

source "$RTT_DIR/Kconfig"
source "$PKGS_DIR/Kconfig"
source "../libraries/Kconfig"

if !RT_USING_NANO
source "board/Kconfig"
endif

6 changes: 5 additions & 1 deletion bsp/stm32/stm32f072-st-nucleo/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
* Change Logs:
* Date Author Notes
* 2018-11-06 zylx first version
* 2023-12-03 Meco Man support nano version
*/

#include <board.h>
#include <rtthread.h>
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#include <board.h>
#endif /* RT_USING_NANO */

/* defined the LED2 (user LED) pin: PA5 */
#define LED2_PIN GET_PIN(A, 5)
Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f072-st-nucleo/board/Kconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
menu "Hardware Drivers Config"

config SOC_STM32F072RB
bool
select SOC_SERIES_STM32F0
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

menu "Onboard Peripheral Drivers"
config BSP_USING_STLINK_TO_USART
bool "Enable STLINK TO USART (uart2)"
Expand Down Expand Up @@ -166,7 +159,7 @@ menu "On-chip Peripheral Drivers"
endif
endif

source "../libraries/HAL_Drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
3 changes: 2 additions & 1 deletion bsp/stm32/stm32f072-st-nucleo/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* 2018-12-21 zylx first version
*/

#include "board.h"
#include <board.h>
#include <drv_common.h>

void SystemClock_Config(void)
{
Expand Down
3 changes: 0 additions & 3 deletions bsp/stm32/stm32f072-st-nucleo/board/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
#ifndef __BOARD_H__
#define __BOARD_H__

#include <rtthread.h>
#include <stm32f0xx.h>
#include "drv_common.h"
#include "drv_gpio.h"

#ifdef __cplusplus
extern "C" {
Expand Down
10 changes: 10 additions & 0 deletions bsp/stm32/stm32f091-st-nucleo/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ config PKGS_DIR
option env="PKGS_ROOT"
default "packages"

config SOC_STM32F091RC
bool
select SOC_SERIES_STM32F0
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

source "$RTT_DIR/Kconfig"
source "$PKGS_DIR/Kconfig"
source "../libraries/Kconfig"

if !RT_USING_NANO
source "board/Kconfig"
endif

6 changes: 5 additions & 1 deletion bsp/stm32/stm32f091-st-nucleo/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
* Change Logs:
* Date Author Notes
* 2018-11-06 zylx first version
* 2023-12-03 Meco Man support nano version
*/

#include <board.h>
#include <rtthread.h>
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#include <board.h>
#endif /* RT_USING_NANO */

/* defined the LED2 pin: PA5 */
#define LED2_PIN GET_PIN(A, 5)
Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f091-st-nucleo/board/Kconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
menu "Hardware Drivers Config"

config SOC_STM32F091RC
bool
select SOC_SERIES_STM32F0
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

menu "Onboard Peripheral Drivers"

config BSP_USING_USB_TO_USART
Expand Down Expand Up @@ -157,7 +150,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_WDT
default n

source "../libraries/HAL_Drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
3 changes: 2 additions & 1 deletion bsp/stm32/stm32f091-st-nucleo/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* 2018-12-21 zylx first version
*/

#include "board.h"
#include <board.h>
#include <drv_common.h>

void SystemClock_Config(void)
{
Expand Down
3 changes: 0 additions & 3 deletions bsp/stm32/stm32f091-st-nucleo/board/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
#ifndef __BOARD_H__
#define __BOARD_H__

#include <rtthread.h>
#include <stm32f0xx.h>
#include "drv_common.h"
#include "drv_gpio.h"

#ifdef __cplusplus
extern "C" {
Expand Down
10 changes: 10 additions & 0 deletions bsp/stm32/stm32f103-100ask-mini/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ config PKGS_DIR
option env="PKGS_ROOT"
default "packages"

config SOC_STM32F103C8
bool
select SOC_SERIES_STM32F1
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

source "$RTT_DIR/Kconfig"
source "$PKGS_DIR/Kconfig"
source "../libraries/Kconfig"

if !RT_USING_NANO
source "board/Kconfig"
endif

6 changes: 5 additions & 1 deletion bsp/stm32/stm32f103-100ask-mini/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
* Change Logs:
* Date Author Notes
* 2019-03-08 obito0 first version
* 2023-12-03 Meco Man support nano version
*/

#include <board.h>
#include <rtthread.h>
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#include <board.h>
#endif /* RT_USING_NANO */

/* defined the LED0 pin: PA1 */
#define LED0_PIN GET_PIN(A, 1)
Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-100ask-mini/board/Kconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
menu "Hardware Drivers Config"

config SOC_STM32F103C8
bool
select SOC_SERIES_STM32F1
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

menu "Onboard Peripheral Drivers"

config BSP_USING_USB_TO_USART
Expand Down Expand Up @@ -79,7 +72,7 @@ menu "On-chip Peripheral Drivers"
default n
endif

source "../libraries/HAL_Drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
3 changes: 2 additions & 1 deletion bsp/stm32/stm32f103-100ask-mini/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* 2019-03-08 obito0 first version
*/

#include "board.h"
#include <board.h>
#include <drv_common.h>

void SystemClock_Config(void)
{
Expand Down
3 changes: 0 additions & 3 deletions bsp/stm32/stm32f103-100ask-mini/board/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
#ifndef __BOARD_H__
#define __BOARD_H__

#include <rtthread.h>
#include <stm32f1xx.h>
#include "drv_common.h"
#include "drv_gpio.h"

#ifdef __cplusplus
extern "C" {
Expand Down
10 changes: 10 additions & 0 deletions bsp/stm32/stm32f103-100ask-pro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ config PKGS_DIR
option env="PKGS_ROOT"
default "packages"

config SOC_STM32F103ZE
bool
select SOC_SERIES_STM32F1
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

source "$RTT_DIR/Kconfig"
source "$PKGS_DIR/Kconfig"
source "../libraries/Kconfig"

if !RT_USING_NANO
source "board/Kconfig"
endif

6 changes: 5 additions & 1 deletion bsp/stm32/stm32f103-100ask-pro/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
* Change Logs:
* Date Author Notes
* 2019-03-08 obito0 first version
* 2023-12-03 Meco Man support nano version
*/

#include <board.h>
#include <rtthread.h>
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#include <board.h>
#endif /* RT_USING_NANO */

/* defined the LED0 pin: PA1 */
#define LED0_PIN GET_PIN(B, 5)
Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-100ask-pro/board/Kconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
menu "Hardware Drivers Config"

config SOC_STM32F103ZE
bool
select SOC_SERIES_STM32F1
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

menu "Onboard Peripheral Drivers"

config BSP_USING_USB_TO_USART
Expand Down Expand Up @@ -208,7 +201,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_CAN
default n

source "../libraries/HAL_Drivers/Kconfig"
source "$BSP_DIR/../libraries/HAL_Drivers/drivers/Kconfig"

endmenu

Expand Down
Loading

0 comments on commit bb66d1e

Please sign in to comment.