The generic CJMCU-8223 board uses an nRF51822, the same as the Adafruit blefriend32 boards. The Nordic sniffer firmware used on the pre-flashed Adafruit sniffer dongle works fine on the 8223 (both v1 and v2) but unfortunately, some of the UART flow control pins set up by the official firmware aren't broken out on the 8223, so I decided to give Raccoon a shot.
I thought it would be as simple as modifying firmware/nrf/blefriend32/config/custom_board.h to set the LED and UART pins I'd like, compile, flash, everything would work (considering it's the same chip) but Raccoon firmware immediately traps in a HardFault when building and flashing unmodified from git:
> halt
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x21000003 pc: 0x0000097e msp: 0x20007fe0
Flashing with openocd -f flash_blefriend32.cfg:
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.304653
Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for nrf51.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x0000093c msp: 0x20008000
Info : nRF51822-QFAA(build code: H2) 256kB Flash, 16kB RAM
Info : Mass erase completed.
Info : A reset or power cycle is required if the flash was protected before.
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Warn : Adding extra erase range, 0x00007d6c .. 0x00007fff
** Programming Finished **
** Verify Started **
** Verified OK **
Please let me know what additional information you need, or additional things I should try. I'm not very experienced with the arm toolchain (and on-chip debugging) so any help would be greatly appreciated.
Fedora 36
arm-none-eabi-binutils-cs-1:2.37-4.fc36.x86_64
arm-none-eabi-gcc-cs-1:11.1.0-2.fc36.x86_64
arm-none-eabi-gcc-cs-c++-1:11.1.0-2.fc36.x86_64
arm-none-eabi-newlib-4.1.0-4.fc36.noarch
The generic CJMCU-8223 board uses an nRF51822, the same as the Adafruit blefriend32 boards. The Nordic sniffer firmware used on the pre-flashed Adafruit sniffer dongle works fine on the 8223 (both v1 and v2) but unfortunately, some of the UART flow control pins set up by the official firmware aren't broken out on the 8223, so I decided to give Raccoon a shot.
I thought it would be as simple as modifying
firmware/nrf/blefriend32/config/custom_board.hto set the LED and UART pins I'd like, compile, flash, everything would work (considering it's the same chip) but Raccoon firmware immediately traps in a HardFault when building and flashing unmodified from git:Flashing with
openocd -f flash_blefriend32.cfg:Please let me know what additional information you need, or additional things I should try. I'm not very experienced with the arm toolchain (and on-chip debugging) so any help would be greatly appreciated.
Fedora 36
arm-none-eabi-binutils-cs-1:2.37-4.fc36.x86_64
arm-none-eabi-gcc-cs-1:11.1.0-2.fc36.x86_64
arm-none-eabi-gcc-cs-c++-1:11.1.0-2.fc36.x86_64
arm-none-eabi-newlib-4.1.0-4.fc36.noarch