cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE LoRaWAN generation of radio_conf.h

Andrew Larkin
Associate III

There some limitations/issues with the generation of the LoRaWAN/Target/radio_conf.h

The template radio_conf_h.ftl is hard coding key values in a way that does not preserve user set values.

The following lines are of concern:

#define XTAL_DEFAULT_CAP_VALUE      ( 0x20UL )
#define TCXO_CTRL_VOLTAGE           TCXO_CTRL_1_7V
#define DCDC_ENABLE                 ( 1UL )

It would be useful if these values could be set via the IOC file or, alternatively, be protected from modification in the case of code regeneration.

Noting that the DCDDC_ENABLE value may be redundant as there is an IS_DCDC_SUPPORTED symbol in the radio_board_if.h file.

 
 
2 REPLIES 2
Issamos
Lead II

Hello @Andrew Larkin 

I share the same opinion about this topic. it will be better to integrate those lines in CubeMX and make them protected.

For now, cube Mx just give as this interface:

Screenshot_2023-09-04-08-48-28-17_f9ee0578fe1cc94de7482bd41accb329.jpg

 hope the next version will give as some more control.

Best regards.

II

Andrew Larkin
Associate III

A work-around to the problem is to add this code to radio_conf.h under the /* USER CODE BEGIN EC */ comment

Only mildly hacky...

/* USER CODE BEGIN EC */
/* Values above for XTAL_DEFAULT_CAP_VALUE and TCXO_CTRL_VOLTAGE are
 * not protected from being overwritten by code regeneration, so we
 * replace them here where it is safe
 */
#undef XTAL_DEFAULT_CAP_VALUE
#define XTAL_DEFAULT_CAP_VALUE ( 0x10UL )
#undef TCXO_CTRL_VOLTAGE
#define TCXO_CTRL_VOLTAGE TCXO_CTRL_3_0V
/* USER CODE END EC */