Why systick timer interruption is occurring correctly on a nucleoboard debug session but it is never ocurring when the same fw is on a same mcu based custom board?
I am stucked 4 days at HAL_systickInit part of a code that was generated by Cube MX. I'm using:
- CubeIDE 1.6.1
- HAL drivers firmware layer
- FreeRTOS Middleware
- Nucleo-F207zg
- Custom pcb (very simple circuit board --> write and read GPIO from 32pin connector and 8 x Gpio inputs from a mechanical switch ( x8 vias). MCU=F207zg.
- ST-Link debug probe (Nucleo)
- SEGGER debug probe (for custom board debug sessions with SWD interface)
I have done a firm version using cubeMx for clock and system base timer configurations. I used the generated code for initialitation, etc... I added some writes and reads pins threads and my app works fine on the Nucleo board. I get a previous demo-example in order to start from a working and reliable firmware.
My test app is very simple, one task toggle 5 digital ouptuts (3 of them are the 3 leds on nucleo board) and the other one gets 5 pull up digiltal inputs. It was ok.
After this, I added a very little modifications to this code -such as some pin mapping- in order of getting a custom pcb compliant app.
When I started the execution, I was able to see that HAL_Init calls HAL_InitTick that:
- /*Configure the TIM6 IRQ priority */
- /* Enable the TIM6 global Interrupt */
- /* Enable TIM6 clock */
- /* Get clock configuration */
- /* Get APB1 prescaler */
- /* Initialize TIM6 */
- calls HAL_TIM_Base_Init and this returns HAL_OK
- calls HAL_TIM_Base_Start_IT which is starting the timer and set the flag that enables interruptions --> after pass the __HAL_TIM_ENABLE_IT(timer, 1) statement DIER = 1
- Finally /* Enable the Peripheral*/ and returns HAL_OK
It seems interrupt enable is set and then, every milisecond thread should jump to its ISR --> HAL_TIM_IRQHandler() that calls its callback --> HAL_IncTick.
But unfortunately thread has never jumped there. I put breakpoints and anytihing happens. After going out from HAL_Init function application thread is also unable of configure the clock system. I think that the main point to solve is the tick count, that is not dependent from clock config since HAL_init is the first action to to before anything else.
My very nonunderstanding issue from this problem is how the same first instructions (only HAL dependent) can work propperly on the nucleo board mcu, but not on the same microcontroler out of Nucleo board.
- Is it due the SEGGER + FreeRTOS influence?
- If not, any suggestions on the steps path for achieving the answer why is not working this timer interruptions?
- Damage on mcu peripherals? how Can I discard microcontroler damage issues?
Run IDE option show me that downloading is verified and no error ocurres during exe download.
I will add pictures and code if someone needs it, after this post loading, to bring me some light. Now I'm not sure what part of code could be useful to show. The most are HAL library and Cube MX generated code.
I hope readers can understand this explanation. Sorry about my English grammar.
