MIMXRT685S SysTick problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MIMXRT685S SysTick problem

2,061 Views
Srukonja
Contributor III

I've encountered a pretty bizarre situation on an M33 Cortex. I'm using an MIMXRT685-EVK dev board.

I have a section of the code where an initialization of SysTick timer is called. An official code library is used for that. When I hit F7 (compile) and F8(load code) in Keil uVision 5, a code is downloaded into a memory and MCU is successfully booted (observing the VCOM and LED statuses). Anyhow, the SysTick timer is not running.

By pressing the hardware RESET button (power cycling also), everything works correctly as it should. Both debug statuses and SysTick.

What could be the issue with the SysTick hold after the reset over CMSIS-DAP on-board programmer?

Thanks!

0 Kudos
12 Replies

1,921 Views
Srukonja
Contributor III

Hi Victor,

latest update, I left only the SysTick config and Handler in the copy of the project I've sent you and nothing's changed. Then I've downloaded the original example to the MCU, the one with the SysTick and LED from the library and same thing occurs.

Chip erase - SUCCESS

Chip program - SUCCESS

Chip sw reset over probe - FREEZE (after few miliseconds)

- - - -

Chip manual (hw) reset - SUCCESS (boots and runs as it should)

 

So the work around is to manually reset the MCU, each time it is programmed. I can't think of what else to do. It is a bit tiring after 10 or more flashing's but what else.... If you manage to get the solution, please share it.

 

 

Mario

0 Kudos

1,896 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Srukonja,

This is due to the default configurations of the debug probe that Keil has. To correct this behavior go to the options of your project. Once you are there you need to select Debug and then settings of your debug probe. 

victorjimenez_0-1601570301388.png

In the settings of your debug probe go to the Flash Download option and then activate the option Reset and Run. Once you activate this, you won't need to manually reset the board. 

victorjimenez_1-1601570415622.png

 

Have a great day,

Victor

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct"button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-------------------------------------------------------------------------------

0 Kudos

1,862 Views
Srukonja
Contributor III

Thx, but that was already selected.

 

It seems as something has to do with the MCU itself. I'll keep working using the reset button and hope that it will resolve itself out, just as it appeared suddenly.

Thank you for giving a try at it,

best wishes!

 

Mario

0 Kudos

2,041 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Srukonja,

Could you please share the example code that you are using to test this? 

0 Kudos

2,029 Views
Srukonja
Contributor III

Hi Victor,

I can e-mail you a whole KEIL project that I'm working on. There is no need for the NDA contract but I would rather to make a private exchange. Later, a general solution can be published here if found. You can send me an e-mail address if this works for you, thank you!

 

Best regards,

Mario

0 Kudos

2,050 Views
Srukonja
Contributor III

Upon further debugging, I've made a discovery that SysTick runs for exactly 64 interrupt call (SysTick_Handler) times before it stops for no apparent reason.

0 Kudos

2,017 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Mario, 

Thanks for the updated information, if you don't want to share the complete project you can post in a reply only the code that you are using to configuring the Systick. To insert the code with the proper format please use the Insert/Edit code sample button. 

victorjimenez_0-1599782149138.png

 

Regards, 

Victor 

0 Kudos

2,008 Views
Srukonja
Contributor III

This code is copied from the SDK library:

..\NXPEVK-MIMXRT685\boards\evkmimxrt685\driver_examples\gpio\led_output

 

/* Set systick reload value to generate 1ms interrupt */
SysTick_Config(SystemCoreClock / 1000U);
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks){
  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk){
    return (1UL); /* Reload value impossible */
  }

  SysTick->LOAD  = (uint32_t)(ticks - 1UL); /* set reload register */
  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
  SysTick->VAL   = 0UL; /* Load the SysTick Counter Value */
  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; 
  return (0UL); /* Function successful */
}

 

Thx

Mario

0 Kudos

1,990 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Mario, 

I made a couple of tests on my side with the gpio_led_output example and I wasn't able to reproduce the behavior that you mentioned. The systick runs without problems and it doesn't stop after x number of interrupts. I used the example provided in SDK version 2.8.2 to make the test. 

Regards, 

Victor 

0 Kudos

1,984 Views
Srukonja
Contributor III

Thank you for the reply Victor.

Would You care compiling my project and running it on your hardware?

 

Bye,

Mario

0 Kudos

1,968 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Mario, 

I took a quick look into your project and I noticed that you are doing other things besides having the systick interrupt. What happens if in your application you leave only the Systick? Does the behavior that you are facing go away? 

Regards,

Victor 

0 Kudos

1,913 Views
Srukonja
Contributor III

NOTE: I've accidentally replied in the topic thread - sry.

0 Kudos