-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow LoRaWAN STM32WL driver debug led to be inverted #14910
Conversation
@hallard, thank you for your changes. |
If someone could explain what is preventing the build I can fix it, but the error message is hard to understand from my side. |
@hallard
|
@LMESTM that did it, trailing space at the end of the line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why LED would be inverted?
#undef DEBUG_LED_ON | ||
#undef DEBUG_LED_OFF | ||
#define DEBUG_LED_ON 0 | ||
#define DEBUG_LED_OFF 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this? without any undef.
Just assign values based on if its inverted or not.
#if defined(MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT) && (MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT == 1)
// inverted enabled
#define DEBUG_LED_ON 0
#define DEBUG_LED_OFF 1
#else
#define DEBUG_LED_ON 1
#define DEBUG_LED_OFF 0
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure makes sense Will do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, no need to update this file....
Just use MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT in STM32WL_LoRaRadio.cpp ?
@@ -47,6 +47,10 @@ | |||
}, | |||
"debug_tx": { | |||
"help": "GPIO pin for TX debug" | |||
}, | |||
"debug_invert": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug_led_invert
might be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely the deal is that I wanted to be consistent with already related existing options. It took me some time to understand that ˋdebug_tx` was for led and not a serial. So if I change it it would makes sense to change 2 other (and introduce breaking change). Whatever solution is fine for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug_led_invert
might be better
Hi
Not sure, as primary goal of the debug GPIO is to easily use logic analyser for example.
Usage of LEDs is only an "extension"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug_led_invert
might be betterHi
Not sure, as primary goal of the debug GPIO is to easily use logic analyser for example.
Usage of LEDs is only an "extension"
makes sense
Because of hardware side sometimes they are connected in the reversed way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposition is:
- in connectivity/drivers/lora/TARGET_STM32WL/mbed_lib.json, to name the new config "default_debug_value" and set 0 as default
- in connectivity/drivers/lora/TARGET_STM32WL/STM32WL_LoRaRadio.cpp, use MBED_CONF_STM32WL_LORA_DRIVER_DEFAULT_DEBUG_VALUE when it was 0 ?
ok
so you mean in this file driving the GPIO that was something like that before _rf_dbg_rx = 0; // Off
_rf_dbg_rx = 1; // On becomes _rf_dbg_rx = MBED_CONF_STM32WL_LORA_DRIVER_DEFAULT_DEBUG_VALUE
_rf_dbg_rx = !MBED_CONF_STM32WL_LORA_DRIVER_DEFAULT_DEBUG_VALUE or something else, not sure to see what you mean. |
Yes, that was my idea. Is it working ? |
I need to test it why not _rf_dbg_rx = 0; // Off
_rf_dbg_rx = 1; // On becomes // Off
_rf_dbg_rx = MBED_CONF_STM32WL_LORA_DRIVER_DEFAULT_LED_OFF
// On (really Not Off)
_rf_dbg_rx = !MBED_CONF_STM32WL_LORA_DRIVER_DEFAULT_LED_OFF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested changes done, tested, works as expected with LoRa E5 Breakout
@@ -388,4 +388,4 @@ class STM32WL_LoRaRadio : public LoRaRadio { | |||
|
|||
|
|||
|
|||
#endif /* MBED_LORA_RADIO_DRV_STM32WL_LORARADIO_H_ */ | |||
#endif /* MBED_LORA_RADIO_DRV_STM32WL_LORARADIO_H_ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry bad cut/paste on my side, done
Ci started Squash would be good, I can squash this into one when merging |
Sure it's no problem for squash, even better :-) |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Allow LoRaWAN STM32WL debug led to be inverted
Impact of changes
Migration actions required
Documentation
new mbed application STM32WL driver parameter allowing debug led to be reverted (depending on hardware wiring mode)
Pull request type
Test results
Reviewers
@jeromecoutant @MarceloSalazar