Hi @Matt_Mielke
I have followed your tutorial and I just replaced the code in my main.c with your main_lora.c. However, I am getting the error of “usart.h: No such file or directory”. Would you be able to assist me?
Hi @Matt_Mielke
I have followed your tutorial and I just replaced the code in my main.c with your main_lora.c. However, I am getting the error of “usart.h: No such file or directory”. Would you be able to assist me?
Hi @colehadley,
Yeah, looks like ST broke the tutorial with the new STM32CubeIDE version. Thanks for pointing this out to me. I’ll get it fixed and update the post tomorrow.
Hi @colehadley,
The updates have been made. Please let me know if any problems persist.
Thanks,
Matt
Hi @Matt_Mielke,
Will this tutorial work with the B-WL5M-SUBG1 board? Looks like maybe grabbing a different set of BSP files but I am unsure.
I can’t think of a reason it wouldn’t work…
Of course, you’d have to adjust the instructions every time you see the word “nucleo”. I just went through the tutorial doing just that, and was able to get it to successfully build. A couple potential struggle points I came across:
xxx_bus.h/c
, xxx_eeprom.h/c
, xxx_env_sensors.h/c
, etc.Unfortunately, I don’t have the B-WL5M-SUBG1 boards in front of me for testing. Again, I think it will work, but I can’t make any guarantees without first testing on hardware. But if you’ve got the boards, go ahead and give it a try! If it doesn’t work, let me know and we’ll get it figured out.
Hi @Matt_Mielke, great read, thank you.
I am trying to implement on a custom board with a STM32WLE5xxxx and made changes for single core as suggested. Builds and runs however gets hung up in constant wait at line 245 (on your git) while (eventReceptor == NULL);. Any suggestions?
Hi @Connor,
What changes did you make exactly?
Changes made:
I may need to look into changes to the Debug SubGhz and RF Busy Init…lines 167-191. No changes have been made there yet.
Thank you
Those pins are just for debugging and can be disabled if you’re not using them. See this post for more details.
Have you made any changes to the files in the BSP folder?
If the code is hanging at while (eventReceptor == NULL);
, then either the RadioOnDioIrq()
ISR isn’t executing, or it is and the switch value isn’t covered (i.e., the default case is triggering). Can you determine which one it is?
Hi Matt,
If I put a break point in the start of RadioOnDioIrq, it never reaches it. It does run through radioInit though. Where is RadioOnDioIrq called from?
No changes to BSP folder.
Cheers
Hi @Connor,
That tells me that the subghz interrupts likely aren’t enabled and/or aren’t configured correctly.
RadioOnDioIrq()
is a callback function at the end of a long chain of function calls originating from the vector table in the startup_ stm32wlxxxxxx.s
file. Specifically, the SUBGHZ_Radio_IRQHandler
entry. It should execute every time a subghz interrupt occurs. We need to figure out why this isn’t happening.
Since you’re using a different MCU and a custom board, I think it would expedite things if I take a look at your project. Go ahead an clean your project by right-clicking on it in the Project Explorer and choosing Clean Project. Then, navigate to your workspace in your file explorer and compress it to a .zip file. You can either reply to this post and attach that .zip file there or you can message me directly if you’d rather it not be public.
Hi @Matt_Mielke,
I am working on a project using the WL55JC2 rather than the WL55JC1, since we use the 433MHz LoRa band where I live. Would this project work on this board, and if so, what modifications might I need to make?
Thank you for the great tutorial, very interesting.
Yeah, it should work. Just change the defines in the private macro section to suit your application.
Following your instructions above worked flawlessly with the B-WL5M-SUBG1 board. My next step that I would like to take would be trying to implement the example using freertos. Do you have an example or any input that could help guide me in the right direction?
That’s good to hear @ekgolf. Thanks for sharing! Hopefully others find this useful as well.
Regarding FreeRTOS, I haven’t used it with an ST product in several years, so there’s nothing I can expressly provide. What I would point you to is the example selector option in STM32CubeMX. There, you can filter examples by middleware (i.e., FreeRTOS) and MCU series (i.e., STM32WL). Looks like there’s 10 examples available now:
Note, however, that they all utilize the NUCLEO-WL55JC1 board. So these would be most useful to you as sources of reference code, rather than examples you can run directly on your board. Of course, you can always port them over to your board if you really want to.
I will also point out that ST has produced two MOOCs covering FreeRTOS, both available on YouTube:
https://www.youtube.com/watch?v=QGVAayFI5ZQ&list=PLnMKNibPkDnFeFV4eBfDQ9e5IrGL_dx1Q&pp=iAQB
https://www.youtube.com/watch?v=5rWyAlrkQec&list=PLnMKNibPkDnExrAsDpjjF1PsvtoAIBquX&pp=iAQB
Aside from covering the FreeRTOS basics, they should also cover how to integrate it into your project using CubeMX.
Hope this helps get you started!