Ok, what do you mean by "flashing does not work" ? If flashing won't work, nothing will work :)
After flashing Espruino, the dongle shows up as a virtual COM port, nothing special, Windows says the driver is by Microsoft, so you shouldn't need any special driver I think. Or BLE, no driver needed at all.
So, I'm lazy to type so just use nRF Connect desktop's "Programmer". You can use the command line tools, the GUI is calling that, so the result should be the same...
- The hex's SHA1 should be: 57B9580CE13F18498255EFE8BEDF3370FF040ADB. Re-download if it's different! There is a tiny chance of wrong download...
- This will work if your dongle still has the original USB bootloader. If you have completely erased, or uploaded a different bootloader that doesn't work with
nrfjprog, you will need an SWD programmer. But the end result should be the same.
- Plug-in the dongle, and press the reset button (the one sideways). The red LED should start pulsing.
- Launch nRF Connect & programmer. Select the device (top-left). The contents of the dongle's memory should be visible on the left. See the screenshot
- Press "Clear files" if you have previously added any file. "Add HEX file" (top-right), select the dongle's hex and hit write. Should take half a minute or so.
- Unplug & re-plug the dongle!
- Now you should be able to connect to the dongle via BLE or USB. USB feels a bit not-so-perfect: I have to send an extra character sometimes to get the full response from the dongle. Didn't have this issue with BLE tho...
The programmer's log output should look like this:
2020-06-26T06:41:00.428Z INFO Using USB SDFU protocol to communicate with target
2020-06-26T06:41:00.446Z INFO Protocol Version: 1 found
2020-06-26T06:41:00.447Z INFO Hardware: 52840 found
2020-06-26T06:41:00.452Z INFO Firmware: Bootloader found
2020-06-26T06:41:00.452Z INFO Firmware: SoftDevice found
2020-06-26T06:41:00.453Z INFO Firmware: Application found
2020-06-26T06:41:17.200Z INFO Parsing HEX file: C:\dev\espruino\_firmware\nRF52840\espruino_2v06.6_nrf52840_dongle.hex
2020-06-26T06:41:17.201Z INFO File was last modified at 23/06/2020, 18:24:22
2020-06-26T06:41:17.475Z INFO SoftDevice detected, id 0xA9 (S140 v6.0.0)
2020-06-26T06:42:36.283Z INFO Does not need to be reloaded: C:\dev\espruino\_firmware\nRF52840\espruino_2v06.6_nrf52840_dongle.hex
2020-06-26T06:42:36.294Z INFO SdReq for SoftDevice is set as 0x00.
2020-06-26T06:42:36.296Z INFO Hash is generated by SHA256
2020-06-26T06:42:36.298Z INFO Hash is generated by SHA256
2020-06-26T06:42:36.311Z INFO Performing DFU. This may take a few seconds
2020-06-26T06:42:36.380Z INFO DFU procedure starts. This may take a few seconds.
2020-06-26T06:42:44.785Z INFO DFU for SoftDevice completed successfully!
2020-06-26T06:42:44.786Z INFO 1 dfu package(s) left.
2020-06-26T06:42:44.787Z INFO Waiting for device
2020-06-26T06:42:44.899Z INFO DFU procedure starts. This may take a few seconds.
2020-06-26T06:42:59.791Z INFO DFU for Application completed successfully!
2020-06-26T06:42:59.791Z INFO 0 dfu package(s) left.
2020-06-26T06:42:59.792Z INFO Waiting for device
2020-06-26T06:43:04.793Z ERROR Reopen device failed: Timeout while waiting for device C132E264CC6B to be attached and enumerated
2020-06-26T06:43:04.793Z INFO Nordic DFU Trigger Interface was not found.Please physically reset device.
2020-06-26T06:43:04.796Z ERROR Device not found due to failure during DFU
2020-06-26T06:43:04.810Z INFO Target device closed.
Small correction, looks like I lost my latest board file, so BTNs and LEDs are the same as on the devkit, and that's not correct. But for example
D6.toggle() does toggle the green LED. Just look up the pin numbers in the dongle's user guide.