-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Targeting the nRF51822-based CJMCU-8223 #14
Comments
Hi Colby. No idea what's different between our boards and yours. Please first make sure that you can flash and debug simple programs, e.g. a blink example. If this works, please try to single step Raccoon on your device. If you find that a hard fault is hit every time on a particular line in the code, please share a backtrace here. |
I've had success with the Nordic firmware, and both the blink and iBeacon examples from mbed. Here is my gdb output, I've indented it so it's easier to read. |
Any idea why it doesn't show C code or at least assembly while stepping? It seems to crash during the Reset Handler. Usually that's where the memory is setup, e.g. the stack. Anyway, I have the hunch that your board uses a different 51822 variant than the BLEFriend32. The BLEFriend32 uses a 51822-XXAC with 256 kB Flash and 32 kB RAM, while your board has a 51822-QFAA with 256 kB Flash and 16 kB RAM. |
Great catch! I hadn't noticed that, and it's likely the root cause. I've made the relevant modifications to the toolchain and the RAM is about 3kb too small, will need to find a way to shave 3k off somewhere. Edit: No idea why gdb is acting the way that it is, it's completely possible I'm misusing it -- not super familiar with how to properly use gdb. |
Thanks!! Raccoon runs perfectly by (duh) setting the correct linker parameters for that specific chip. I shaved off 3k of RAM by reducing the Since that issue is unrelated, I'm happy to open another issue for clarity, because the issue in the title is technically solved. Thanks again! Edit: According to |
Glad you were able to fix the hard fault. About memory: it's been a while that I've worked on that. If you've already used nm, you probably know more than me. How much RAM is used now? |
In the current working configuration (all values in decimal, annotated for clarity):
With the original 64 entries in the |
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: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
The text was updated successfully, but these errors were encountered: