Skip to content

Commit

Permalink
Comments added into the batch files
Browse files Browse the repository at this point in the history
  • Loading branch information
baruaanomadarshishuvro committed Nov 9, 2016
1 parent d409024 commit d653ec6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
4 changes: 2 additions & 2 deletions nRF51/bootloader/pc-util/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ This batch file executes the following commands sequentially :
command line or powershell .But in both cases , they should be called from the "bootloader" folder level. An example is provided below :

* From command line for nRF51 : C:\Users\Desktop\nRF51-ble-broadcast-mesh-private\nRF51\bootloader>.\pc-util\for_loop_batch_nRF51.bat
* From Powershell for nRf51 : PS C:\Users\anba\Desktop\nRF51-ble-broadcast-mesh-private\nRF51\bootloader> cmd /c .\pc-util\for_loop_batch_nRF51.bat
* From Powershell for nRF51 : PS C:\Users\anba\Desktop\nRF51-ble-broadcast-mesh-private\nRF51\bootloader> cmd /c .\pc-util\for_loop_batch_nRF51.bat
* From command line for nRF52 : C:\Users\Desktop\nRF51-ble-broadcast-mesh-private\nRF51\bootloader>.\pc-util\for_loop_batch_nRF52.bat
* From Powershell for nRf52 : PS C:\Users\anba\Desktop\nRF51-ble-broadcast-mesh-private\nRF51\bootloader> cmd /c .\pc-util\for_loop_batch_nRF52.bat
* From Powershell for nRF52 : PS C:\Users\anba\Desktop\nRF51-ble-broadcast-mesh-private\nRF51\bootloader> cmd /c .\pc-util\for_loop_batch_nRF52.bat



Expand Down
19 changes: 13 additions & 6 deletions nRF51/bootloader/pc-util/flash_open_mesh_nRF51.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,32 @@ SETLOCAL
REM @echo on



REM assign the segger id
SET seggerid=%~1


REM Erase the nRF51
nrfjprog -s %seggerid% --eraseall --family NRF51

nrfjprog -s %seggerid% --program ..\softdevices_nRF51_nRF52\s110_nrf51_8.0.0\s110_nrf51_8.0.0_softdevice.hex --family NRF51
REM Program nRF51 with softdevice hex file
nrfjprog -s %seggerid% --program ..\softdevices\s110_nrf51_8.0.0\s110_nrf51_8.0.0_softdevice.hex --family NRF51

REM Program nRF51 with bootloader hex file
nrfjprog -s %seggerid% --program .\bin\bootloader_serial_xxAC.hex --family NRF51

REM Generate a fresh device page for nRF51
del .\pc-util\example.hex
.\pc-util\device_page .\pc-util\example --nrf51
s
REM Program nRF51 with device page
nrfjprog -s %seggerid% --program .\pc-util\example.hex --family NRF51

REM Program nRF51 with application hex
nrfjprog -s %seggerid% --program ..\examples\BLE_Gateway\bin\rbc_gateway_example_serial_nRF51422_xxAC.hex --family NRF51

REM Generate the DFU package
SET new_application=..\examples\BLE_Gateway\bin\rbc_gateway_example_serial_blinky_PCA10031_nRF51422_xxAC.hex

.\pc-util\nrfutil.exe dfu genpkg --application ..\examples\BLE_Gateway\bin\rbc_gateway_example_serial_blinky_PCA10031_nRF51422_xxAC.hex --company-id 0x00000059 --application-id 1 --application-version 2 --sd-req 0x0064 --mesh dfu_test.zip


.\pc-util\nrfutil.exe dfu genpkg --application %new_application% --company-id 0x00000059 --application-id 1 --application-version 2 --sd-req 0x0064 --mesh dfu_test.zip

REM Reset the nRF5x to get it ready for DFU
nrfjprog -s %seggerid% --reset --family NRF51
Expand Down
23 changes: 14 additions & 9 deletions nRF51/bootloader/pc-util/flash_open_mesh_nRF52.bat
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
SETLOCAL
REM @echo on


REM assign the segger id
SET seggerid=%~1


REM Erase the nRF52
nrfjprog -s %seggerid% --eraseall --family NRF52

nrfjprog -s %seggerid% --program ..\softdevices_nRF51_nRF52\s132_nrf52_3.0.0\s132_nrf52_3.0.0_softdevice.hex --family NRF52
REM Program nRF52 with softdevice hex file
nrfjprog -s %seggerid% --program ..\softdevices\s132_nrf52_3.0.0\s132_nrf52_3.0.0_softdevice.hex --family NRF52

REM Program nRF52 with bootloader hex file
nrfjprog -s %seggerid% --program .\bin\bootloader_serial_nrf52_xxAA.hex --family NRF52

REM Generate a fresh device page for nRF52
del .\pc-util\example52.hex
.\pc-util\device_page .\pc-util\example52 --nrf52

REM Program nRF52 with device page
nrfjprog -s %seggerid% --program .\pc-util\example52.hex --family NRF52

REM Program nRF52 with application hex
nrfjprog -s %seggerid% --program ..\examples\BLE_Gateway\bin\rbc_gateway_example_serial_nRF52832_xxAA.hex --family NRF52

REM Generate the DFU package
SET new_application=..\examples\BLE_Gateway\bin\rbc_gateway_example_serial_blinky_PCA10040_nRF52832_xxAA.hex
.\pc-util\nrfutil.exe dfu genpkg --application %new_application% --company-id 0x00000059 --application-id 1 --application-version 2 --sd-req 0x0084 --mesh dfu_test.zip


.\pc-util\nrfutil.exe dfu genpkg --application ..\examples\BLE_Gateway\bin\rbc_gateway_example_serial_blinky_PCA10040_nRF52832_xxAA.hex --company-id 0x00000059 --application-id 1 --application-version 2 --sd-req 0x0084 --mesh dfu_test.zip



REM Reset the nRF5x to get it ready for DFU
REM Reset the nRF52 to get it ready for DFU
nrfjprog -s %seggerid% --reset --family NRF52

4 changes: 3 additions & 1 deletion nRF51/bootloader/pc-util/for_loop_batch_nRF51.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
SETLOCAL
ECHO ON


REM Store the segger ids of all connected nRF51 devices
nrfjprog -i > .\tmp_remove_me.txt

REM Program each nRF51 device with new hex files
FOR /f %%i IN (.\tmp_remove_me.txt) DO .\pc-util\flash_open_mesh_nRF51.bat %%i

REM Delete the temporary file
del .\tmp_remove_me.txt
4 changes: 3 additions & 1 deletion nRF51/bootloader/pc-util/for_loop_batch_nRF52.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
SETLOCAL
ECHO ON


REM Store the segger ids of all connected nRF52 devices in a temporary file
nrfjprog -i > .\tmp_remove_me.txt

REM Program each nRF52 device with new hex files
FOR /f %%i IN (.\tmp_remove_me.txt) DO .\pc-util\flash_open_mesh_nRF52.bat %%i

REM Delete the temporary file
del .\tmp_remove_me.txt

0 comments on commit d653ec6

Please sign in to comment.