cancel
Showing results for 
Search instead for 
Did you mean: 

How to use MX to avoid destroy of code

markpow
Associate III

I downloaded Seeed-Studio LoRaWan-E5-Node, and all works fine till I use the MX component to set up microcontroller configuration (for example, set up LoraWAN or I2C). When I use the MX component and decide to generate code after changes to LoraWAN or I2C components, I always get many build errors. How to avoid such a situation?

I work with STM32CubeIDE Version: 1.14.0. Stm32 Cube MX version 6.10.0.

1 ACCEPTED SOLUTION

Accepted Solutions
markpow
Associate III

I found a solution. Download the latest "https://github.com/STMicroelectronics/STM32CubeWL" and use the LoraWAN end node application. All work great now.

View solution in original post

5 REPLIES 5
TDK
Guru

Only put code within USER CODE BEGIN and USER CODE END sections.

 

If you feel a post has answered your question, please click "Accept as Solution".
markpow
Associate III

No, it destroys its code, not mine. I downloaded the code from Seeds Studio Git Hub.

I imported the project to the Stm32CubeIDE:

 

markpow_0-1702392553935.png

Next, I imported it into Stm32CudeIDE. I built it without any problems or any changes.
Next, I opened the MX component and made some changes to the microcontroller configuration. I double-clicked on the LoRaWAN_End_Node.ico, and made changes to the LORAWAN settings.

markpow_1-1702392637326.png

 

markpow_2-1702392665276.png

markpow_3-1702392707099.png

 

Upon closing the MX component, it asked me to generate code. I answered yes.

markpow_4-1702392749386.png

 

I tried to build the project, and I got several unexpected build errors.

markpow_5-1702392804802.png

I didn't do any manual changes to the code.

What is responsible for that situation?

@TDK 

 

markpow
Associate III

WTF?

After saving code from MX I see:

markpow_0-1702396447554.png

 

TDK
Guru

 

Not real sure, probably just isn't set up for that functionality right now.

If you feel a post has answered your question, please click "Accept as Solution".
markpow
Associate III

I found a solution. Download the latest "https://github.com/STMicroelectronics/STM32CubeWL" and use the LoraWAN end node application. All work great now.