Cellular X-CUBE-CELLULAR How To

Revision as of 17:02, 23 March 2021 by Registered User

Click here for Cellular overview

1. How To...

1.1. Introduction

This Wiki page is a guideline describing how to perform the main activities with X-CUBE-CELLULAR.

1.2. How to start delivered binary firmware

Binary firmware are provided for each supported board. For example to run the STM32L496 binary for the BG96 modem, follow the steps below:

  1. Insert an activated SIM on the BG96 modem STMod+ board
  2. Plug the BG96 modem board (module up, SIM down) on the STM32L496 board
  3. Plug an USB cable (the one near the blue quad-switch) on the STM32L496 board (-> a new volume (DIS_L496ZG) appears on your PC)
  4. Flash the firmware (Drag & Drop the .bin on the new appears volume)
  5. Open a TeraTerm serial terminal and set the right parameters
  6. If needed, by default it is empty, enter the right SIM APN using the command line

See below for details

1.3. How to find the needed delivered binary

All the provided binaries are here: \Projects\<STM32 board name>\Demonstrations\Cellular\Binaries\
Example: \Projects\32L496GDISCOVERY\Demonstrations\Cellular\Binaries\
Name of the binaries indicate its purpose, <STM32 board>_<modem>_<IP stack>.bin

  • l496_bg96_lwip.bin is the binary for the L496 discovery board associated to the BG96 modem and the IP stack selected is the LwIP into the STM32
  • l496_bg96_socket.bin is the binary for the L496 discovery board associated to the BG96 modem and the IP stack selected is the one into the modem

1.4. How to setup Teraterm parameters

  • Terminal
    • [New line]
      • [Receive]: Auto
      • [Transmit]: CR
    • [Local echo] selected
  • Serial
    • [Baud rate]: 115200
    • [Data]: 8 bit
    • [Parity]: none
    • [Stop]: 1 bit
    • [Flow control]: none
    • [Transmit delay]: 10 ms each

1.5. How to setup list available commands

Hit "enter" then type "help" then hit "enter" the list of commands is displayed.
Example:
List of commands
----------------
help  : help command
trace  : trace management
comlib  : com library commands
cst  : cellular service task management
atcmd  : send an at command
modem  : modem configuration management
cellularapp  : CellularApp commands
echoclient  : EchoClient commands
ping  : Ping commands

So to send an AT command to modem just enter: atcmd AT+QIRC

1.6. How to setup APN using command line

Example, name of APN is "em", there is no login neither password.
Enter the following commands:

  • cst apnconf em
  • cst targetstate off
  • cst targetstate full

Note to list all cst command parameter just enter "cst help"
The last 2 commands are used to restart modem to take into account the just defined APN.
If you wan to avoid this step, it is easy to modify APN values in the source code and rebuild the firmware. See below for details.

1.7. How to set the SIM APN by updating the plf_cellular_config.h file

According to the SIM/operator used, the cellular parameters can be updated in the plf_cellular_config.h file that contains all the configurable cellular service parameters.

1.8. How to use console commands to get the modem and cellular network information

  1. Open a Tera Term serial terminal and set the right parameters.
  2. Remove the trace display by typing the commands:
  • trace off
  • cst poll off

Then type the Cellular Service commands:

  • cst
  • cst state
  • cst info
  • cst config

1.9. How to configure the modem radio band

  1. Open a Tera Term serial terminal and set the right parameters
  2. Start the firmware and select Modem power on option in the boot menu
  3. Type the modem command to get help of the modem configuration.

1.10. How to to select components to include in the cellular firmware

The firmware can be customized by adding or removing components or applications.
The configuration file plf_custom_config.h allows selection of the component to include in the cellular firmware by define/undefine environment variables.
Refer to the user manual document (UM2426) how to customize the software.

1.11. How to change default behavior of the application

The delivered firmware start Cellular_App application. The default behavior is that a single echo service is started. This service send data to Echo server which reply the same. Once answer from Echo server received, the echo client send again data to Echo server. A 2nd instance of the Echo client can be started to test multiple socket configuration. The address of the Echo server can be changed. It is also possible to send ping command during Echo client is running. It is also possible to start perfomance test.

1.12. How to implement your own application

The easiest way to implement your application is to adapt Cellular_App content to your needs.
Another method is to add a new entry task for this new application and start it from main (do not forget to remove entry task start for Cellular_App to avoid conflicts).
Your application is in charge to initialize and start Cellular middleware (for this copy paste the needed lines from Cellular_App)

1.13. How to setup iSIM for GMS01Q

There are 2 STMod+ boards with Monarch Sequans modem, one with GM01Q (defaut one in the X-CUBE-CELLULAR delivery) and one with GMS01Q.
The GMS01Q is a GM01Q with an iSIM.
So to use GMS01Q there is a small modification to do in the source code, .h file.
the file to update is Projects\<board>\Demonstrations\Cellular\STM32_Cellular\Config\plf_cellular_config.h
with <board> = B-L4S5I-IOT01A or 32L496GDISCOVERY or STWINKT1 or ... according the STM32 board you are working with.
patch the file as below and rebuild the binary.

  1. define PLF_CELLULAR_SIM_SLOT_NB (1U)
  2. define PLF_CELLULAR_SIM_INDEX_0 (2U) /*!< SIM SLOT 0 interface */
  3. define PLF_CELLULAR_SIM_INDEX_1 (99U) /*!< SIM SLOT 1 interface */
  4. define PLF_CELLULAR_SIM_INDEX_2 (99U) /*!< SIM SLOT 2 interface */
  5. define PLF_CELLULAR_SIM_INDEX_3 (99U) /*!< SIM SLOT 3 interface */