cancel
Showing results for 
Search instead for 
Did you mean: 

URGENT: STM32WLE5 custom design questions

AVigh.1
Associate II

I have a fast track project for which I need to do a quick feasibility study, determine if STM32WL is suitable candidate, and if so, have enough support available to design it in. So all your timely, insightful help would be greatly appreciated. Here are my primary set of questions:

1) What's the lowest cost part / package that I can upgrade later to STM32WL55 using same footprint? I think it's STM32WLE5C8U6 but please confirm/ correct.

2) As I understand (looking at docs, presentation videos) WL series support OTA f/w programming. If that's correct - where's the new f/w image stored? Looking at NUCLEO-WL5JC schematic, I don't see SPI-Flash or any external memory chip. Is the OTA image downloaded to WL's internal memory?

3) Is there app note/ doc explains what I need if I were to use only the low power (15dBm power optimized) PA only? I mean which of the many RF switches (seen in NUCLEO-WL5JC) can be dropped for a simplified design?

Thanks in advance for your timely attention and help.

9 REPLIES 9
Hamilton DC
Associate III

Hi @AVigh.1​ ,

1) STM32WLE5 and STM32WL55 use the same footprint. Then, yes you can start with STM32WLE5C8U6, lowest QFN cost part and then replace it by STM32WL55Cxxx.

2) Yes WL series support FW Update OTA. Current implementation uses internal memory flash. 

3) There are these two ANs:

I attached a schematic of the QFN Reference Board to show you an example of an application with minimal BoM (single RF output).

Let me know if this answers your question.

Kind regards,

Hamilton

Complemented initial answer.

VSomu.1
Associate

Hi Hamilton,

We have designed the custom PCB based on "MB1720", tried the LORAWAN_end_node example on our custom board. but there is no signal out from RF antenna. do we need to modify anything related to MB1720? We have the NUCLIO-WL55JC devboard, the same is working fine with default code(updated Region parameters to India).

Can you please suggest me if i need to make any changes in code with respect to MB1720.

just for your info: custom board with MB1720 is working fine with other examples, also Lorawan_end_node running fine without any error's, but i could not see any data on packet forwarder in gateway.

Thanks in Advance.

Regards,

Venugopal.

Hi Venugopal,

I think one the following notes below should resolve your issue.

Note 1: the RF switch is controlled by PC13 (SB6 must be closed).

If you're using the example developed for Nucleos boards, you should change the GPIO that controls the RF SW (switch).

For more information search for:

  • USE_BSP_DRIVER
  • RF_SW_CTRL1_GPIO_PORT
  • RF_SW_CTRL2_GPIO_PORT
  • RF_SW_CTRL3_GPIO_PORT
  • RF_SW_CTRL1_PIN
  • RF_SW_CTRL2_PIN
  • RF_SW_CTRL3_PIN

Note 2: You just need one GPIO to control the RF SW compared to Nucleo Board.

In this case you can change the code to take it into account.

Probe the GPIO of the RF SW to make it's working.

Note 3: Another thing is the choice between XO and TCXO. Without HSE clock source the RF part of the device cannot work.

Search for:

IS_TCXO_SUPPORTED

XO: 0 (false)

TCXO: 1 (true)

Note 4: Make sure the RF PA (Radio Frequency Power Amplifier) is supplied by either SB7 or SB8. Connect SB7 when using RFO_HP and SB8 when using RFO_LP.

To debug the RF part:

I put attached the .HEX of the MB1720 that I'm using. With this firmware you can quickly see if the RF part is working or not.

To download the .HEX file into your MCU, you can use the STM32CubeProgrammer. At the left you have an option to do that ("Erasing & Programming")

