Getting Started with X-CUBE-SUBG2
Sep 1, 2020 11:21 · 1265 words · 6 minute read
Getting Started with X-CUBE-SUBG2 In this webinar we will see an introduction to STM32Cube the list of the required hardware and software tools how to install an STM32Cube Expansion Package in STM32CubeMX how to get started with the X-CUBE-SUBG2 in STM32CubeMX Introduction to STM32Cube STM32Cube is the Software Ecosystem for STM32, made and supported by STMicroelectronics, and proposed to all STM32 developers for free. It combines a set of PC software development tools and a set of embedded software bricks. STM32CubeExpansion packages provides an easy and powerful way to integrate additional components to the project, such as drivers for other ST components (sensors, for instance) or middleware components. The latest STM32CubeExpansion specifications offer the ability to configure and integrate these components directly into the project from STM32CubeMX and STM32CubeIDE. The embedded software environment for STM32 offers the standard STM32Cube MCU packages (such as STM32CubeF4, STM32CubeH7, STM32CubeL5 …).
01:38 - STM32Cube Expansion packages extend it with additional software components enabling high-level application solutions. Those packages can come: - from STMicroelectronics, to support digital or high-level software component from ST portfolio (eg: NFC, MEMS, Bluetooth or even AI). - from ST Partners or third parties - from communities and education programs, or from your own, personal or professional, to share embedded software components with each other or just within restricted groups. The STM32Cube Expansion guidelines are publicly available on www.st.com/stm32cube Required hardware and software You need an ST Nucleo board or any evaluation board equipped with an STM32MCU on the ST Nucleo board you have flexible board power supply through USB or external source integrated ST-Link/V2-1 for mass storage device flash programming 2 push buttons and 2 color LEDs the Arduino connectors to easy access to add-ons the STM32 MCU the Morpho extension headers to directly access the MCU pinout.
03:03 - In this webinar we will use a Nucleo-F401RE. You need the ST X-NUCLEO-S2915A1 expansion board equipped with the S2-LP sub-1 GHz transceiver On this board you have also the Arduino connectors to easy access to add-ons. The X-NUCLEO-S2915A1 expansion board must be plugged on top of the STM32 Nucleo board. Finally, you need the latest STM32CubeMX tool, available on st.com, installed on your PC. How to install an STM32Cube Expansion Package in STM32CubeMX Launch the STM32CubeMX on your PC. Click the INSTALL/REMOVE button. Go to STMicroelectronics tab. Expand the pack you need to install (e.g. the X-CUBE-SUBG2).
04:08 - Click the Refresh button to retrieve all the available pack versions. Select the version you want to install (it is suggested to install the latest one). Click the Install Now button to install the selected pack version. To successfully complete the installation process, accept the license terms and click Finish. The green box indicates that the pack has been successfully installed. Close the window.
04:45 - Getting Started with X-CUBE-SUBG2 in STM32CubeMX To set up a new project, the user can start either selecting an MCU or an ST board. In this webinar we will set up a new project selecting an ST board. As previously said, we will use the ST Nucleo-F401RE board. To easily find it in the ST board list, use some filter: check the STM32F4 box in the MCU Series list Once you find your board, double click on it to start the project. Click Yes to initialize all peripherals with their default mode.
05:26 - From the Pinout view it is possible to configure the MCU pins and enable the Peripherals Clicking the Software Packs menu it is also possible to include additional software components to the project. Just expand the line of the STM32 Expansion Package components you want to add and start to select the components. For example, select one of the P2P sample application. You can open the application Getting Started Guide containing all the information on how to set up a project using the X-CUBE-SUBG2 components. You can find, for instance, the sample application descriptions and the Configuration Steps section with the information on the pins, the peripherals and the differences among the various board families.
06:39 - For the selected sample application all the required software components can be easily detected from the Component dependencies window. Each P2P application matches one of the possible S2-LP based X-NUCLEO We will demonstrate S2915A1 configuration, that has more settings because of the Power Amplifier Select X-NUCLEO-S2915A1 expansion board to match S2915A1_P2P application Green icons indicates that the component dependencies are all solved, close the window Now the pinout configuration can start using the information contained in the Getting Started guide. Open it and take note of the pins, peripherals and prescaler settings that must be enabled and configured then you can start. Let’s start from the SPI bus Set PB3 as SPI1_SCK PA6 as SPI1_MISO PA7 as SPI1_MOSI and enable the SPI1 from the Connectivity list. Set the Prescaler value following the instructions in the Getting Started document Pins for Nucleo User Button and LED are already configured Now take note of the pins used by the X-NUCLEO-S2915A1 (if you use X-NUCLEO-S2868A1 or X-NUCLEO-S2868A2 the Power Amplifier section will not be present) set PC0 as GPIO-EXTI0 and PA1 as GPIO_Output then PA8 and PB4 as GPIO_Output then PC7 and PA0-WKUP as GPIO_Output and finally PA4 and PB0 as GPIO_Output as well Now we can configure the SUBG2 components clicking on Software Packs and then on STMicroelectronics.X-CUBE-SUBG2 pack.
09:57 - Select all the SUBG2 components and associate peripherals and pins to their proper function: - PA0-WKUP for S2915A1_PA_CSD (only for X-NUCLEO-S2915A1) - PA4 for S2915A1_PA_CPS (only for X-NUCLEO-S2915A1) - PB0 for S2915A1_PA_CTX (only for X-NUCLEO-S2915A1) - PC13-ANTI_TAMP for the BSP BUTTON - PA5 for the BSP LED - PC7 for S2915A1_LED - PA8 for S2915A1_SDN - Select SPI1 as S2915A1 BUS IO Driver - PC0 for S2915A1_GPIO3 - PA1 for S2915A1_S2LP_CS - PB4 for S2915A1_EEPROM_CS Clicking the System View the user can access the NVIC section to enable the interrupt lines. Among the NVIC, enable the EXTI line0 and EXTI line[15:10] interrupts Now click the Project Manager tab. Insert your project name. Check the Project Location on your file system. Select your preferred toolchain among the list of the supported ones. In this example we use the STM32CubeIDE (without the Under Root option). Now we are ready to generate the code clicking the GENERATE CODE button. Wait few seconds until the code generation process finish. To open the generated STM32CubeIDE project click the Open Project button. The STM32CubeIDE will start opening… Once the STM32CubeIDE is open, a pop-up will show the project import status, Close the pop-up, expand the project structure and browse the generated code (where you can find the application, the BSP and component driver files). Build the project to generate the binary file.
13:25 - The Console output in the IDE shows the logs of the build process. Wait until the build process finishes… After connecting your STM32 development board to your PC, flash it with the generated binary file. Right-click on the project name and select the Run As –> STM32 Cortex-M C/C++ Application (if a pop-up windows opens, accept the default settings) The flashing process will start (its progress is shown in the Console output). Flash two board sets. Once the flashing process has successfully terminated the P2P Application provides radio communication between the two boards press User (Blue) button on the first Nucleo board Nucleo (Green) LED blinks on the second board (message received) Nucleo (Green) LED blinks on the first board (ACK received) For more information, please, visit www.st.com/stm32cubemx Thank You! For further information on our products, please, visit us at www.st.com .