Merge pull request #15183 from jeromecoutant/STM32WL_UPDATE

STM32WL : add robustness
pull/15192/head
Martin Kojtal 2021-12-07 09:11:56 +00:00 committed by GitHub
commit a82ee22e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -605,6 +605,10 @@ void STM32WL_LoRaRadio::init_radio(radio_events_t *events)
_tx_timeout = 0;
_rx_timeout = 0;
hsubghz.Init.BaudratePrescaler = 0;
hsubghz.ErrorCode = 0;
hsubghz.State = HAL_SUBGHZ_STATE_RESET;
//call to HAL_SUBGHZ_Init() for MSPInit and NVIC Radio_IRQ setting
error_value = HAL_SUBGHZ_Init(&hsubghz);
@ -766,16 +770,20 @@ void STM32WL_LoRaRadio::write_opmode_command(uint8_t cmd, uint8_t *buffer, uint1
{
HAL_StatusTypeDef error_value;
core_util_critical_section_enter();
error_value = HAL_SUBGHZ_ExecSetCmd(&hsubghz, (SUBGHZ_RadioSetCmd_t)cmd, buffer, size);
MBED_ASSERT(error_value == HAL_OK);
core_util_critical_section_exit();
}
void STM32WL_LoRaRadio::read_opmode_command(uint8_t cmd, uint8_t *buffer, uint16_t size)
{
HAL_StatusTypeDef error_value;
core_util_critical_section_enter();
error_value = HAL_SUBGHZ_ExecGetCmd(&hsubghz, (SUBGHZ_RadioGetCmd_t)cmd, buffer, size);
MBED_ASSERT(error_value == HAL_OK);
core_util_critical_section_exit();
}
void STM32WL_LoRaRadio::write_to_register(uint16_t addr, uint8_t data)

View File

@ -31,11 +31,22 @@ Only M4 core is currently used by mbed-os applications.
- Total FLASH is 256KB
- RAM: 64 KB
**[tip] mbed-os export feature**
`mbed export -m NUCLEO_WL55JC -i uvision6`
This needs to locally add a patch:
https://github.com/ARMmbed/mbed-os/pull/10424/files
`mbed export -m NUCLEO_WL55JC -i iar`
This needs to locally add a patch:
https://github.com/jeromecoutant/mbed/blob/IAR_EXPORT_SUPPORT/tools/export/iar/iar_definitions.json#L62-L64
## CUSTOM boards
Check https://github.com/ARMmbed/stm32customtargets
Check https://github.com/ARMmbed/stm32customtargets#stm32wl
# LoRa