Topics

PCA10059 without additional debugger - non-volatile storage of settings


Martin <ma@...>
 

Hi,
I know it is a quite specific question, but I thought that maybe
someone has an idea into which direction to go..

I have some PCA10059 (nRF52-Dongles) lying around and would like to
make experiments with them running Zephyr OS. Unfortunately, I do not
have a an appropriate cable for connecting it to my nRF52 DK to flash
it and buying a cable would crash my budget.

Luckily, work has been ongoing to make flashing the PCA10059 possible
without an external debugger. The solution (how I understand it) is
that the stock Nordic bootloader remains on the PCA10059, loads
MCUboot, which in turn loads Zephyr OS. The merge request can be found
here: https://github.com/zephyrproject-rtos/zephyr/pull/11210

I have playing around with it (i.e. flash samples/bluetooth/mesh) and
can report that it is working. I had to make two modifications:
Comment storage_partition in
boards\arm\nrf52840_pca10059\nrf52840_pca10059.dts, such that there is
no duplicate collision with dts/common/nrf52840-nrf5-*.overlay and
strangely (I would interpret the documention differently) keep Kconfig
settings how they are (leave CONFIG_BOOTLOADER_MCUBOOT=n).

The "only" problem I have: Storage of settings does not work. The
symptoms are that I have to re-provision the PCA10059 every time it is
power-cycled.

I have been playing around with storage settings in the .dts-files
(changing the memory regions) with no success. Attached is the
_dts_compiled that is generated during the build phase and a
screenshot of nrf connect showing in which regions code resides.

Has anyone already gotten storage of settings with PCA10059 to work
(possibly even with the traditional debugger solution)? And does
anyone have a clue / an idea why it is not working and where I should
look into?

Thanks,
Martin


lairdjm
 

Hi Martin,
You have this in your DTS:
storage_partition: partition@fa000 {
label = "storage";
reg = < 0xfa000 0x4000 >;
};

You are setting the storage partition to 0xfa000, from your picture, the Nordic bootloader starts at 0xe0000, so yes the settings will never work because you're attempting to overwrite the bootloader. Luckily for you it looks like the bootloader enables write protection using ACL, otherwise it's likely your module would no longer be working.
Thanks,
Jamie


Martin <ma@...>
 

Hi Jamie,
thanks!
I was already trying different values, such as

storage_partition: partition@b0000 {
label = "storage";
reg = < 0xb0000 0x4000 >;
};

unfortunately without success.. The display of nRF Connect does not
change here, such that it does not show an additional region for the
config (I don't know if it is supposed to).

Best regards,
Martin

Am Do., 27. Dez. 2018 um 15:07 Uhr schrieb Jamie Mccrae
<Jamie.Mccrae@lairdtech.com>:


Hi Martin,
You have this in your DTS:
storage_partition: partition@fa000 {
label = "storage";
reg = < 0xfa000 0x4000 >;
};

You are setting the storage partition to 0xfa000, from your picture, the Nordic bootloader starts at 0xe0000, so yes the settings will never work because you're attempting to overwrite the bootloader. Luckily for you it looks like the bootloader enables write protection using ACL, otherwise it's likely your module would no longer be working.
Thanks,
Jamie


Martin <ma@...>
 

Hi,
in case anyone else is interested: lemrey has reworked the patch at
https://github.com/zephyrproject-rtos/zephyr/pull/11210 today to
address some comments. With the update, non-volatile storage of
settings is also possible on the dongles. Note that flashing with nRF
connect does not work and nrfutil has to be used instead. Thanks to
everyone involved and I hope to see this in the official Zephyr master
soon :)

Martin

Am Do., 27. Dez. 2018 um 15:02 Uhr schrieb Martin J├╝rgens <ma@jgs-wg.de>:


Hi,
I know it is a quite specific question, but I thought that maybe
someone has an idea into which direction to go..

I have some PCA10059 (nRF52-Dongles) lying around and would like to
make experiments with them running Zephyr OS. Unfortunately, I do not
have a an appropriate cable for connecting it to my nRF52 DK to flash
it and buying a cable would crash my budget.

Luckily, work has been ongoing to make flashing the PCA10059 possible
without an external debugger. The solution (how I understand it) is
that the stock Nordic bootloader remains on the PCA10059, loads
MCUboot, which in turn loads Zephyr OS. The merge request can be found
here: https://github.com/zephyrproject-rtos/zephyr/pull/11210

I have playing around with it (i.e. flash samples/bluetooth/mesh) and
can report that it is working. I had to make two modifications:
Comment storage_partition in
boards\arm\nrf52840_pca10059\nrf52840_pca10059.dts, such that there is
no duplicate collision with dts/common/nrf52840-nrf5-*.overlay and
strangely (I would interpret the documention differently) keep Kconfig
settings how they are (leave CONFIG_BOOTLOADER_MCUBOOT=n).

The "only" problem I have: Storage of settings does not work. The
symptoms are that I have to re-provision the PCA10059 every time it is
power-cycled.

I have been playing around with storage settings in the .dts-files
(changing the memory regions) with no success. Attached is the
_dts_compiled that is generated during the build phase and a
screenshot of nrf connect showing in which regions code resides.

Has anyone already gotten storage of settings with PCA10059 to work
(possibly even with the traditional debugger solution)? And does
anyone have a clue / an idea why it is not working and where I should
look into?

Thanks,
Martin