cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8 SysTick initialisation issue

akosbalogh01
Associate II

Hi,

I am using STM32F103C8T6 Blue pill board, STM32 CubeIDE 1.16.0, Build: 21983_20240628_1741 (UTC) on Ubuntu 22.04.5 LTS and ST Link v2 debugger. I am able to upload code, execute it and debug it via SWD.

I am using CubeIDE's Pinout & configuration utility to configure peripherals and software modules. I want to add FreeRTOS to an empty project. Due to issue 189410 I have to revert Firmware package version to 1.8.5. If I select Firmware package version 1.8.5, I can enable FreeRTOS with CMSIS_V2 interface and generate and compile code successfully. For FreeRTOS to work, I enable USE_NEWLIB_REENTRANT in FreeRTOS advanced configuration tab, and also select a timer as Timebase source in SYS module. I tried selecting TIM1, 2, 3, 4 - all of them produce the same result. In RCC module I selected Crystal/Ceramic Resonator as HSE, in Clock Configuration I used default 8MHz as HCLK.

If I try to run the generated code, execution halts in __NVIC_EnableIRQ() when SysTick Timer interrupt gets enabled. I attached call stack below.

akosbalogh01_0-1726951418169.png

I run into the same issue even without FreeRTOS, if I select any timer as Timebase source in SYS module.

Am I missing something in my RTOS or peripheral configuration? Could it be a hardware issue? I don't have another F103 at hand to test it with another MCU, so I can't rule it out.

Best regards,

Akos

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

your right. 

Anyway - you get a strange call 0xfffffff9 ->

1. boot0 at gnd ?

2. both watchdogs disabled , not active ?

3. nrst and nmi hi ?

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
AScha.3
Chief III

HI,

i always use tim6 ....try.

If you feel a post has answered your question, please click "Accept as Solution".

Hi,

On F103C8T6 only Timers 1, 2, 3 and 4 are available.

Akos

Hi,

your right. 

Anyway - you get a strange call 0xfffffff9 ->

1. boot0 at gnd ?

2. both watchdogs disabled , not active ?

3. nrst and nmi hi ?

If you feel a post has answered your question, please click "Accept as Solution".

Hi,

Thanks for your reply! Boot0 was not at ground. I switched the jumpers around and now I can initialize SysTick and FreeRTOS as well. I verified that RTOS is working with a simple task that transmits an UART packet periodically.

What does Boot0 do?

Akos

One clock (or so) after reset end -> hi , the state of boot0 is checked : if hi -> bootloader is started, if lo -> program is started in flash (or ram, depends on boot1 state).

The jump to 0xFFFFFF...  is indication for : jump to bootloader or watchdog ...

 

See AN2606 about boot modes.

If you feel a post has answered your question, please click "Accept as Solution".