Issues with programming/operation of custom PCB with nRF52832

I've just built up a batch of custom PCB's we designed using the nRF52832-QFAA IC's.  I'm attempting to program these with the nRF52-DK, and am following the connection diagram indicated below, with the exception that I have not got the GND_DETECT connected, as I am led to believe this is not necessary.

My custom board is designed around the Internal LDO reference design in the nRF52832 Product Specification, and looks like this:

My 32MHz Xtal has 8pF load capacitance, ESR = 80 ohms and shunt capacitance of 3pF, which appears to be within spec according to the spec for the 64 MHz crystal oscillator (HFXO).

I have erased the nRF52 chip on my DK, so that (I assume) it lets all the GPIO float.  And then I have programmed my custom board with a simple LED blinky program.  Testing of this LED Blinky on the nRF53-DK indicates it is working as expected, but when I flash my custom board, I'm not seeing anything on the appropriate GPIO pin.

I've tested both powering my custom board via the DK, and also powering the custom board from an external PSU.  Checking the current indicates a load of 4-7mA, which seems a bit high. 

Poking around on some other GPIO, I noticed that P0.05 is being switched on/off at about 2200Hz, with a pulse width of ~ 7usec.

I programmed and tested a second production board, and that showed the same behaviour.

I then tested a board that was straight off the production floor and hadn't been programmed, and that wasn't doing anything (as I'd expect).

So, for some reason, code is being flashed to the device, but its not the code I am expecting to be flashed to the device.  I'm trying to toggle P0.17 at about 1Hz with a 50% duty cycle, but instead I'm seeing P0.05 toggle at about 2200Hz with a ~ 2% duty cycle!

Does anyone have any idea what I'm doing wrong?

Cheers,

Mike

  • A bit of an update...

    I've disconnected all my GPIO, so the chip basically isn't loaded up on any inputs apart from the I2C SCL/SDA.  Everything else is free to do whatever it wants.

    Flashing my LED Blinky code now appears to do nothing to any of the GPIO.  And the unexpected behaviour on P0.05 only appears when I've got the custom board powered off an external 3V supply.  Current is still sitting around the 7.5mA level.

  • Hello,

    We would like to know the answers of following questions:

    Do you have the 32.768kHz crystal mounted also?

    What SDK are you using? NCS and the nRF5 SDK?

    When you build the HEX file that you program to the custom board do you build for the DK or you build for a custom board file?

    Have you tested the radio on a pre-production sample? It seems here is quite few RF components that can effect the performance significantly.

    Are you able read the devices memory with nrfjprog or the programmer app from the nRF desktop app?

    Thanks.

    Best Regards,

    Kazi Afroza Sultana

  • Hi Kazi,

    Thanks for getting in touch.  Answers to your questions:

    1.  Yes, I have the 32.768KHz crystal mounted.  Its the ECS-.327-12.5-34B-C-TR from ECS with 18pF load capacitors

    2. I'm using Visual Studio Code (V1.71.2) as my IDE, and am running V2.0.0 of NCS and v2022.9.179 of the nRF Connect extension for VSC.

    3. I am using the nrf52dk_nrf52832.dts board file when I build my code.

    4. I have not yet tested the radio on my board, as I can't even get a simple LED blinky code running on it as yet.

    5. Yes, I can read the devices memory.  I did a comparative test here, following this process:

    (a) Programmed DK with a different version of code

    (b) Programmed my device using the LED blinky code.  Then read this back and saved as a file

    (c) Disconnected my device and then read back the code in the DK.  Checked this against the file in (b).  I didn't do an exhaustive comparison, but I could see the files were different

    (d) Programmed my DK with the same code I had programmed the device with in (b)

    (e) Read back the file from my DK and compared this to the file I read back in (b).  Again, I didn't do an exhaustive comparison, but it looked to me like they were the same file.

    So, this seems to indicate that my device is actually being programmed, but for whatever reason its not actually running the code as expected.

    I've disconnected all physical connections to my device apart from the crystals, the VDD/GND and SWDIO/SWDCLK signals and all the various PSU decoupling capacitors.

    Regards,

    Mike

  • Did some more work on this today:

    1) Swapped out the 32MHz Xtal on my custom board with the 32MHz xtal off my DK and re-tested.  The DK worked with the 32MHz xtal off my custom board but my custom board isn't working with the 32MHz xtal off the DK

    2) Had a detailed look at the recommended layout as per the DK documentation.  The only thing I've done differently that might be an issue is that I've not made the VSS connection to Pin 31 in the recommended way.  But I can't see that preventing the chip from functioning at all.

    I've got a 4 layer PCB with GND pours on the bottom layer, top layer and layer 2.  I've also got a pour on layer 3 that is connected to VDD.

    Screen shots of the layout around the chip are shown below:

    Top Layer:

    Layer 2 (GND Pour):

    Layer 3 (VDD pour):

    Bottom Layer (GND pour):

    Regards,

    Mike

  • OK, some more info.

    Ran the debugger on my custom board.  It seems to be running the code as expected, as I can see if running through the while loop.  If I dive into the gpio_pin_toggle_dt(&led_grn) function, I can see it running a bunch of GPIO API's. Not sure how I can watch the GPIO register to confirm its toggling the status of the appropriate GPIO though.

    But monitoring the physical pin with my scope, I'm not seeing any change in the state of the pin.  I see the same outcome if I let the code run "free" without the debugger.

    So, its like the GPIO isn't being configured for my custom board chip correctly.  Not sure why though

    Regards,

    Mike

Related