-
• #2
Did you mass erase the device before flashing and/or do you flash whole firmware including softdevice and bootloader (openocd should show several sections flashed)? I'd suggest to first build MDBT42Q without any changes at all, it should work too.
Starting from MDBT42Q is good, it does not need anything special so it should work in any nfr52832 device if you build and flash it correctly.
-
• #3
I am using the below method in openocd
nrf5 mass_erase program custom_firmware.hex verify reset run
-
• #4
that looks good but does not tell much without the actual output
-
• #5
the following is the console output
$ telnet localhost 4444 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Open On-Chip Debugger > nrf5 mass_erase nRF52832-CIAA(build code: E0) 512kB Flash, 64kB RAM Target not halted > halt [nrf52.cpu] halted due to debug-request, current mode: Handler HardFault xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8 > cd nrf > program espruino_bt_nbl.hex verify [nrf52.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc ** Programming Started ** Adding extra erase range, 0x00062d60 .. 0x00062fff ** Programming Finished ** ** Verify Started ** ** Verified OK ** > reset run >
-
• #6
yes, you are not flashing full firmware including softdevice and bootlader, that would show several sections of
Adding extra erase range
across whole chipbootloader is not strictly needed but softdevice definitely is. the hex file is in espruino source tree or there is zip with the hex file downloadable from Nordic (S132 3.1.0)
-
• #7
There are 3 files created, a .hex file , a .elf file, and a .zip file.
Any particular order these files have to be flashed?
Any specific options to be passed for flashing? -
• #8
After your point of me missing to flash the softdevice i tried the below steps and now the device is being detected over bluetooth. I was able to connect to the device over bluetooth, from mobile using the webide on chrome.
> halt > nrf5 mass_erase Mass erase completed. > program s132_nrf52_3.1.0_softdevice.hex verify [nrf52.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc ** Programming Started ** Padding image section 0 at 0x00000964 with 1692 bytes Adding extra erase range, 0x0001ebf0 .. 0x0001efff ** Programming Finished ** ** Verify Started ** ** Verified OK ** > program espruino_bt_nbl.hex verify [nrf52.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x000008e4 msp: 0x20000400 ** Programming Started ** Adding extra erase range, 0x00062d60 .. 0x00062fff ** Programming Finished ** ** Verify Started ** ** Verified OK ** > reset run jtag status contains invalid mode value - communication failure Polling target nrf52.cpu failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 100ms Previous state query failed, trying to reconnect Polling target nrf52.cpu failed, trying to reexamine [nrf52.cpu] Cortex-M4 r0p1 processor detected [nrf52.cpu] target has 6 breakpoints, 4 watchpoints >
The message after "reset run" being the device power cycle.
Thanks for the help. -
• #9
and a .zip file.
You are building DFU update package, that is wrong type of build for full flash over SWD.
Anyway, without bootloader it will work too. You just cannot update it over bluetooth so for new version you need to flash your
espruino_bt_nbl.hex
over SWD again. No need to flash sofdevice again if you don't mass erase.
Hi,
I have couple of Holyiot YJ-17095 modules based on nRF52832 for which i want to flash espruino.
I have the espruino files on a Debian 10 VM and have copied the MDBT42Q.py file to MDBT42Q_CUSTOM.py and changed the console to EV_BLUETOOTH. The pin numbers are changed as per the module.
The compile is successful. I copy the firmware to another linux laptop and flash the firmware using a ST-LINK V2 and openocd. i am able to flash the firmware.
After the firmware flash and power reset of the module, the module is not discovered by bluetooth.
Any pointers to where i may be wrong or missing some requied steps?
Thanks in advance.