Skip to content

Commit a82ee22

Browse files
authored
Merge pull request #15183 from jeromecoutant/STM32WL_UPDATE
STM32WL : add robustness
2 parents f609a52 + e49036d commit a82ee22

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

connectivity/drivers/lora/TARGET_STM32WL/STM32WL_LoRaRadio.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ void STM32WL_LoRaRadio::init_radio(radio_events_t *events)
605605
_tx_timeout = 0;
606606
_rx_timeout = 0;
607607

608+
hsubghz.Init.BaudratePrescaler = 0;
609+
hsubghz.ErrorCode = 0;
610+
hsubghz.State = HAL_SUBGHZ_STATE_RESET;
611+
608612
//call to HAL_SUBGHZ_Init() for MSPInit and NVIC Radio_IRQ setting
609613
error_value = HAL_SUBGHZ_Init(&hsubghz);
610614

@@ -766,16 +770,20 @@ void STM32WL_LoRaRadio::write_opmode_command(uint8_t cmd, uint8_t *buffer, uint1
766770
{
767771
HAL_StatusTypeDef error_value;
768772

773+
core_util_critical_section_enter();
769774
error_value = HAL_SUBGHZ_ExecSetCmd(&hsubghz, (SUBGHZ_RadioSetCmd_t)cmd, buffer, size);
770775
MBED_ASSERT(error_value == HAL_OK);
776+
core_util_critical_section_exit();
771777
}
772778

773779
void STM32WL_LoRaRadio::read_opmode_command(uint8_t cmd, uint8_t *buffer, uint16_t size)
774780
{
775781
HAL_StatusTypeDef error_value;
776782

783+
core_util_critical_section_enter();
777784
error_value = HAL_SUBGHZ_ExecGetCmd(&hsubghz, (SUBGHZ_RadioGetCmd_t)cmd, buffer, size);
778785
MBED_ASSERT(error_value == HAL_OK);
786+
core_util_critical_section_exit();
779787
}
780788

781789
void STM32WL_LoRaRadio::write_to_register(uint16_t addr, uint8_t data)

targets/TARGET_STM/TARGET_STM32WL/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,22 @@ Only M4 core is currently used by mbed-os applications.
3131
- Total FLASH is 256KB
3232
- RAM: 64 KB
3333

34+
**[tip] mbed-os export feature**
3435

35-
## CUSTOM boards
36+
`mbed export -m NUCLEO_WL55JC -i uvision6`
37+
38+
This needs to locally add a patch:
39+
https://github.com/ARMmbed/mbed-os/pull/10424/files
40+
41+
`mbed export -m NUCLEO_WL55JC -i iar`
3642

37-
Check https://github.com/ARMmbed/stm32customtargets
43+
This needs to locally add a patch:
44+
https://github.com/jeromecoutant/mbed/blob/IAR_EXPORT_SUPPORT/tools/export/iar/iar_definitions.json#L62-L64
45+
46+
47+
## CUSTOM boards
3848

49+
Check https://github.com/ARMmbed/stm32customtargets#stm32wl
3950

4051
# LoRa
4152

0 commit comments

Comments
 (0)