cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE generates broken dual core STM32WL55 LoRaWAN Project

werwolv98
Associate II

Hi

For the past few days I've been trying to get a dual core project with FreeRTOS and the LoRaWAN Stack for a custom STM32WL55 design to work but the CubeIDE seems to not properly generate everything that's required for it to work.

  1. When blindly generating a project, everything compiles well but the program halts in the MBMUXIF_SystemInit function because the IPCC Data Buffer hasn't been placed at the right location. This buffer apparently should be placed inside of the MAPPING_TABLE section which is not created anywhere in the linker script so it just gets placed in the data section. There's also other linker sections being referenced in the code that simply just not exist. The Linker script seems to be a generic one not at all designed to work with the LoRaWAN library. I also couldn't find any documentation anywhere about how to do it manually.
  2. When creating that linker section and setting the IPCCDBA value accordingly with the STM32CubeProgrammer, it successfully gets past that check but then hangs when waiting for the M0+ core to start up. Debugging why the M0+ core isn't starting up properly shows that it does start but never reports back to the M4 core that it started because the call to MX_LoRaWAN_Init isn't being generated.
  3. Adding MX_LoRaWAN_Init manually causes a HardFault in StoreValueInFeatureListTable to occur because apparently the object p_MBMUX_Cm0plusFeatureList points to hasn't been initialized properly and contains garbage addresses.

Is there anything I'm doing wrong or are you just not supposed to use the STM32WL55 outside of the Nucleo board and it's very specific examples?

1 ACCEPTED SOLUTION

Accepted Solutions
werwolv98
Associate II

Okay I finally figured out what was wrong.

Not only did the CubeIDE not generate proper hardware init code and generic linker scripts, it also generated completely generic startup files.

So the workaround to get it all working is:

  • Add a call to MX_LoRaWAN_Init in the main function of the Cortex M0+
  • Use the IDE to generate a new LoRaWAN_End_Node_DualCoreFreeRTOS project
  • Copy over the linker scripts for both cores
  • Copy over the startup files for both cores
  • Make sure to use the SysTick as clock source on the Cortex M4 (CubeMX will complain but using TIM1 or TIM2 will trigger a HardFault inside of FreeRTOS as soon as the interrupts are being enabled)

I really hope this will be fixed soon. I expect that at least the very basic template code generated by the CubeIDE will start without so much hassle. If that's not possible, then these steps should at least be documented somewhere. The whole MbMux and LoRaWAN stack are more or less an undocumented black box so finding out why something failed is really not easy.

View solution in original post

3 REPLIES 3
werwolv98
Associate II

Okay I finally figured out what was wrong.

Not only did the CubeIDE not generate proper hardware init code and generic linker scripts, it also generated completely generic startup files.

So the workaround to get it all working is:

  • Add a call to MX_LoRaWAN_Init in the main function of the Cortex M0+
  • Use the IDE to generate a new LoRaWAN_End_Node_DualCoreFreeRTOS project
  • Copy over the linker scripts for both cores
  • Copy over the startup files for both cores
  • Make sure to use the SysTick as clock source on the Cortex M4 (CubeMX will complain but using TIM1 or TIM2 will trigger a HardFault inside of FreeRTOS as soon as the interrupts are being enabled)

I really hope this will be fixed soon. I expect that at least the very basic template code generated by the CubeIDE will start without so much hassle. If that's not possible, then these steps should at least be documented somewhere. The whole MbMux and LoRaWAN stack are more or less an undocumented black box so finding out why something failed is really not easy.

Souan.1
Associate II

hello werewolf can you please share a tutorial on how this is done, i'm stucked on the dual core lorawan as well, im not even able to build , the middleware Lorawan is not available even thought IPPC is enable :dizzy_face:

0693W00000LyyzhQAB.png

Hey

You need to make sure that the SubGHZ and IPCC module are both enabled. Otherwise LoRaWAN is unavailable.