cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK-V3-MODS - Debug does not properly work with prototype

Tobe
Senior III

I have a very simple program, but with my board, the debugger does not work properly. It does work on a Nucleo board though. Attached i have the signals, that i could measure on swd clk and swd dio ( brown clock / yellow dio). The are not aligned, but they have the same scale.

Programming the target does work. Also now with 8000kHz and NRST connected, unlike in my other thread i had today.

 

See the error here: https://youtu.be/4i2mYk8yuQM

 

I found out, that the counter "DWT->CYCCNT" runs if you hit resume, but the programcode is not beeing resumed.

I have now removed the loops, so that there is only a bunch of

GPIOB->BSRR |= (uint32_t) GPIO_PIN_10;

and

GPIOB->BRR |= (uint32_t) GPIO_PIN_10;

Also i just letting it run without debugging.

It runs for about 771us, independend of how many instructions i put there, so there is a precise time issue. But the curves of the signal dont look as they should. See attached.

I just tried it with a fresh generated code from cube mx. Now it runs through without stopping, but the signal does still look bad.

I could find the code, that causes this problem, but there is a interrupt behind it:

__HAL_RCC_TIM16_CLK_ENABLE();
TIM16->PSC = 85 - 1; // true prescaler 85 is value (85-1)
TIM16->CR1 |= TIM_CR1_CEN | TIM_CR1_URS;
TIM16->ARR = MICROSECONDS_PER_TIMER0_OVERFLOW - 1;
TIM16->DIER |= TIM_DIER_UIE;

NVIC_EnableIRQ(TIM1_UP_TIM16_IRQn);

Commenting out the last line solves this issue. However, i have a IRQ routine for this defined and also a weak one. I dont know why this gives issues.

__weak void TIM1_UP_TIM16_IRQHandler(void){

}

1 ACCEPTED SOLUTION

Accepted Solutions
Tobe
Senior III

I found the solution. Its rather strange:

I had to set nSWBOOT0 to 0. nBOOT0 is 1. on BOOT0 there was a high.

View solution in original post

3 REPLIES 3
Tobe
Senior III

I found the solution. Its rather strange:

I had to set nSWBOOT0 to 0. nBOOT0 is 1. on BOOT0 there was a high.

What do you want to tell me? I already accepted a solution, and your like show my topic, that has also already an accepted solution?