Re: [Zephyr-users] Power Configuration of nrf52840 (Vikrant More)


laczenJMS
 

Hi Vikrant,

NFFS file system might not be a good choice to store frequently changing data.

For this case I have created a library called sfcb that you can find
in my zephyr project fork: https://github.com/Laczen/zephyr. The sfcb
(simple flash circular buffer) allows you to store data in a series of
sectors in flash.

All data is stored as a identifier-value pair, the identifier is a 16
bit value, the data can be anything from a byte to a very long string
of bytes (limited by the sector size). By writing a new
identifier-value pair the previous pair with the same identifier is
considered overwritten.

When all the available sectors have been used the library does a
garbage collection phase before erasing a sector. In this phase it
makes sure that there is at least one identifier-value pair for each
identifier.

The library allows you to combine almost constant data: node address,
netkeys, groups together with frequently changing data: sequence
number, iv_index into one storage solution, without wearing out flash
to fast. The almost constant data could be stored into one
identifier-value pair, the frequently changing in a different
identifier-value pair. Of course for the sequence number you will need
to avoid storing it for every change.

It can also be used in different cases where you would like to combine
the storage of network address, device name, ... in combination with
the device state (e.g. light switched on) in the same storage
solution.

Another use of the library is to consider the identifier as a file
name and the value as file contents.

In my zephyr project fork you can find a simple example in samples/subsys/sfcb.

Kind regards,

Jehudi

2018-02-10 7:17 GMT+01:00 <zephyr-devel-request@lists.zephyrproject.org>:

Send Zephyr-devel mailing list submissions to
zephyr-devel@lists.zephyrproject.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
or, via email, send a message with subject or body 'help' to
zephyr-devel-request@lists.zephyrproject.org

You can reach the person managing the list at
zephyr-devel-owner@lists.zephyrproject.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Zephyr-devel digest..."


Today's Topics:

1. Re: [Zephyr-users] Power Configuration of nrf52840 (Vikrant More)


----------------------------------------------------------------------

Message: 1
Date: Sat, 10 Feb 2018 11:47:25 +0530
From: Vikrant More <vikrant8051@gmail.com>
To: "Chettimada, Vinayak Kariappa"
<vinayak.kariappa.chettimada@nordicsemi.no>,
zephyr-devel@lists.zephyrproject.org,
zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] [Zephyr-users] Power Configuration of
nrf52840
Message-ID:
<CAOMoz5q5ax4czmOdxXEQxcEmFRq4dHEFpcoT7P3cZAN7cNs2CQ@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

But nrf52 flash support 10K write cycle. And it is like normal programming,
isn't it ?

Worrying after reading your this statement, since I'm now trying to save
persistent data which generate during working of #BluetoothMesh on flash of
nRF52.

I used NFFS file system for testing.

On Feb 10, 2018 10:57 AM, "Chettimada, Vinayak Kariappa" <
vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Hope you are doing it ?only once per board?s life time? else you could be
degrading the flash. Hence, my advice is to use nrfjprog to make the change
"only once" per each board or use the design in soc.c wherein the value is
first compared before writing.

-Vinayak

On 9 Feb 2018, at 07:20, ashish.shukla@corvi.com wrote:

Thanks everyone !!!

Adding these lines does the job.

NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
}

NRF_UICR->EXTSUPPLY = 0x01;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
}

NRF_UICR->REGOUT0 = 0x05;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
}

NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
{
}


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development
www.corvi.com


Please consider the environment before printing this e-mail or its
attachments.

Disclaimer: The information contained herein (including any accompanying
documents) is confidential and is intended solely for the addressee(s). If
you have erroneously received this message, please immediately delete it
and notify the sender. Also, if you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this message or any accompanying
document is strictly prohibited and is unlawful. The organization is not
responsible for any damage caused by a virus or alteration of the e-mail by
a third party or otherwise. The contents of this message may not
necessarily represent the views or policies of Corvi


On Thu, Feb 8, 2018 at 12:17 AM, Vinayak Kariappa <vinayak.kariappa@
gmail.com> wrote:

Hi Ashish,

UICR is Flash, you need to do something similar to in soc.c done for
reset pin config. Or use nrfjprog to write values to UICR

Sent from my iPhone

On 7 Feb 2018, at 12:04, "ashish.shukla@corvi.com" <
ashish.shukla@corvi.com> wrote:

Hi,

Yes, I'm working in high voltage mode. VDDH = 3.6V

Then, I added following lines

NRF_POWER->DCDCEN0 = 0x01; // Enabling DC/DC for stage REG0
NRF_POWER->DCDCEN = 0x01; // Enabling DC/DC for stage REG1

Again, as you suggested

NRF_UICR->EXTSUPPLY = 0x01;
NRF_UICR->REGOUT0 = 0x05;

After adding these lines at starting of main() function, It still
measures 1.8V.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development
www.corvi.com


Please consider the environment before printing this e-mail or its
attachments.

Disclaimer: The information contained herein (including any accompanying
documents) is confidential and is intended solely for the addressee(s). If
you have erroneously received this message, please immediately delete it
and notify the sender. Also, if you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this message or any accompanying
document is strictly prohibited and is unlawful. The organization is not
responsible for any damage caused by a virus or alteration of the e-mail by
a third party or otherwise. The contents of this message may not
necessarily represent the views or policies of Corvi


On Wed, Feb 7, 2018 at 4:16 PM, Puzdrowski, Andrzej <
Andrzej.Puzdrowski@nordicsemi.no> wrote:

Hi

So you must have supplied nRF52840 from VDDH pin ? so it power regulator
circuit works in high voltage mode.



Then internal regulator generate the GPIO output voltage:

You need to set UICR->REGOUT0 properly, 5 is proper value for select 3.3
V



For more info see nRF52840 OPS, especjali POWER chapter



Andrzej



*From:* zephyr-devel-bounces@lists.zephyrproject.org [mailto:
zephyr-devel-bounces@lists.zephyrproject.org] *On Behalf Of *
ashish.shukla@corvi.com
*Sent:* Wednesday, February 07, 2018 8:22 AM
*To:* zephyr-devel@lists.zephyrproject.org; zephyr-
users@lists.zephyrproject.org
*Subject:* [Zephyr-devel] Power Configuration of nrf52840



Hello everyone !!!

I'm working with custom PCB of nrf52840. I need to set VDD voltage which
is also GPIO high level voltage equals to 3.3V, otherwise it's 1.8V by
default.


How can I configure this?

or

How can I access registers of nrf52840 in zephyr architecture?





--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

www.corvi.com



Please consider the environment before printing this e-mail or its
attachments.



Disclaimer: The information contained herein (including any accompanying
documents) is confidential and is intended solely for the addressee(s). If
you have erroneously received this message, please immediately delete it
and notify the sender. Also, if you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this message or any accompanying
document is strictly prohibited and is unlawful. The organization is not
responsible for any damage caused by a virus or alteration of the e-mail by
a third party or otherwise. The contents of this message may not
necessarily represent the views or policies of Corvi


_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel



_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zephyrproject.org/pipermail/zephyr-devel/attachments/20180210/51618262/attachment.html>

------------------------------

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


End of Zephyr-devel Digest, Vol 14, Issue 32
********************************************

Join devel@lists.zephyrproject.org to automatically receive all group messages.