Set up a device-side development environment

Updated at:

Connect a microcontroller (MCU) to a communication module development board, set up a software development environment, create a code-based project, import the SDK, and configure the SDK.

Background information

This example uses two development boards, as shown in the following figures.

  • NUCLEO-F103RB development boardMCU IOT

    The following figure shows the pinout diagram.

    MCU IOT
  • SIM800C mini v2.0MCU IOT

    The following figure shows the pin diagram and pin descriptions.

    MCU IOT
    Pin Description
    PWR Power on/off pin. The device powers on automatically by default.
    STA Status monitoring pin.
    GND Power ground pin.
    RXD Serial port receive pin.
    TXD Serial port transmit pin.
    EN Power enable pin.
    VIN 5 V to 18 V power input.

Connect the hardware

Connect the receive and transmit serial ports of the two development boards to create an AT instruction channel, as shown in the following figure.

MCU IOT

Set up the development environment

This example uses STM32CubeMX as the development tool. For more information, see STM32Cube Ecosystem.

  1. Open STM32CubeMX and create a new project.
    MCU IOT
  2. In the Board Selector, search for NUCLEO-F103RB and click STM32F103RBTx.
    MCU IOT
  3. In the upper-right corner, click Start Project.
  4. In the Connectivity menu on the left, select the USART1 serial port as the communication port between the MCU and the module, and configure the following settings.
    • Set Mode to Asynchronous.
    • In the Configuration section, configure the following settings.
      • Under GPIO Settings, confirm that the pins are PA9 and PA10.
      • Under NVIC Settings, set USART1 global interrupt to Enabled.
    MCU IOT
  5. Under Middleware, select FREERTOS and configure it to use counting semaphores and set the heap size to allocate a stack for each thread.
    iot
  6. On the Project Manager tab, configure the Project settings.
    iot
  7. In the upper-right corner, click GENERATE CODE to generate the code-based project.