2018-08-24 01:17 AM
2018-08-31 07:40 AM
so
__HAL_RCC_USART4_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
I fixed it like this.
(This way there is no error.)
2018-09-01 07:09 AM
this is right?
2018-09-01 07:09 AM
this is right?
2018-09-01 07:38 AM
That looks reasonable to enable the GPIO and USART peripheral involved, not sure why this needs additional validation. You should be able to check the peripheral registers via the debugger view. Or do additional checks on the functionality by sending a stream of characters, like 'U', and looking at that on a scope or terminal.
2018-09-01 09:38 AM
'.\sx1272mb2das\NUCLEO_CUBE_LORA.axf: Error: L6218E: Undefined symbol __HAL_RCC_UART4_CLK_ENABLE '
Why does this error occur?
(_USART4_CLK_ENABLE(); this part)
2018-09-01 12:26 PM
Make sure you are building the code for the right target architecture
P-NUCLEO-LRWAN1 STM32L073RZ using SX1272MB2xAS
Confirm the C command line is passed the define STM32L073xx
Grep or find-in-files for
__HAL_RCC_USART4_CLK_ENABLE
Should see
#define __HAL_RCC_USART4_CLK_ENABLE() SET_BIT(RCC->APB1ENR, (RCC_APB1ENR_USART4EN))
2018-09-03 01:51 AM
5 to 6 lines of code you gave me
__USART4_CLK_ENABLE();
__GPIOC_CLK_ENABLE();
Is this right? This results in an error.
__HAL_RCC_USART4_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
This won't cause an error.Is this right?
2018-09-03 09:28 AM
We're going in circles.
Go with the code that compiles and works. USART4 is your target, not mine, I provided a template I believe is a good starting point, adjust to fit. A complete working and tested example demonstrating end-to-end functionality would take significant time/effort, something that would need to be adequately funded.
stm32_hal_legacy.h seems to convert USART4 references to UART4, the macro expansions look to be an issue. I'm using earlier version of the LRWAN library, and where appropriate pulling into newer/different HAL libraries.
__HAL_RCC_USART4_CLK_ENABLE(); // exists
__HAL_RCC_UART4_CLK_ENABLE(); // does not
>>Is this right?
Look, the compiler/linker can tell you if it can get closure. You'll need to be agile/adaptive when adding functionality to the examples, the stuff provided by ST is rough around the edges, you're apt to run into issues either in the compile/link stages, or the robustness of the examples.