nrf52840 QFN48 pin debugging

Hello,

I've got a nrf52840 DK to flash custom PCB with nrf52840 QFN. I can flash the custom PCB by using <nrfjprog> command into VSCode but the code doesn't seem to work. The short code is intended to verify if the chip is alive by setting physical pin 13 (acc. to Data Sheet is P0.13) on high:

#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

int main(void)
{
    const struct device *gpio0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));

    if (!device_is_ready(gpio0)) {
        while (1) {
            /* stop here if GPIO0 not ready */
        }
    }

    /* Configure P0.13 as output, initial HIGH */
    gpio_pin_configure(gpio0, 13, GPIO_OUTPUT_ACTIVE);

}


A. I'm not using DCDC converter so, I've written in overlay the following lines:

&reg1 {
	regulator-initial-mode = <NRF5X_REG_MODE_LDO>;
};

&reg0 {
    status = "okay";
};

B. I'm not using low oscillator so, I've written in prj.conf the following lines:

CONFIG_GPIO=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

The rest of the connections, especially DEC1, DEC3, DEC4, DEC6, are according to the QFN reference design.

For the custom programming my pipeline is the following:

1. Connect custom PCB to DK to P20 according to the instructions(https://docs.nordicsemi.com/bundle/ug_nrf52840_dk/page/UG/dk/ext_programming_support_P20.html) where I'm using an external supply.

2. After I built the code I'm executing the following commands in VSCode terminal:

2a. Erase the entire chip flash with: nrfjprog --eraseall

2b. Upload merged.hex with: nrfjprog --program merged.hex

2c. Verify QFN memory with: nrfjprog --memrd 0x00000000 --n 256

2d. Compare QFN memory with a hex reading program - I'm using J-Flash V9.14a.

NOTE: I'm sure that I'm uploading the code to the QFN since the DK nrf chip is running LED flash sample and its unaffected.

With all these set-ups I didn't measure 3V on QFN physical pin 13... still 0V. My debugging questions are:

1. I've written correctly the pin-13 mapping lines for QFN? I know that pin 13 on DK has a different mapping since the package is QIAA.

2. I'm using 32MHz XTAL for high oscillator but with a different capacitors values (acc. to manufacturer) than the reference design. I've notice in Data Sheet that nrf prioritize internal high oscillators by default ( as long as I didn't use BLE) so, if my XTAL doesn't work due to unmatched caps, the chip shall work. The problem can arise from this? I need extra lines in prj.config to switch on the internal high oscillator?

3. Is there another fast check if chip is running the custom code and its alive? Maybe UART over DK JLINK debugger?

Regards,
Luke

Related