cancel
Showing results for 
Search instead for 
Did you mean: 

Why I'm unable to debug or to run the firmware with SEGGER J-link probe on my custom board?

genisuvi
Associate III

This is a question related to an old post I wrote:

https://community.st.com/s/feed/0D53W000024ZvOoSAK

In which I said that I will make some hardware modications in order to achieve the technical suggestions and manufacturer instructions. First it was thought that two missing capacitors were causing miss function on internal regulator. So I added them in a new printed circuit prototype.

I have made these changes, but problems still being the same:

  • Interruptions never happens after HAL_Init()
  • So, thread get stucked at the same point: clock is never get configured, it tourns an error.
  • I'm using HSI clock, so external clock couldn't be guilty.
  • As a reminder I have to say that the same firmware works fine on NUCLEO board.
  • I don't know if the problem is on SEGGER debugger configuration.

0693W00000aHPpvQAG.jpgI really need to be able to run some kind of firmware. I'm spending a lot of time with this trouble.

Why is the interruption unable to be triggered when:

  1. TIM6 interruption is enabled and
  2. I can see how this is done when I'm debugging on its HAL struct field vaules?

Please if some one could help me with the next steps to find what is the cause I will add the information that could help him to understand my application and its configuration.

-I'm using FREERTOS,

-I changed HAL_TICK base timer by TIM6

-I'm using TCP/IP middleware

-BOOT0 = GND

-VCAP1 = VCAP2 = 1.189V

These 3 things are working fine on NUCLEO board, but there I'm using ST-Link with serial wire from PC. I'm using stmcubeIDE debugging interface. I don't really know if there is a great difference with my custom board in order to make interruptions not be happening. The final circuit desing is very simple:

  • Analog circuit --> regulator 12V --> 3.3V
  • Core: STM32F207ZG
  • Comms interface: RJ-ETHERNET PHY (the same microchip LAN device than Nucleo board)
  • GPIOS: 16 inputs + 8 address inputs + 16 outputs
  • Porgram port intrface: SWD (5pins)

Edition:

Adding new observations:

When I try to program or debug with segger from stm32CubeIde debug/run interface, mcu seems to be frozen or even hanging up. But after this moment, if I power off and I turn on my PCB, I can see how some outputs are just blinking as my firmware did on Nucleo board.

It is a very weird situation because of two factors:

  1. why does mcu be reset after being programmed in order to be awoken and start to run?
  2. Firmware is downolad but works partially. We have 16 GPIOs as output but only 6 of them are blinking as desired. I'm unable to see how are configured the other ones. They seems to be 'Z'.

I can't trust enough the segger device + CubeIde combination.

1 ACCEPTED SOLUTION

Accepted Solutions
genisuvi
Associate III

Hi,

I changed one debug configuration parameter at manager debug tag.

I checked the Reset Strategy tab and I saw that it was the none option. Hence I put Type: Normal and I tried to debug once again. This doesn't work on the previous PCB version.

After doing this with the new PCB version, I'm able to debug using Segger probe. Now, interruptions and clock are working.

I think it was the Reset Strategy. Althought its seems the application to be executed partially, to debug is now possible.

View solution in original post

3 REPLIES 3

Should be able to run without any debugger attached.

Instrument Hard Fault and Error Handler so you know if things when to die there.

Make sure the IRQ Handler for TIM6 is present.

Unpack NVIC, RCC and TIM6 peripheral register in debugger, or dump to terminal.

Does SysTick or other interrupts work?

Do things work independently, ie you don't call HAL_Init(), but simply bring up the peripheral(s)

Should just continue running at HSI 16 MHz

Does PLL start? What setting for that an VCO?

What specifically hangs up in HAL_Init() ?

What is the VOS setting?

ST-LINK/V2 and V3 are available.

The ST-LINK from a NUCLEO can be use to connect to external boards.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks Tesla, I can answer some of your proposed list actions now:

  • IRQ handler is present (image1) but thread doesn't jump anytime there
  • thread execution stucks on RCC configuration (image2) --> it returns error code
  • PLL configuration (image2)
  • HAL_init doesn't hangs up. Function returns an OK error code, but after HAL_init enables TIM_6 interruption, interruption never happens. It happens if the code (with minimal GPIO remapping) runs on the NUCLEO board.
  • Systick_Handler interruption neither other ones don't work.

0693W00000aHQ7uQAG.jpg0693W00000aHPq5QAG.jpgIs any of this comments suggesting something to you?

PD: I will try to follow your guide steps and I will post here the observations.

I will comment results soon.

genisuvi
Associate III

Hi,

I changed one debug configuration parameter at manager debug tag.

I checked the Reset Strategy tab and I saw that it was the none option. Hence I put Type: Normal and I tried to debug once again. This doesn't work on the previous PCB version.

After doing this with the new PCB version, I'm able to debug using Segger probe. Now, interruptions and clock are working.

I think it was the Reset Strategy. Althought its seems the application to be executed partially, to debug is now possible.