aladds / OFO_Lock

Reprogram an OFO bike lock to unlock with a numeric code
15 stars 3 forks source link

not working #1

Open s33k3rs opened 3 years ago

s33k3rs commented 3 years ago

I have done flashing with Arduino and St-Link v2, after completion nothing happened when I pressed the 1,2,3,4 button

Sketch uses 3396 bytes (2%) of program storage space. Maximum is 151552 bytes. Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 0 0x4000 adapter speed: 1000 kHz nrf51.cpu: target state: halted target halted due to debug-request, current mode: Thread xPSR: OxclOOOOOO pc: 0x00018504 msp: 0x20004000 Programming Started auto erase enabled nrf51.cpu: target state: halted target halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000001e msp: 0x20004000 wrote 4096 bytes from file C:\Users\Wahyudi\AppData\Local\Temp\arduino_build_46005/0F0_Codelock.ino.hex in 0.272688s (14.669 KiB/s) Programming Finished “ Verify Started nrf51.cpu: target state: halted target halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000002e msp: 0x20004000 verified 3524 bytes in 0.053903s (63.844 KiB/s) Verified OK Resetting Target ** shutdown command invoked

aladds commented 3 years ago

It’s probably a good idea to use openocd to fully blank the chip and erase the write protect flags. I did this anyway since I was also trying to dump the firmware to back it up (and I do have a copy of that somewhere...not that that matters now)

I assume you’re using an ST-Link2?

Let me know how you get on!

s33k3rs commented 3 years ago

Before flashing using Arduino and St-Link v2, I have done backup firmware of NRF-51 using "nrfsec read -a" with output backup files:

nrfsec unlock with result : Protect All Disabled

however i can't empty chip with command "nrf51 bulk_erase", i used "nrf51 mass_erase" command to erase chip on OpenOCD, is this the problem?

finally I uploaded OFO_Codelock.ino using Arduino v1.8.13 and ST-Link v2 with configuration:

And the result is : Sketch uses 3396 bytes (2%) of program storage space. Maximum is 151552 bytes. Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 0 0x4000 adapter speed: 1000 kHz nrf51.cpu: target state: halted target halted due to debug-request, current mode: Thread xPSR: 0xc1000000 pc: 0x00018504 msp: 0x20004000 Programming Started auto erase enabled nrf51.cpu: target state: halted target halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000001e msp: 0x20004000 wrote 4096 bytes from file C:\Users\Wahyudi\AppData\Local\Temp\arduino_build_678690/OFO_Codelock.ino.hex in 0.258759s (15.458 KiB/s) Programming Finished Verify Started nrf51.cpu: target state: halted target halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000002e msp: 0x20004000 verified 3524 bytes in 0.053031s (64.894 KiB/s) Verified OK Resetting Target shutdown command invoked

aladds commented 3 years ago

I would try flashing a known sketch onto it and see if you can make the beeper beep to test it. These locks are particularly vulnerable to water ingress and it’s possible your buttons are somehow damaged