![]() I tried to gather a lot of informations about the chip, to understand how to program it.įrom the manufacturer website: The nRF51822 is a general purpose, ultra-low power SoC ideally suited for Bluetooth® Low Energy and 2.4 GHz proprietary wireless applications. I ended up using the Arduino framework with an easy development environment. I thought it will be easy to use and will allow me to learn to use the mbed os framework. So, I bought a nRF51822 little breakout board, and a development shield name Waveshare BLE400. I discovered the nRF51822 chip, which is quite old but mainstream, and easily available on AliExpress, and can be programmed. ![]() I guess the problem is with the address, but I can’t figure out how to solve it.Let's develop a small low power sensor (prototype) which exposes some data over bluetooth, without the help of an other MCU. hex file that I get after compiling with gcc, together with the same soft device, it doesn’t. hex file contained in the SDK, I burn the. hex file together with the completed soft device s130, both included in the SDK, it works. I also think that it could be a problem with the address, did you change them in the linker script when compiling it with gcc?įLASH (rx) : ORIGIN = 0x1C000, LENGTH = 0x25000 Now, instead of using Segger I’m using gcc, as you explain in a related post. Halt nrf51 mass_erase sleep 500 flash write_image $SOFTDEV 0 flash write_image $HEXFILE 0 verify_image $SOFTDEV 0 verify_image $HEXFILE 0 reset runĪt this point, your sniffer or phone or whatever should see the Nordic_Prox device. #halt, erase, write softdevice and binary, verify both, run it. Set HEXFILE $BASEPATH/examples/ble_peripheral/ble_app_proximity/pca10028/s130/armgcc/_build/nrf51422_xxac_s130.hex Set SOFTDEV $BASEPATH/components/softdevice/s130/hex/s130_nrf51_2.0.0_softdevice.hex This is the proximity example from the SDK: set BASEPATH ~/host/home/user/Downloads/nRF5_SDK_11.0.0_89a8197 Since the path is rather long, I break it in two and store into variables. To burn the code, we need two files, in my case both are on a different machine (host) so I use sshfs to mount that. To connect from your development platform: telnet pi0 4444 If it worked correctly, the last line should read (nothing before this indicates you successfully connected): Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints ![]() To run openocd: openocd -f interface/raspberrypi-native.cfg -c "transport select swd set WORKAREASIZE 0" -f target/nrf51.cfg You can check yours by grabbing the middle 8 digits from: hexdump -s4 -n4 -e '"0x" 4/1 "X""\n"" "' /proc/device-tree/soc/rangesĮdit it with: vi /usr/local/share/openocd/scripts/interface/raspberrypi-native.cfgĬheck to be sure your default speed is 700Mhz, or adjust bcm2835gpio_speed_coeffs: cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq The peripheral base address is different on some Pi models. I needed to comment out: #bcm2835gpio_jtag_nums 11 25 10 9Īnd to add: # Each of the SWD lines need a gpio number set: swclk swdio The raspberrypi-native.cfg didn’t have SWD support, so add them from raspberrypi2-native.cfg. configure -enable-sysfsgpio -enable-bcm2835gpio Git clone git://.net/p/openocd/code openocd-code The debugger/programmer install is: cd ~/DownloadsĪpt-get install libtool libusb-dev libusb-1.0 autoconf automake texinfo For me, it was free because I had the Pi Zero and the wire.Īt the time this was written, OpenOCD didn’t have bcm2835gpio in the main release so we git clone it. The Hardware here is simple and cheap, it can be done with any Pi, though I used a Pi Zero.
0 Comments
Leave a Reply. |