This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF51822 reset handler

Hi all,

I'm having a bit of trouble figuring out why my project using the RedBearLab BLE Nano board is not working. I'm using the NRF51822 as the hub in a star network using the ESB protocol. The hub is connected to a serial port and will return each sensor's current state when queried through the serial port. The hub works as described immediately after flash and after pin reset is activated through a button. However, the hub will not work when immediately plugged in. Although it will work once the button is pressed.

I feel as though this behavior may be because I have not configured power-on reset or the reset handler (in assembly) correctly? One strange thing I have noticed is that after button reset or initial flash, the NRF_POWER->EVENTS_RXDRDY register reads 0 and 1 as expected. However, after unplugging the hub and replugging it, that register always reads 1. This leads me to believe I am not cleaning up resources appropriately (i.e. my reset handler is not working). Any help in this regard would be greatly appreciated. Thank you for your time.

Note: I am not using any SoftDevice, if that matters at all.

EDIT: I've attached my project as a zip file. I'm using the GCC cross compiler with a single Makefile to compile the hex files. The relevant source file I've been discussing is in '/OrientationTrackingRX/source/main.c'. I've also included the board schematics in the Schematics subfolder. The BLE Nano board schematic is labeled while the USB interface I'm using is the MK20 USB schematic. I'd like the stress that I'd consider myself a newbie to serious embedded programming and would welcome any notes or critiques in general about the project structure and stuff. Please let me know if anything else is required. Thank you all!

Attached Project: NordicSemi.zip

Parents
  • Yes, the topology of the network is as you described. I guess it is a bit difficult to describe what exactly the issue is. Right after flashing any device, it works as expected. For the hub, this entails receiving packets from each node over ESB and receiving and sending commands to the usb. Each node also reads data from its sensor over I2C and sends that data to the hub over ESB. Additionally, I get the expected behavior after I reset a device using a reset button. However, if I simply power on a device (say by plugging in the MK20 to the PC USB port or connecting a node to a battery), I no longer get the expected behavior. For the hub, it does not respond to any UART commands and the nodes no longer respond to GPIO events. However, they seem to both still undergo ESB communication. That's kind of far as I have been able to parse out from my probing.

Reply
  • Yes, the topology of the network is as you described. I guess it is a bit difficult to describe what exactly the issue is. Right after flashing any device, it works as expected. For the hub, this entails receiving packets from each node over ESB and receiving and sending commands to the usb. Each node also reads data from its sensor over I2C and sends that data to the hub over ESB. Additionally, I get the expected behavior after I reset a device using a reset button. However, if I simply power on a device (say by plugging in the MK20 to the PC USB port or connecting a node to a battery), I no longer get the expected behavior. For the hub, it does not respond to any UART commands and the nodes no longer respond to GPIO events. However, they seem to both still undergo ESB communication. That's kind of far as I have been able to parse out from my probing.

Children
No Data
Related