Hi there,
I am currently trying to program a custom PCB equipped with the BMD-380 that has the nrf52480 inside. Sadly, I am now stuck for days with the same issue: It simply will not write anything to memory.
For creating my board definition files I mostly relied on the existing files for the BMD-380. As we will only use some specific parts the .dts is only a reduced version of the one from from the BMD-380:
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition.dtsi>
#include "sensor_station_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Custom u-blox BMD-380";
compatible = "u-blox,sensor_station_nrf52840";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
leds {
compatible = "gpio-leds";
led_r: red_led {
gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
label = "LED_R";
};
};
buttons {
compatible = "gpio-keys";
sw0: sw_0 {
gpios = <&gpio1 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "SW0";
zephyr,code = <INPUT_KEY_0>;
};
// 3 more buttons
};
pwmleds {
compatible = "pwm-leds";
pwm_ec: ec_pwm {
pwms = <&pwm0 0 PWM_USEC(100) PWM_POLARITY_NORMAL>;
label = "EC_PROBE_PWM_OUT";
};
};
adc_channels {
compatible = "adc-io-channels";
vbat_channel: vbat_ch {
io-channels = <&adc 0>; // AIN0 = P0.02
label = "VBAT_MEAS";
};
// 3 more channels
};
aliases {
led0 = &led_r;
pwm-led0 = &pwm_ec;
sw0 = &sw0;
watchdog0 = &wdt0;
adc-vbat = &vbat_channel;
// additional labels
};
};
®1 {
regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
};
&adc {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&gpiote {
status = "okay";
};
&uicr {
gpio-as-nreset;
};
&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&clock {
status = "okay";
};
The other files are pretty much kept as they are apart from changing the pins in the pinctrl.dtsi
The next step was to have a simple blinky (or even empty) application and try to flash it to the chip with a J-Tag connection. The VSCode extension detects the debugger and the chip. Nevertheless running
$ nrfjprog --program /home/thomas/Documents/vac/test/blinky/build/merged.hex --recover --verify -f NRF52 --snr 801045345
will return the following:
[ #################### ] 0.646s | Erase file - Done erasing
[error] [ Client] - Encountered error -102: Command program_file executed for 422 milliseconds with result -102
[error] [ nRF52] - The write access failed, but no cause could be determined.
[error] [ nRF52] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
[error] [ nRF52] - Failed while performing 'Write' operation on target address 0x00000000.
-102: An unknown error.
[error] [ nRF52] - Failed while reading device information.
[error] [ Worker] - An unknown error.
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
I also made the sure APPROTECT is not active by running $ nrfjprog --recover --family NRF52.
I also read the status with $ nrfjprog --readregs --snr 801045345 which returns 0xFFFFFFFF.
Here is the logfile after trying to program:
721252.log.log
Sadly, I am out of ideas what to try or where the error might be. Does someone had a similar issue and might want to share the experience with it?
Thank you very much in advance.
Best Regards
Thomas