cancel
Showing results for 
Search instead for 
Did you mean: 

System Timebase Source problem with STM32WLE5C8Ux

MAebl
Associate

I have a custom hardware with an STM32WLE5C8Ux and I want to add functionality to it step by step. I'm using CubeMx to generate a project with success ,toggeling a GPIO works.

I have not initalized external TCXO or LSE, they are populated but I want to first run a very simple program without LoRa or anything. I want to add FreeRTOS in the long run so I wanted to add an alternate Sys timer, I selected TIM17 as a Timebase Source.

Then I generate the project and debug over the ST-Link V3 an, adapter and a J-Link 10 Pin debug probe. I power the hardware externally. I'm running the internal clock at 48Mhz.

When I step through the debugger I stop at Function "HAL_NVIC_EnableIRQ(TIM17_IRQn);" inside of "stm32wlxx_hal_tim.c" Here is the output of my debugging

Temporary breakpoint 4, main () at ../Core/Src/main.c:72
72	  HAL_Init();
 
Breakpoint 3, HAL_Init () at ../Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal.c:178
178	  if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
 
Program stopped.
0x1fff2c08 in ?? ()

What I also noticed was that when I use SysTicks as time base I am also not triggering any interrupts but at least I am not hanging in debugging.

I'm lost how to debug this issue. Any help appreciated.

Any help is much appreciated

Edit: Note, if I do this on the demo board this is not an issue.

3 REPLIES 3
Filip SCHWANK
ST Employee

Hi,

in your code you are putting pins PA14,15 to Analog, which will cause the debugger to disconnect (for that in CubeMX go to Debug -> Debug and Trace -> JTAG and Trace and select the debug interface you use). Also in the main loop you are repeatedly hammering the GPIO with SET/RESET that will result in no blinking at all, you should put HAL_Delay(1000) in between - that will actually use the TIM17 timebase for SysTick, on which the Delay function counts the time. Lastly I would note that there is a dedicated function HAL_GPIO_TogglePin.

Best regards,

Filip & TOMAS Team

SStam.1
Associate

Hello Filip & TOMAS Team

Thank you for your reply. I'm monitoring the GPIO over a logic analyser so I can see the toggling without a problem.

The disconnect of the debug probe does not seem like a probable root cause. I must have sent you a version where I attempted initalizing everything as ANALOG ticking the box "set analog pin" on all GPIO in CubeMxIDE. Why is debugger disconnect not the issue? Because:

  • Toggling does not happen when TIM17 is activated
  • Toggling happens when TIM17 is not activated
  • I can get EVAL Nucelo board with STM32WL55 to run

What does the following error mean exactly? When does it occur? Its not an error that shows when the debug probe is disconnected, I think then a popup window warning comes in the IDE, no?

Program stopped.
 
0x1fff2c08 in ?? ()
 
 

Filip SCHWANK
ST Employee

Hi,

it seems that you are entering the bootloader - system memory area is usually around the 0x1FFF... address. Your code should be executed from 0x800 0000 where the Flash starts. Please check that you are not activating the BL with AN2606. Since I have the schematic in the OLS, I see that TP145 - connected to BOOT0 is left floating, if the R117 is left not mounted. The default configuration of WL is that the BL activation is taken from the BOOT0 pin, unless you changed it in the Option bytes.

Best regards,

Filip & TOMAS Team