You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. nrfjprog --memrd 0x10001080 > _temp.txt
  4. set /p lot_string=<_temp.txt
  5. nrfjprog --memrd 0x10001084 > _temp.txt
  6. set /p id_string=<_temp.txt
  7. del _temp.txt
  8. for /L %%i in (0,1,7) do (
  9. set "hex_digit=!lot_string:~12,1!"
  10. set "lot_num=!lot_num!!hex_digit!"
  11. set "lot_string=!lot_string:~1!"
  12. )
  13. for /L %%i in (0,1,7) do (
  14. set "hex_digit=!id_string:~12,1!"
  15. set "id_num=!id_num!!hex_digit!"
  16. set "id_string=!id_string:~1!"
  17. )
  18. echo lot_num: %lot_num% id_num: %id_num%
  19. nrfjprog --eraseall -f NRF52
  20. @REM ��¼lot
  21. nrfjprog -f nrf52 --memwr 0x10001080 --val 0x%lot_num%
  22. @REM ��¼ID
  23. nrfjprog -f nrf52 --memwr 0x10001084 --val 0x%id_num%
  24. nrfjprog --program output/app_whole.hex --verify -f NRF52 %��¼%
  25. if %errorlevel% neq 0 (
  26. echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
  27. echo E ��¼ʧ�� E
  28. echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
  29. endlocal
  30. exit /b 1
  31. )
  32. nrfjprog --reset -f NRF52 %��λ%
  33. if %errorlevel% neq 0 (
  34. echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
  35. echo E ��λʧ�� E
  36. echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
  37. endlocal
  38. exit /b 1
  39. )
  40. echo ---------------------------------------------------------------
  41. echo - done
  42. echo ---------------------------------------------------------------
  43. endlocal