 Hello, in this video, we will discuss the basic RF measurements of the STM32WL board. There are several situations where RF measurements need to be made, for example, impedance matching where we optimize the transmitter and receiver for the best performance. Then we may need to verify that the RF parameters of our device are as expected. For example, the output power and receiver sensitivity are the same as in the datasheet and there is no performance loss due to implementation. And the last point, we and a certification lab must verify that the device meets all the requirements specified in the regional specifications for the RAIS and bands. RF measurements can be divided into two main groups. Conducted measurements, where the measured RF device and the measuring instrument are connected by an RF cable. Another group is radiated measurements. The measured RF device and the measuring instrument have antennas and the RF signal goes directly through the air. Each group has its own typical use case. RF measurements can also be divided into transmitter and receiver measurements. In case of transmitter measurements, the transmitter is connected to an instrument which measures this signal. It can be a spectrum analyzer, power meter, etc. In most cases, the spectrum analyzer is used which is a very versatile instrument for RF measurements. For example, typical transmitter measurements are measurements of output power, harmonics and spurious, unmodulated and modulated signal, phase noise and frequency offset. In the case of receiver measurements, we need an instrument that generates a signal. It's typically a signal generator. Using the signal generator, we can measure the fundamental parameter of the receiver which is the sensitivity. There are also other receiver parameters like blocking, co-channel rejection, adjacent channel rejection. To measure these parameters, additional signal generator is needed. This generator calls its interference on our channel. In this video, we will focus on how to configure the STM32WL for RF measurements. Then we will show how to set basic transmitter parameters like frequency or output power. Based on this knowledge, we will demonstrate basic carrier and spectrum measurements. The last part is about receiver measurement. Here we will focus to sensitivity. The aim of this video is to show the main idea. The presented ideas can be used also in other RF measurements with STM32WL. Now let's focus on the part about STM32WL configuration. To configure the STM32WL for RF measurements, you have several options. You can write your own firmware or you can reuse existing projects like Laura180 Slave or Sigfox 80 Slave. Both projects are part of the STM32QWL package. The original platform of these projects is the STM32WL nuclear board. The projects can be easily ported to different STM32WL platforms. In this video, we will focus on the Laura180 Slave. It is the STM32WL application for Laura on RF testing. It's controlled by text 80 commands. 80 commands are sent via UART console with these settings of UART. A graphical extension for STM32Q monitor is also available. The project is available in the STM32QWL package in this folder. There are two variants of the application. One forms one for single core and next for dual core version of STM32WL. As it was mentioned earlier, original platform of the 80 Slave is STM32WL nuclear board. It can be ported to other platforms. Here is a list of typical changes that need to be made during the porting. Control pins of the RF switch. Replacement of LSC clock source if not available. And replacement of LPUART if not available. Other changes depend on the specifics of the target platform. The 80 Slave supports many 80 commands. Detailed description of all commands can be found in this application note. Here is a list of most important ones for RF testing. The use of the commands is shown in the following example. Here I have a terminal application which is connected to the 80 Slave. At first I'm using a command which shows our list of all available commands. Then I reset the MCU. Now I'm reading current configuration of the radio. I can copy the configuration command with all parameters and use it again to set the new configuration. In this case I'm changing the output power from 14 to 0 dbm. I can turn on the unrelated carrier or turn it off. The last command transmits two packets based on the current radio configuration. All following tests of the transmitter and receiver are performed with a nuclear board in conducted mode. Now let's focus on the transmitter. In this chapter we take a closer look at the 80 Slave commands for changing the frequency and output power and how to turn on and off the unrelated carrier. These are the most basic operations for transmitter testing. Using the 80 Slave commands we will show basic measurement of the transmitter spectrum if there are some harmonic or spurious components. For transmitter measurements we use a spectrum analyzer that is connected directly to the board to be measured using an RF cable. Small insertion loss of the cable is not taken into account in the measurements. The format of the 80 Slave configuration command looks like this. The first parameter is the frequency. The second parameter is the output power level. The rest of the command are settings of the modem. For our tests where we use only unmodulated carrier we don't have to modify the modem parameters. To turn on the unmodulated carrier we use this command. It has no parameters. To turn off the unmodulated carrier we have this command. It has no parameters as well. Following spectrum analyzer settings we are used for the transmitter measurements. The first column is for in-band measurements. The second one for spurious and harmonics measurements up to 6 GHz. At first we connect the measured board to the spectrum analyzer. Here I have a trace from the spectrum analyzer and the terminal window. The frequency span is from 862 MHz to 872 MHz, 1 MHz per division. I use configuration command to get the current configuration. The frequency is 868 MHz and the output power 14 dBm. I keep these settings and turn on the carrier with a t-tone command. And here we can see the carrier. Before the changes of parameters carrier must be turned off by the t-off command. Now I change the frequency in the configuration command and turn on the carrier again. The frequency has changed. I turn the carrier off again and change the output power to 0 dBm. I turn on the carrier and it has different amplitude, 0 dBm. These are the basics of frequency and amplitude changes. Here is a short example of transmitter harmonic measurements. The frequency range of the spectrum analyzer is set from 100 MHz to 6 GHz. At first I reset the device by command ATZ. Now the device is in default state. I turn on the carrier. It has default frequency 868 MHz and 14 dBm. I can see the carrier and no harmonics in this or superior signals. If there are any they may be hidden under the noise floor with this approximately minus 55 dBm in this case. After the measurement I can turn off the carrier by command T-off. Now let's take a closer look at the receiver measurements. In this chapter we'll take a closer look at the receiver sensitivity. What is it? How it is measured? What are typical receiver sensitivities of the STN32WL and which AT commands are used for the measurement? As an example we will show one particular sensitivity measurement as a verification of the datasheet value. We can verify that our receiver part and the matching network work properly. For the sensitivity measurement we use vector signal generator which is connected directly to the measured board through another RF cable. What is receiver sensitivity? It's the minimum power on the receiver input that the receiver can handle at a certain level of signal quality. Smaller value is better. In digital communication the signal quality might be defined for example as bit error rate or packet error rate. The sensitivity is not a constant value. It depends on many parameters. For example higher bandwidth degrades the sensitivity. Lower data rate improves the sensitivity. How is the sensitivity measured? We can explain it in this chart. The horizontal axis is received power. The vertical axis is packet error rate. If we are reducing the power the packet error rate is zero up to a certain point. Then the packet error rate starts to increase up to 100%. The curve between zero and 100% of packet error rate may look like this. The sensitivity level is a received power at a certain level of packet error rate. We use one percent packet error rate. In this case the sensitivity level is minus 123 dBm. Here is the general principle of measurement. Our tested device is connected through the variable attenuator to the generator of the test signal. The attenuator may be also included inside the generator. Level of received power is measured by the power meter. Based on the number of successfully received packets the packet error rate is calculated. The test signal is attenuated until the packet error rate threshold is exceeded. In our example we will manually measure the receiver sensitivity step by step to illustrate the principle. We'll use a vector signal generator which is connected directly to the STN32WL board by a cable. A small insertion loss of the cable is neglected in our case. For this verification measurement it is okay. For more accurate results it must be compensated. Power level of the test signal is set directly in the generator. No additional attenuator is needed in the signal path. Packet error rate value is calculated in the 80-slave firmware which is loaded in the tested board. Precise receiver sensitivity measurement may be quite time-consuming. In this video we will simplify and speed up the procedure by using one dB power step and 20 test packets to calculate the packet error rate. We will use a 1% packet error rate as the threshold. Precise frequency alignment of the receiver and the transmitter is also not needed in our simplified case. There are several main steps of the measurement. At first vector signal generator continuously transmit Lura packets. Setting of frequency and Lura modulation parameters are the same as in the measured device. The output power is set above the expected sensitivity level. The STN32WL device receives packets and calculates the packet error rate. If the packet error rate is below 1%, the output power from the generator is decreased by 1 dB. The packet error rate is calculated again. The nearest power at which the packet error rate exceeds 1% can be considered as the receiver sensitivity level. Here is a table of sensitivities from the datasheet. For example, for Lura modulation with bandwidth 125 kHz and spreading factor 12 is the sensitivity minus 138 dBm. This is a default setting of 80 Slave and we can verify this sensitivity in the following measurement. For our test we use Lura modulation with the following settings. 80 configuration command looks like this. The parameters which are important for setting of Lura receiver are frequency, modulation bandwidth, spreading factor, coding rate, LNA boost, selection of Lura modulation and payload. The rest parameters are used only for transmitter or FSK modulation. Reception of Lura packets is enabled by TRX command where the parameter is number of expected packets. In this case we use 20 packets. In this part the test signal from the generator is being verified. It is not needed for sensitivity measurement itself. It is only for purpose of this example to show how the test signal looks like. At first the unmodulated carrier is switched on. Then the modulated signal is switched on. In the waterfall diagram we can see Lura modulation and the packets. Now I'm decreasing power from the generator and switching off the modulation and the carrier. The tested board is connected directly to the vector signal generator through the RF cable. The board is placed in the shielding box. Here is a brief setting of the generator we use in the example. The frequency is 868 MHz. We set output power level in range from minus 137 to minus 139 dBm which would be around the value we want to verify. This displayed value is quite exact. We will use it in the calculation as the real transmitted power. The Lura test signal is generated in the internal arbitrary waveform generator. This baseband signal is then modulated to the carrier and transmitted to the tested device. I start test from minus 137 dBm. I configure the tested board by sending the configuration 80 command and then I start receiving an evaluating packet error rate. Total packet error rate is zero. I've decreased the power level by 1 dB and I'm doing the same test. Total packet error rate is zero again. I've decreased the power level to minus 139 dBm and I'm doing the packet error rate test again. Now it is around 9%. In the example transmitter power was being changed. As mentioned earlier the insertion loss of the cable which is around 0.3 dB was neglected in this simplified case. Then I can assume that the received power is the same as the transmitted power. We measured zero packet error rate up to minus 138 dBm. At minus 139 dBm it was about 9%. It means that the 1% threshold under exact sensitivity level is somewhere between minus 138 and minus 139 dBm. We can say that the measured value in the example is the same as in the datasheet. Useful information can be found also in the following application notes. Thank you for your attention!