Open pascal-gujer opened 3 years ago
Hey.
The nRF52832 is way harder then the nRF52840, i was able to glitch it and your timing at +7 ms is correct.
I am not sure why nRF52832 is harder it could be that caps are needed to be removed
Thank you for the quick response! Do you remember the glitch width which yield to success? And how long did it take for you?
I had to buy an oscilloscope (analog discovery 2) to get the right timing, but I was successful with an nRF52832. I tweaked the code to allow a delay up to 60 and used these settings:
It took something on the order of 6 hours but I eventually got a final
Answer: Glitcher running Delay: 8382 Width: 40
I had to buy an oscilloscope (analog discovery 2) to get the right timing, but I was successful with an nRF52832. I tweaked the code to allow a delay up to 60 and used these settings:
- Delay: 8250
- Delay end: 8500
- Power off delay: 100
- SWD wait: 100
It took something on the order of 6 hours but I eventually got a final
Answer: Glitcher running Delay: 8382 Width: 40
Wow Great job @bettse could you make a repo and upload your version?
Also could you explain what and where you changed they code up. To help the community.
Cheers. @bettse
Had my change been any more significant, I absolutely would have forked and opened a PR.
The 'tweak' I made was on this line: https://github.com/atc1441/ESP32_nRF52_SWD/blob/main/ESP32_SWD_WIFI/glitcher.cpp#L15
changing the width_max from '30' to '60'.
@bettse thank you for the information! Do you happen to have a picture of your oscilloscope output, for visuals?
Cheers.
It is very much like Pascal's
@bettse hey looks about the same, what do you think?
@bettse question did you change anything else? I have been letting the glitcher run for 24hrs, with no success.
nRF52832
Delay start 8250 Delay end. 8600
Power off delay 100 SWD wait. 100
Width I changed it to 0 -60
I'm using a DC 5V-36V 15A Max 30A 400W Dual High-Power MOSFET Trigger Switch Drive Module 0-20KHz
Are you using the same mosfet? I would appreciate your advice thank you.
Looks like the same mosfet. The glitch in your screenshot does look quite a ways before dip, but it's hard to be sure without a timescale. From what I read about glitching the nrf52832 there is a certain amount of luck involved.
A general question to the ones succeeding in glitching the nrf: What was your room temperature?
I have the Idea, that maintaining a constant temperature is crucial and that warmer temperatures help with glitching…
My thermostat would have been near 72°F (Stop looking at me like that, I live in the US, this is how we measure temperature). I'm in a well insulated building, so I suspect it would be near that value if not slightly above.
I look forward to a blog post on "glitching in the oven" 😆 .
I found the following that might be useful:
I didn't need any increase in my glitch width, and I was using the same MOSFET module. Not sure how temperature would affect things, but it would have been around 22C/72F for me as well.
@charliebruce wow thank you for the information mate. We all appreciate it and thank you for the help 🤗.
Had my change been any more significant, I absolutely would have forked and opened a PR. The 'tweak' I made was on this line: https://github.com/atc1441/ESP32_nRF52_SWD/blob/main/ESP32_SWD_WIFI/glitcher.cpp#L15
changing the width_max from '30' to '60'.
Thank you @atc1441 for this great tool and thank you @bettse for the parameters! With that I was able to glitch my nRF52832! Don't even have an oscilloscope (yet), but enough time ;)
Off topic: It would be great if the pulse width would be a configurable parameter
Please check out the branch called PCB_Version.
If i remember right i did add the option to setting more time. I did added it for sure just dont know if i ever published it
That version has a different pinout.
Was just glitching an nRF52832 I removed 2 caps, after doing that it only took 30 seconds as on the nRF52840, so as a tip i suggest on removing these 2 caps for nRF52832 glitching
Yes, it seems like these caps (or other caps in the power circuit, if there are any) will keep the nRF52 powered way longer. I now have an oscilloscope and was able to confirm, that a power off delay of 100 is the bare minimum for my setup. Also, with cap C4 gone, I'm pretty sure the typical pulse width should be ok and modifying glitcher.cpp
is not needed. (Can not confirm this. So far I don't want to remove C4 in my setup.)
Tested once more with resoldered C9 so it seems C4 is enough to remove.
Then i have a super reliable glitch after just a 1-30 seconds
@atc1441 hey 👋 what perimeters are you using? I think it would be helpful to include the information for others. nRF52832
Mine are 8550 - 8700 32 width Power off 150 swd 150 Time 0 mins to 3 hrs it's random for me.
@atc1441 can you share your timing settings? :)
So, I removed C4, C9, C10 on a device based on the reference schematics. Chip Rev. is E (not fixed like G). I've tried various timing ranges, increased max_width=60 but have no luck yet :/ (No scope here, unfortunately)
Got a scope now. I successfully glitched a nrf52840 (makediary nRF52840 Micro Dev Kit, cap present) multiple times. However, nrf52832 seems to be a tough nut to crack. I have two different devices, which I didn't glitch successfully, yet:
This is what the JINOU looks like on the scope:
CH1 VCC_nrf (trigger), CH2 DEC1, CH3 glitch signal
Parameters:
Can agree that the nrf52832 is harder to catch. Sometimes i needed to glitch for 24hours
Can agree that the nrf52832 is harder to catch. Sometimes i needed to glitch for 24hours
Hmm, you mean for 24h in a loop? IOW testing multiple delays multiple times?
I wonder if it would get better with even shorter glitches.
Yes, the ESP32 was looping trough the set times, also since the temperature does also has an influence this does extend it in the end as well. On one device the glitching did took not even 1 minute on the other hours so its a bit of luck involved, i had better luck with desoldered Capacitors around DEC
Yes, the ESP32 was looping trough the set times, also since the temperature does also has an influence this does extend it in the end as well. On one device the glitching did took not even 1 minute on the other hours so its a bit of luck involved,
i had better luck with desoldered Capacitors around DEC
I tried with only DEC1 cap (C4 in the ref schematics) removed and with the VCC cap (C9) and even C10 removed additionally. Did you remove the DEC4 cap as well?
Dont remember exactly, but its worth a try.
Finally..... JINOU has fallen \o/ Removing DEC1-4 was too much (voltage became extremely unstable), so I resoldered DEC2-3. One thing I noticed is that by increasing the glitch delay the voltage drop gets pushed ahead (iow delay between power on and drop increases as the glitch delay increases) until the glitch point suddenly is several hundred us past the voltage drop... Maybe that is what makes glitching the nrf52832 so hard.
Oh, important detail: I glitched DEC4
Update: success on the other device through DEC4!
Outch. Glad too early... the flash always only reads 42 00 00 23 .... o.O
Another update: just glitch multiple times and retry. Flash dump will work at some point
Thanks for this great find!
I was able to glitch a nrf52832
successfully with C4
removed within 3 hours.
Unfortunately I trying to glitch another nrf52832
on a different style board without C4
removed (yet, as the board is very cramped and removing the cap is difficult) but I'm having trouble understanding the build-in software oscilloscope.
I've tried multiple timings, but the voltage drop seems to move between the glitch timings 3690 - 5680:
When I choose glitch timings before 3690 and after 5680 I can clearly see that the glitch is to soon or late:
Did anyone observe such a moving voltage drop, and to my understanding the glitch should have more success in the 5680 range than it would around 3690. As after 5680 the natural voltage drop seems to happen?
Thanks for this great find! I was able to glitch a
nrf52832
successfully withC4
removed within 3 hours.Unfortunately I trying to glitch another
nrf52832
on a different style board withoutC4
removed (yet, as the board is very cramped and removing the cap is difficult) but I'm having trouble understanding the build-in software oscilloscope.I've tried multiple timings, but the voltage drop seems to move between the glitch timings 3690 - 5680:
When I choose glitch timings before 3690 and after 5680 I can clearly see that the glitch is to soon or late:
Did anyone observe such a moving voltage drop, and to my understanding the glitch should have more success in the 5680 range than it would around 3690. As after 5680 the natural voltage drop seems to happen?
Check out my comment https://github.com/atc1441/ESP32_nRF52_SWD/issues/10#issuecomment-1416321034 I have seen this "moving target", too. I tried, too, with the built-in osci but it was a PITA, so I got myself a real osci.
The correct glitch point is right after that voltage drop. Timing is very much depending on multiple factors like 1) temperature 2) exact capacitance values (tolerances, trace lengths etc.) 3) attached peripherals 4) probably more. So, the only way to find the right timing is by trying on the specific device.
Ah you're right, I read your comment but I misinterpreted it the first time 🤦. Now I see it.
Temperature is quite cold (18°c) and previous successful glitch was indeed warmer (25°c). Maybe I should use a hair dryer to get the temps up 😆.
Mmh so if it should be right after the voltage drop in my case the glitch delay should be between 5680 and 5900 I suppose.
Ah you're right, I read your comment but I misinterpreted it the first time 🤦. Now I see it.
Temperature is quite cold (18°c) and previous successful glitch was indeed warmer (25°c). Maybe I should use a hair dryer to get the temps up 😆.
That might help
Mmh so if it should be right after the voltage drop in my case the glitch delay should be between 5680 and 5900 I suppose.
You can also try to glitch through DEC4 instead, where I had waaaaaay better results
And by using DEC4
you removed C4
and C10
correct?
And by using
DEC4
you removedC4
andC10
correct?
Yep
Also my chip dates from 2021 week 11 and according to the description below (source), and from what I've read the method is patched around November 2021. So I suspect my chip is still vulnerable 🤔🙏
Also my chip dates from 2021 week 11 and according to the description below (source), and from what I've read the method is patched around November 2021. So I suspect my chip is still vulnerable thinkingpray
You just can check the hardware revision, which is the first of the two letters in the build code (HP). For nRF52832 anything before G is vulnerable (G is the first fixed revision). For nRF52840 it's anything before E.
Ah that's even better, mine is at E0
so it is definitely vulnerable 😈
And by using
DEC4
you removedC4
andC10
correct?Yep
I've been running the glitching on previously said timings yet no successful glitch after 24h 😢
So I removed C4
and C10
together with C9
as they were all cramped together. And as C9
is on the VDD
line and that one also got removed on my first successful glitched nRF52832
I hope it doesn't affect things very much this time.
I do still glitch using DEC1
though as I had some success with it previously, if this again fails I will try DEC4
and maybe re-solder C9
.
As you also noticed the power (DEC1
?) is very noisy after removing the caps, yet I'm able to read the coreid
and detect that the unit is locked. So at least the CPU is somewhat functioning I suppose.
And by using
DEC4
you removedC4
andC10
correct?Yep
I've been running the glitching on previously said timings yet no successful glitch after 24h cry So I removed
C4
andC10
together withC9
as they were all cramped together. And asC9
is on theVDD
line and that one also got removed on my first successful glitchednRF52832
I hope it doesn't affect things very much this time.I do still glitch using
DEC1
though as I had some success with it previously, if this again fails I will tryDEC4
and maybe re-solderC9
.As you also noticed the power (
DEC1
?) is very noisy after removing the caps, yet I'm able to read thecoreid
and detect that the unit is locked. So at least the CPU is somewhat functioning I suppose.
Well, yeah, I was trying for hours and hours without success. Then switched to DEC4 and had damn reliable success within a hour of testing various timings :D Don't waste your time :P
I wonder how bad flash reading are going to be if you got a successful one with that unstable power :/ Could be that dumping doesn't work at all, but that's just pure speculation.
My first successful glitch had C4
and C9
removed, unfortunately I did not test if it had unstable power at the time. It did however got 3 matching dumps so I suspect they were correct, and device was still able to run its program without the caps.
Maybe if glitching keeps failing I test the other PCB and see how that one behaves.
Well, yeah, I was trying for hours and hours without success. Then switched to DEC4 and had damn reliable success within a hour of testing various timings :D Don't waste your time :P
I've now attached the glitch signal to DEC4
but the build-in osci is all over the place 🥲
When I measure the wire itself it is at 1.427v which seems alright to me.
Seeing this graph I cannot determine the right glitch timing.
Well, yeah, I was trying for hours and hours without success. Then switched to DEC4 and had damn reliable success within a hour of testing various timings :D Don't waste your time :P
I've now attached the glitch signal to
DEC4
but the build-in osci is all over the place smiling_face_with_tear When I measure the wire itself it is at 1.427v which seems alright to me. Seeing this graph I cannot determine the right glitch timing.
Oops. You could try to resolder the DEC4 cap. I think I had seen that as well but... it was laaaate... so I don't remember well \o/
So you mean you either had C10
and C4
or only C4
removed? But are not sure what combination created a successful glitch?
So you mean you either had
C10
andC4
or onlyC4
removed? But are not sure what combination created a successful glitch?
Yeah, right. Maybe I just remembered wrongly when reporting success here :/ I had tried various combinations
Ok re-soldered C10
, and the graph seems more promising now.
At what point did you apply the glitch?
Ok re-soldered
C10
, and the graph seems more promising now. At what point did you apply the glitch?
Yeah, that looks way better! It's difficult to estimate bc of the missing scale, but it should be a bit earlier, like so:
You should start here, right before the drop:
Thanks! Seems to be between 5600 and 5700, I'll let it run for some time. 👍
I must say that the glitch has another impact on DEC4
than it does on DEC1
.
On DEC4
the voltage drop gradually decreases after the glitch, while on DEC1
it remains a immediate drop
Thanks! Seems to be between 5600 and 5700, I'll let it run for some time. +1 I must say that the glitch has another impact on
DEC4
than it does onDEC1
. OnDEC4
the voltage drop gradually decreases after the glitch, while onDEC1
it remains a immediate drop
Yeah, the "moving target" problem gets worse indeed.
Thank you for this nice little SWD programmer GUI and the glitcher for the ESP32 :D
I am currently trying to glitch an nrf52832. I narrowed down the glitching width in the source code to 6-10us, as this should do the trick according to other researchers. I try to find the right timing for glitching the nrf52832 for quite some time now. Somehow I am either glitching at the wrong timing or just doing something wrong. Has anyone a hint for me? I recorded some scope recordings:
Where should the glitch be applied? I thought somewhere around +7ms in Zoom1/Zoom2 - is this correct?