Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,15 @@ config ARCH_BOARD_NUCLEO_L552ZE
---help---
STMicro Nucleo STM32L552 board based on the STMicro STM32L552ZET6 MCU.

config ARCH_BOARD_FLIPPERZERO
bool "Flipper Zero"
depends on ARCH_CHIP_STM32WB55RG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
---help---
Flipper Zero device based on the STMicro STM32WB55RGV6 MCU.

config ARCH_BOARD_NUCLEO_WB55RG
bool "STM32WB55 Nucleo WB55RG"
depends on ARCH_CHIP_STM32WB55RG
Expand Down Expand Up @@ -2737,6 +2746,7 @@ config ARCH_BOARD
default "steval-stlcs01v1" if ARCH_BOARD_STEVAL_STLCS01V1
default "nucleo-l496zg" if ARCH_BOARD_NUCLEO_L496ZG
default "nucleo-l552ze" if ARCH_BOARD_NUCLEO_L552ZE
default "flipperzero" if ARCH_BOARD_FLIPPERZERO
default "nucleo-wb55rg" if ARCH_BOARD_NUCLEO_WB55RG
default "nucleo-wl55jc" if ARCH_BOARD_NUCLEO_WL55JC
default "nutiny-nuc120" if ARCH_BOARD_NUTINY_NUC120
Expand Down Expand Up @@ -3308,6 +3318,9 @@ endif
if ARCH_BOARD_STM32L562E_DK
source "boards/arm/stm32l5/stm32l562e-dk/Kconfig"
endif
if ARCH_BOARD_FLIPPERZERO
source "boards/arm/stm32wb/flipperzero/Kconfig"
endif
if ARCH_BOARD_NUCLEO_WB55RG
source "boards/arm/stm32wb/nucleo-wb55rg/Kconfig"
endif
Expand Down
8 changes: 8 additions & 0 deletions boards/arm/stm32wb/flipperzero/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

if ARCH_BOARD_FLIPPERZERO

endif # ARCH_BOARD_FLIPPERZERO
60 changes: 60 additions & 0 deletions boards/arm/stm32wb/flipperzero/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
README.txt
==========

This README file discusses the port of NuttX to the Flipper Zero multi-tool
device. See https://flipperzero.one/ for device details.

Contents
========

- Device features
- Status
- Programming
- Serial Console
- Configurations

Device features
===============

- Multi-protocol wireless STM32WB55RGV6 MCU with 1MiB of Flash and 256KiB of SRAM.
- USB Type-C connector for communication and charging
- LiPo battery with charger BQ25896 and fuel gauge BQ27220
- 5-button joystick and a Back button
- ST7565 128x64 LCD
- RGB LED with LP5562 I2C driver
- Buzzer
- Vibration motor
- Micro SD slot connected over SPI
- CC1101 RF transceiver
- ST25R3916 high-performance NFC Universal Device and EMVCo reader
- 125 kHz RFID analog circuit
- IR led
- TSOP75538 IR receiver
- iButton connector
- GPIO connector with power out and SWD pins

Status
======

Oct 2022: initial nsh configuration.

Programming
===========

The device can be normally flashing and debugging over SWD interface or flashing via
USB interface when the device is in DFU mode using STMicro's STM32CubeProgrammer. The
DFU mode will be activated after pressing two round button for 30s. Original firmware
can be flashed back and stay working until the secure flash area is not changed.

Serial Console
==============

The MCU's USART1 PB6/PB7 pins are available as external GPIO pins 13/14.

Configurations
==============

nsh:

Configures the NuttShell (nsh) located at examples/nsh. This
configuration is focused on low level, command-line driver testing.
42 changes: 42 additions & 0 deletions boards/arm/stm32wb/flipperzero/configs/nsh/defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_ARCH_LEDS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="flipperzero"
CONFIG_ARCH_BOARD_FLIPPERZERO=y
CONFIG_ARCH_CHIP="stm32wb"
CONFIG_ARCH_CHIP_STM32WB55RG=y
CONFIG_ARCH_CHIP_STM32WB=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=6500
CONFIG_BUILTIN=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INTELHEX_BINARY=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=196608
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_STM32WB_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
CONFIG_STM32WB_DMA1=y
CONFIG_STM32WB_PWR=y
CONFIG_STM32WB_USART1=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_TESTING_OSTEST=y
CONFIG_USART1_SERIAL_CONSOLE=y
115 changes: 115 additions & 0 deletions boards/arm/stm32wb/flipperzero/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/****************************************************************************
* boards/arm/stm32wb/flipperzero/include/board.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

#ifndef __BOARDS_ARM_STM32WB_FLIPPERZERO_INCLUDE_BOARD_H
#define __BOARDS_ARM_STM32WB_FLIPPERZERO_INCLUDE_BOARD_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif

/* Clocking *****************************************************************/

#include "flipperzero-clocking.h"

/* Do not include STM32WB header files here */

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* USART */

#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */
#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */

/* LEDs */

/* LED index values for use with board_userled() */

/* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
* defined. In that case, the usage by the board port is defined in
* include/board.h and src/stm32_autoleds.c.
*/

#define LED_STARTED 0
#define LED_HEAPALLOCATE 0
#define LED_IRQSENABLED 0
#define LED_STACKCREATED 1
#define LED_INIRQ 1
#define LED_SIGNAL 2
#define LED_ASSERTION 2
#define LED_PANIC 1

/* Buttons */

#define BUTTON_SW1 0 /* PC4, needs SB47 close */
#define BUTTON_SW2 1 /* PD0 */
#define BUTTON_SW3 2 /* PD1 */
#define NUM_BUTTONS 3

#define BUTTON_SW1_BIT (1 << BUTTON_SW1)
#define BUTTON_SW2_BIT (1 << BUTTON_SW2)
#define BUTTON_SW3_BIT (1 << BUTTON_SW3)

/****************************************************************************
* Public Data
****************************************************************************/

#ifndef __ASSEMBLY__

#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif

/****************************************************************************
* Public Function Prototypes
****************************************************************************/

/****************************************************************************
* Name: stm32wb_board_initialize
*
* Description:
* All STM32WB architectures must provide the following entry point.
* This entry point is called early in the initialization -- after all
* memory has been configured and mapped but before any devices have been
* initialized.
*
****************************************************************************/

void stm32wb_board_initialize(void);

#undef EXTERN
#if defined(__cplusplus)
}
#endif

#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_STM32WB_FLIPPERZERO_INCLUDE_BOARD_H */
Loading