The firmware is based on the "AT_Slave". The AT_Slave and other example are available in the STM32CubeWL MCU Package (https://www.st.com/en/embedded-software/stm32cubewl.html). FYI these examples were initially done to be used with Nucleo Boards.

To configure a transmission using the "AT_Slave" and RFO_HP, you can proceed as follows:

  • For the Compute/Board communication, use either:
    • A FTDI TTL-232R 3.3V cable to interface with PA2 (LPUART1_TX) / PA3(LPUART1_RX) / GND
    • Or an ST-Link as USB serial interface to interface with PA2 (LPUART1_TX) / PA3(LPUART1_RX) / GND.

Note: The AT_Slave is base on LPUART interface (PA2/PA3).

  • Configure the communication with the following parameters (I'm using Termite 3.4 as terminal):

Port: choose the USB COM Port of your interface device

Baud rate: 9600

Data bits: 8

Stop bits: 1

Parity: none

Flow control: none

Forward: none

Append LF: checked

Local echo: checked

  • Configure the Transmitter:
    • AT+TCONF="Freq":"Power":"Bandwidth":"Spreading Factor":"CR":"LNA State":"PA Boost State"
      • For example, to configure an RF carrier at 868 MHz with +22 dBm of power, send:

AT+TCONF=868:22:125:7:4/5:1:1

  • To emit an RF carrier with the previous configuration, send:

AT+TTONE

  • To stop the transmission, send:

AT+TOFF

  • Connect the Tx Board to a Spectrum Analyzer, if you see the RF carrier with the previous configuration, so it's working

If you do not have an spectrum analyzer you can use your Nucleo board (with a SMA cable) flashed with AT_Slave firmware in Rx mode and get the RSSI. Note the AT_Slave firmware to use with the Nucleo Board must have the correct set of GPIOs to control the RF SW. The raw version of the AT_Slave firmware is already done to work with Nucleo Boards, so flash the Nucleo with the example of AT_Slave that you can find in the STM32CubeWL MCU Package.

Be aware, the maximum input power at LNA pins must not exceed 0 dBm (see the datasheet for more information). You can use an RF attenuator of 20 dB or configure the Transmitter to send only 0 dBm instead of +22 dBm to avoid damaging the LNA.

To get the list of AT_Slave commands available, you can send by terminal the following command:

  • AT?

Let me know if this resolve your issue.

Good luck.

Kind regards,

Hamilton

Ppk.1
Associate II

Hi Team,

Currently, I'm working on STM32WLE5JC with the LoRaWAN end node example. In that, I need to store the value in the flash memory.

Separately I have done the example source program using cubemx platform which stores two values (uint32_t type).

But when I'm trying that same implementation in LoRaWAN end node example code, facing "Error in write operation"

Kindly support me on this!

Thanks in advance!

/* Flash Init */
uint32_t GetPage(uint32_t Addr)
{
  uint32_t page = 0;
 
  if (Addr < (FLASH_BASE + FLASH_BANK_SIZE))
  {
    /* Bank 1 */
    page = (Addr - FLASH_BASE) / FLASH_PAGE_SIZE;
  }
  else
  {
    /* Bank 2 */
    page = (Addr - (FLASH_BASE + FLASH_BANK_SIZE)) / FLASH_PAGE_SIZE;
  }
 
  return page;
}
 
void FLASH_init(void)
{
    /* Initialise test status */
    MemoryProgramStatus = PASSED;
 
    /* Unlock the Flash to enable the flash control register access *************/
	HAL_FLASH_Unlock();
 
	/* Clear OPTVERR bit set on virgin samples */
	__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);
 
	/* Get the number of the start and end pages */
	StartPage = GetPage(FLASH_USER_START_ADDR);
	EndPage   = GetPage(FLASH_USER_END_ADDR);
}
 
/* Erase operation */
void  FLASH_erase(uint32_t page_address)
{
	/* The desired pages are not write protected */
	/* Fill EraseInit structure************************************************/
	EraseInitStruct.TypeErase   = FLASH_TYPEERASE_PAGES;     // Mass erase or Page erase
	EraseInitStruct.Page        = page_address;
	EraseInitStruct.NbPages     = EndPage - StartPage + 1;   // Number of pages to be erased
 
	if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK)
	{
	   /*
		  Error occurred while page erase.
		  User can add here some code to deal with this error.
		  PageError will contain the faulty page and then to know the code error on this page,
		  user can call function 'HAL_FLASH_GetError()'
	  */
	    while (1)
	    {
		  printf("Error in erase operation\n");
		}
	}
}
 
/* Write Operation */
void  FLASH_program(uint32_t add, uint64_t *data, uint8_t count)
{
	/* FLASH Word program of DATA_32 at addresses defined by FLASH_USER_START_ADDR and FLASH_USER_END_ADDR */
	uint32_t Address=0;
	int i=0;
	Address = add;
 
	while (i < count)
	{
	  if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Address, data[i]) == HAL_OK)
	  {
		 Address = Address + 8;
		 i++;
	  }
	  else
	  {
		/* Error occurred while writing data in Flash memory.
		User can add here some code to deal with this error */
		while (1)
		{
		  printf("Error in write operation\n");
		}
	   }
	 }
}
 
/* Read operation */
uint64_t FLASH_read(uint32_t Address)
{
	/* Check the correctness of written data */
	data64 = *(__IO uint32_t *)Address;
 
	return data64;
}
 
 
####### Storing values #######
/* WRITE OPERATION */
void Store_Config(void)
{
	s_config[config_count++] = data;  // uint32_t data
 
	s_config[config_count++] = data1;   // uint32_t data1
 
	FLASH_erase(StartPage);
	FLASH_program(FLASH_USER_START_ADDR,s_config,config_count);           //store config
 
	config_count=0;
}
 
/* READ OPERATION */
void Read_Config(void)
{
	uint32_t star_address=0;
	uint64_t r_config[10];
 
	star_address=FLASH_USER_START_ADDR;
	for(int i=0;i<10;i++)
	{
		r_config[i]=FLASH_read(star_address);
		star_address+=8;
	}
 
	data = r_config[0];
	data1 = r_config[1];
 
	printf("Read Data1: %lu\n", data);
	printf("Read Data2: %lu\n", data1);
}
 
 
####### Address details #######
#define FLASH_USER_START_ADDR       ADDR_FLASH_PAGE_24   /* Start @ of user Flash area */
#define FLASH_USER_END_ADDR         ADDR_FLASH_PAGE_25   /* End @ of user Flash area */

Open a NEW thread/question for unrelated topics

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Sure! Thanks!

Zelimir96
Associate

Dear,

I am currently in the process of designing a custom PCB with your STM32WLE5CCU6 chip (QFN Package). Consequently, I have a few questions:

  1. Given that the PCB will be exclusively sold in Europe and that I need to optimize power consumption, should my design align with the schematic provided in the attachment (MB1720-HighBand_LowPower-A01_Schematic_Internal)? I assume that due to the geographic location, I should use the HighBand version. Please confirm this for me.
  2. Can we purchase your PCB with this chip (MB1720)?
  3. Can I power all peripherals with LiSOCl2 batteries recommended for LoRa applications? The rated voltage of these batteries is 3.6 V.

Thank you in advance!

Sincerely,
Zelimir Trisic

Hi!
Thank you so much for your detailed response. Please check my post. It is similar to this one. 
https://community.st.com/t5/stm32-mcus-wireless/stm32wl-problems-with-sending-data/td-p/598171
Best,
Roberto.