Skip to content

gemesa/stm32-rf-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Wi-Fi scanner

This project contains the source code of an nRF24L01+ and Blue Pill (STM32F103C8T6) based Wi-Fi scanner. A similar, Arduino libraries based design by cpixip can be found at forum.arduino.cc. The code of this project has been implemented using

  • Eclipse,
  • STM32Fx project templates,
  • STM32CubeMX,
  • STM32 HAL.

Prerequisites

The prerequisites and the toolchain are detailed in Mastering STM32 written by Carmine Noviello.

Mandatory tools:

  • Eclipse
    • C/C++ Development Tools SDK
    • GNU ARM Eclipse Plug-ins
  • GCC ARM
  • make
  • STM32CubeMX
  • STM32CubeProgrammer

Note: Flash loader demonstrator can also be used for downloading but it is outdated.

The version numbers are stored in docs/toolchain_versions.md. Some issues which are not detailed in Mastering STM32 and might be encountered during the use of the toolchain are detailed in docs/toolchain_issues.md.

Optional tools:

Note: STSW-LINK007 is used to upgrade the firmware of the ST-LINK for OpenOCD if necessary.

Mandatory HWs:

  • Blue Pill
  • nRF24L01+
  • ST-LINK/V2
  • USB-UART adapter

Note: flash can be accessed without SWD using other interfaces. Refer to www.st.com for more information.

Results

Measurement results can be found in the meas folder.

Deployment

The basic configuration has to be generated with STM32CubeMX. The following peripherals have to be configured:

  • UART - USB-UART adapter <-- Blue Pill
  • SPI - Blue Pill <--> nRF24L01+
  • TIM - required for delay function
  • GPIO - required for CE, SS and LED pins

The blue_pill_config.ioc project file and the generated source code can be found at config/cubemx. An STM32F1xx C project has to be created in Eclipse after this. All instructions can be found in the mentioned book. The files generated by CubeMX have to be copied to the proper folders of the Eclipse project manually or by running tools/cubemx_importer.py:

python cubemx_importer.py <eclipse_project_path> <cubemx_project_path> [<stm32doxyfile_path>]

The STM32F103xB macro has to be defined and the Eclipse project can be built after this. If the compilation of the base configuration is successful we can add our functionality to the main function.

Add the includes to main.c:

#include "util.h"
#include "wifi_scanner.h"

Add the init function calls:

util_init();
wifi_scanner_init();

Add the step and blink function calls to the while loop:

wifi_scanner_step();
blink_led();

The blinking LED indicates whether the SW runs or not. Compile the code and download the binary to the Blue Pill. Connect the configured pins to the nRF24L01+. Run the SW. The results can be read with an USB-UART adapter.

License

Under construction.

SW architecture

The aim is to follow the AUTOSAR standards.