This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Power-cycling reset vs JLink reset

We've developed a custom board based on the nRF51822-QFAA and an MPU-6050 IMU. It runs on a li-pol battery and uses S110.

I've encountered a strange problem when power-cycling the device (taking the battery out and putting it back it) that doesn't happen when I reset the device using Jlink for example.

Link to the code.

The problem is the following:

We initialize the MPU (set acceleration range, interrupts, etc) once at the beginning of the execution and when the initialization it's done, we set a global variable to "true" (that variable is initialized as false). The reason for that is to prevent more than one initialization.

When the device is reset using Jlink, the MPU is correctly initialized and the global variable set to 1. But when we power cycle the device, it looks like the global variable is not set back to it's default value (false) so the MPU is not initialized. That problem is solved if we reset the device using Jlink again.

The problem consistently appears every time we power-cycle the device and goes away when we reset it using Jlink.

I've found this other post and it seems to be the same problem.

Is there any difference between the Jlink reset and a power-cycle? I've been trying to figure this out for days.

Thanks!

Related