Skip to content

Problems with HAL_getTick() after first call to _sbrk_r #13

@sebrig

Description

@sebrig

I am currently using FreeRTOS with CMSIS-RTOS v2 interface directly in STM32CubeIDE 1.12.1 with my nucleo-F103RB. I am new to the thing and after getting systematic hardfault I found your article . After following all the steps it solve my problems ! I also added #define configISR_STACK_SIZE_WORDS (0x500) at the begining since it wasn't previously declared, as suggested in a previous issue.

Although adding the heap_useNewLib_ST.c file solved my problems I noticed that, before I start the os kernel, the HAL_getTick() and HAL_delay() functions were no longer working. After some investigation, it seems that after the first call to _sbrk_r, the TIM1 interrupt that I use as a Timebase source is no longer triggered.
example of code that provoque the failure :
`HAL_Init(); // first line in main()

HAL_delay( 1000 ); // working
printf( "test" ); // will call _sbrk_r
HAL_delay( 1000); // stay stuck`

My guess would be that the NVIC is overwritten in _sbrk_r, but I'm not quite sure... Could it be possible that my problem come from my #define configISR_STACK_SIZE_WORDS (0x500) ?

If further information is required, I will be happy to provide it to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions